* [PATCH] block: report the correct discard alignment in sysfs
@ 2026-10-31 10:20 Avi Weiss
0 siblings, 0 replies; only message in thread
From: Avi Weiss @ 2026-10-31 10:20 UTC (permalink / raw)
To: axboe; +Cc: linux-block, hch, mkp, linux-kernel, Avi Weiss
disk_discard_alignment_show() reports the physical I/O alignment offset
instead of the discard alignment. Devices can specify these offsets
independently, so the discard_alignment sysfs attribute can report the
wrong value.
Use bdev_discard_alignment() for the whole-disk attribute, as is already
done for partitions.
Fixes: 4e1462ffe899 ("block: remove queue_discard_alignment")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
block/genhd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/genhd.c b/block/genhd.c
index 10ca8b4d6eea..69204d44adae 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1146,7 +1146,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sysfs_emit(buf, "%d\n", bdev_alignment_offset(disk->part0));
+ return sysfs_emit(buf, "%u\n", bdev_discard_alignment(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
base-commit: 36aad21d50d1af3f6954bb0c988257a908202477
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-31 10:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-31 10:20 [PATCH] block: report the correct discard alignment in sysfs Avi Weiss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®