diff options
author | Christoph Hellwig <hch@lst.de> | 2024-06-26 16:26:23 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-06-26 09:37:35 -0600 |
commit | 78887d004fb2bb03233122a048eaf46e850dabf4 (patch) | |
tree | 03ea0533cd646de1c2a5f08edde118e773d4f881 /block | |
parent | 573d5abf3df00c879fbd25774e4cf3e22c9cabd0 (diff) |
block: correctly report cache type
Check the features flag and the override flag using the
blk_queue_write_cache, helper otherwise we're going to always
report "write through".
Fixes: 1122c0c1cc71 ("block: move cache control settings out of queue->flags")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240626142637.300624-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-sysfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 1a984179f3ac..3a167abecdce 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -453,9 +453,9 @@ static ssize_t queue_io_timeout_store(struct request_queue *q, const char *page, static ssize_t queue_wc_show(struct request_queue *q, char *page) { - if (q->limits.features & BLK_FLAG_WRITE_CACHE_DISABLED) - return sprintf(page, "write through\n"); - return sprintf(page, "write back\n"); + if (blk_queue_write_cache(q)) + return sprintf(page, "write back\n"); + return sprintf(page, "write through\n"); } static ssize_t queue_wc_store(struct request_queue *q, const char *page, |