From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: "zhangxiaoxu (A)" <zhangxiaoxu5@huawei.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
John Dorminy <jdorminy@redhat.com>,
Mike Snitzer <snitzer@redhat.com>,
Heinz Mauelshagen <heinzm@redhat.com>,
Christoph Hellwig <hch@infradead.org>,
dm-devel@redhat.com,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Alasdair G Kergon <agk@redhat.com>
Subject: Re: block: Fix a WRITE SAME BUG_ON
Date: Tue, 19 Feb 2019 18:10:39 -0500 [thread overview]
Message-ID: <yq1tvgzl6hc.fsf@oracle.com> (raw)
In-Reply-To: <22afb417-1bc6-d638-def7-aa3dcc9bcd31@huawei.com> (zhangxiaoxu's message of "Mon, 18 Feb 2019 22:10:51 +0800")
Hi Zhang,
> ping.
>
> Anyone can help merge this patch? or any other solutions?
+ /* If the logical block size is different, forbid write same */
+ if (t->logical_block_size != b->logical_block_size &&
+ t->max_write_same_sectors != UINT_MAX)
+ t->max_write_same_sectors = 0;
+ else
+ t->max_write_same_sectors = min(t->max_write_same_sectors,
+ b->max_write_same_sectors);
+
I am not particularly keen on this UINT_MAX magic. I would prefer to
have the stacking driver default for lbs be set to 0 so the stacking
function could avoid special-casing the first iteration. But I am not
sure whether that would break any assumptions in DM/MD wrt. the logical
block size being non-zero prior to calling the stacking function.
Mike? Any comments?
If we stick with the UINT_MAX check, the comment should at least point
out why it's there.
--
Martin K. Petersen Oracle Linux Engineering
WARNING: multiple messages have this Message-ID (diff)
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: "zhangxiaoxu \(A\)" <zhangxiaoxu5@huawei.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
Christoph Hellwig <hch@infradead.org>,
Heinz Mauelshagen <heinzm@redhat.com>,
John Dorminy <jdorminy@redhat.com>, <axboe@kernel.dk>,
Mike Snitzer <snitzer@redhat.com>, <linux-block@vger.kernel.org>,
<dm-devel@redhat.com>, Alasdair G Kergon <agk@redhat.com>
Subject: Re: [dm-devel] block: Fix a WRITE SAME BUG_ON
Date: Tue, 19 Feb 2019 18:10:39 -0500 [thread overview]
Message-ID: <yq1tvgzl6hc.fsf@oracle.com> (raw)
In-Reply-To: <22afb417-1bc6-d638-def7-aa3dcc9bcd31@huawei.com> (zhangxiaoxu's message of "Mon, 18 Feb 2019 22:10:51 +0800")
Hi Zhang,
> ping.
>
> Anyone can help merge this patch? or any other solutions?
+ /* If the logical block size is different, forbid write same */
+ if (t->logical_block_size != b->logical_block_size &&
+ t->max_write_same_sectors != UINT_MAX)
+ t->max_write_same_sectors = 0;
+ else
+ t->max_write_same_sectors = min(t->max_write_same_sectors,
+ b->max_write_same_sectors);
+
I am not particularly keen on this UINT_MAX magic. I would prefer to
have the stacking driver default for lbs be set to 0 so the stacking
function could avoid special-casing the first iteration. But I am not
sure whether that would break any assumptions in DM/MD wrt. the logical
block size being non-zero prior to calling the stacking function.
Mike? Any comments?
If we stick with the UINT_MAX check, the comment should at least point
out why it's there.
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2019-02-19 23:10 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 2:11 [v2] block: Fix a WRITE SAME BUG_ON Zhang Xiaoxu
2019-01-26 11:17 ` John Dorminy
2019-01-26 11:17 ` [dm-devel] " John Dorminy
2019-01-28 5:48 ` zhangxiaoxu (A)
2019-01-28 5:48 ` [dm-devel] " zhangxiaoxu (A)
2019-01-28 22:14 ` Mike Snitzer
2019-01-28 22:14 ` Mike Snitzer
2019-01-29 4:54 ` Martin K. Petersen
2019-01-29 4:54 ` Martin K. Petersen
2019-01-29 8:52 ` Christoph Hellwig
2019-01-29 8:52 ` Christoph Hellwig
2019-01-30 6:50 ` zhangxiaoxu (A)
2019-01-30 6:50 ` zhangxiaoxu (A)
2019-01-30 14:08 ` John Dorminy
2019-01-30 14:08 ` John Dorminy
2019-01-31 0:58 ` zhangxiaoxu (A)
2019-01-31 0:58 ` zhangxiaoxu (A)
2019-01-31 2:23 ` Martin K. Petersen
2019-01-31 2:23 ` Martin K. Petersen
2019-01-31 10:39 ` Christoph Hellwig
2019-01-31 10:39 ` Christoph Hellwig
2019-01-31 19:41 ` John Dorminy
2019-01-31 19:41 ` John Dorminy
2019-02-01 7:35 ` Christoph Hellwig
2019-02-01 7:35 ` Christoph Hellwig
2019-02-01 14:09 ` John Dorminy
2019-02-01 14:09 ` John Dorminy
2019-02-01 16:03 ` Heinz Mauelshagen
2019-02-01 16:03 ` [dm-devel] " Heinz Mauelshagen
2019-02-01 16:18 ` Christoph Hellwig
2019-02-01 16:18 ` [dm-devel] " Christoph Hellwig
2019-02-12 3:11 ` zhangxiaoxu (A)
2019-02-12 3:11 ` [dm-devel] " zhangxiaoxu (A)
2019-02-14 2:31 ` Martin K. Petersen
2019-02-14 2:31 ` [dm-devel] " Martin K. Petersen
2019-02-14 9:36 ` zhangxiaoxu (A)
2019-02-14 9:36 ` [dm-devel] " zhangxiaoxu (A)
2019-02-18 14:10 ` zhangxiaoxu (A)
2019-02-18 14:10 ` [dm-devel] " zhangxiaoxu (A)
2019-02-19 23:10 ` Martin K. Petersen [this message]
2019-02-19 23:10 ` 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=yq1tvgzl6hc.fsf@oracle.com \
--to=martin.petersen@oracle.com \
--cc=agk@redhat.com \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=hch@infradead.org \
--cc=heinzm@redhat.com \
--cc=jdorminy@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=snitzer@redhat.com \
--cc=zhangxiaoxu5@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.