block: correctly report cache type
authorChristoph Hellwig <hch@lst.de>
Wed, 26 Jun 2024 14:26:23 +0000 (16:26 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 26 Jun 2024 15:37:35 +0000 (09:37 -0600)
commit78887d004fb2bb03233122a048eaf46e850dabf4
tree03ea0533cd646de1c2a5f08edde118e773d4f881
parent573d5abf3df00c879fbd25774e4cf3e22c9cabd0
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>
block/blk-sysfs.c