On Sat, Feb 19, 2022 at 08:44:18PM -0500, Martin K. Petersen wrote: > > -static ssize_t queue_write_same_max_show(struct request_queue *q, char *page) > > -{ > > - return sprintf(page, "%llu\n", > > - (unsigned long long)q->limits.max_write_same_sectors << 9); > > -} > > - > > This tripped one of my test scripts. We should probably return 0 here > like we did for discard_zeroes_data and leave the sysfs entry in place. The maybe fold this in? --- >From eae8e9b8cff5ee8522b00430a4aabd01ebc7c55a Mon Sep 17 00:00:00 2001 From: Christoph Hellwig <hch@xxxxxx> Date: Tue, 22 Feb 2022 08:35:59 +0100 Subject: block: restore the write_same_max sysfs attribute Some userspace breaks if this attribute is gone. Restore it and always return 0. Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- block/blk-sysfs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 4a5bb47bee3ce..431fdd036f65a 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -212,6 +212,11 @@ static ssize_t queue_discard_zeroes_data_show(struct request_queue *q, char *pag return queue_var_show(0, page); } +static ssize_t queue_write_same_max_show(struct request_queue *q, char *page) +{ + return sprintf(page, "%llu\n", 0ULL); +} + static ssize_t queue_write_zeroes_max_show(struct request_queue *q, char *page) { return sprintf(page, "%llu\n", @@ -581,6 +586,7 @@ QUEUE_RO_ENTRY(queue_discard_max_hw, "discard_max_hw_bytes"); QUEUE_RW_ENTRY(queue_discard_max, "discard_max_bytes"); QUEUE_RO_ENTRY(queue_discard_zeroes_data, "discard_zeroes_data"); +QUEUE_RO_ENTRY(queue_write_same_max, "write_same_max_bytes"); QUEUE_RO_ENTRY(queue_write_zeroes_max, "write_zeroes_max_bytes"); QUEUE_RO_ENTRY(queue_zone_append_max, "zone_append_max_bytes"); QUEUE_RO_ENTRY(queue_zone_write_granularity, "zone_write_granularity"); @@ -636,6 +642,7 @@ static struct attribute *queue_attrs[] = { &queue_discard_max_entry.attr, &queue_discard_max_hw_entry.attr, &queue_discard_zeroes_data_entry.attr, + &queue_write_same_max_entry.attr, &queue_write_zeroes_max_entry.attr, &queue_zone_append_max_entry.attr, &queue_zone_write_granularity_entry.attr, -- 2.30.2 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/dm-devel