mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
block: report the correct discard alignment in sysfs
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: 4e1462ffe8 ("block: remove queue_discard_alignment")
Signed-off-by: Avi Weiss <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
+1
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user