From: Christoph Hellwig <hch@lst.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
axboe@kernel.dk, philipp.reisner@linbit.com,
lars.ellenberg@linbit.com, target-devel@vger.kernel.org,
haris.iqbal@ionos.com, jinpu.wang@ionos.com, manoj@linux.ibm.com,
mrochs@linux.ibm.com, ukrishn@linux.ibm.com,
linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
drbd-dev@lists.linbit.com, dm-devel@redhat.com
Subject: Re: [PATCH 7/7] block: remove REQ_OP_WRITE_SAME support
Date: Tue, 22 Feb 2022 08:38:33 +0100 [thread overview]
Message-ID: <20220222073833.GA4979@lst.de> (raw)
In-Reply-To: <yq135kefh5j.fsf@ca-mkp.ca.oracle.com>
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@lst.de>
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@lst.de>
---
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
next prev parent reply other threads:[~2022-02-22 7:46 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 8:28 remove REQ_OP_WRITE_SAME v2 Christoph Hellwig
2022-02-09 8:28 ` [PATCH 1/7] cxlflash: query write_zeroes limit for zeroing Christoph Hellwig
2022-02-09 8:43 ` Chaitanya Kulkarni
2022-02-09 8:28 ` [PATCH 2/7] drbd: drop REQ_OP_WRITE_SAME support Christoph Hellwig
2022-02-09 8:28 ` [PATCH 3/7] rnbd: drop WRITE_SAME support Christoph Hellwig
2022-02-09 8:44 ` Chaitanya Kulkarni
2022-02-09 9:05 ` Guoqing Jiang
2022-02-09 9:13 ` Jinpu Wang
2022-02-09 9:21 ` Guoqing Jiang
2022-02-09 10:16 ` Jinpu Wang
2022-02-09 14:04 ` Christoph Hellwig
2022-02-09 14:08 ` Jinpu Wang
2022-02-09 8:28 ` [PATCH 4/7] sd: remove write same support Christoph Hellwig
2022-02-09 8:45 ` Chaitanya Kulkarni
2022-02-09 8:28 ` [PATCH 5/7] md: drop WRITE_SAME support Christoph Hellwig
2022-02-09 8:28 ` [PATCH 6/7] dm: remove write same support Christoph Hellwig
2022-02-16 18:45 ` Mike Snitzer
2022-02-09 8:28 ` [PATCH 7/7] block: remove REQ_OP_WRITE_SAME support Christoph Hellwig
2022-02-09 8:46 ` Chaitanya Kulkarni
2022-02-20 1:44 ` Martin K. Petersen
2022-02-22 7:38 ` Christoph Hellwig [this message]
2022-02-23 1:58 ` Martin K. Petersen
2022-02-09 8:47 ` remove REQ_OP_WRITE_SAME v2 Chaitanya Kulkarni
2022-02-09 18:00 ` Martin K. Petersen
2022-02-10 5:51 ` Christoph Hellwig
2022-02-17 3:07 ` Jens Axboe
2022-02-17 6:43 ` Christoph Hellwig
2022-02-18 4:27 ` Martin K. Petersen
2022-02-19 23:33 ` Martin K. Petersen
2022-02-28 3:43 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220222073833.GA4979@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=drbd-dev@lists.linbit.com \
--cc=haris.iqbal@ionos.com \
--cc=jinpu.wang@ionos.com \
--cc=lars.ellenberg@linbit.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=manoj@linux.ibm.com \
--cc=martin.petersen@oracle.com \
--cc=mrochs@linux.ibm.com \
--cc=philipp.reisner@linbit.com \
--cc=target-devel@vger.kernel.org \
--cc=ukrishn@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).