[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <872f8c26-1c88-fe50-ffec-01c1e882245b@huawei.com>
Date: Mon, 28 Jan 2019 16:05:47 +0000
From: John Garry <john.garry@...wei.com>
To: Christoph Hellwig <hch@...radead.org>
CC: "chenxiang (M)" <chenxiang66@...ilicon.com>,
<jejb@...ux.vnet.ibm.com>, <martin.petersen@...cle.com>,
<linuxarm@...wei.com>, <linux-scsi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <axboe@...nel.dk>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>
Subject: Re: [PATCH] block: set rq->cmd_flags with bio->opf instead of
data->cmd_flags when bio is not Null
On 28/01/2019 15:57, Christoph Hellwig wrote:
> On Mon, Jan 28, 2019 at 03:36:58PM +0000, John Garry wrote:
>> As I understood, the problem is the scenario of calling
>> blk_mq_make_request()->bio_integrity_prep() where we then allocate a bio
>> integrity payload in calling bio_integrity_alloc().
>>
>> In this case, bio_integrity_alloc() sets bio->bi_opf |= REQ_INTEGRITY, which
>> is no longer consistent with data.cmd_flags.
>
> I don't see how that could happen:
>
> static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
> {
> ...
>
> if (!bio_integrity_prep(bio))
> return BLK_QC_T_NONE;
>
> ...
>
> data.cmd_flags = bio->bi_opf;
> rq = blk_mq_get_request(q, bio, &data);
>
>
Your code is different to mine, then I see that this has been fixed in
5.0-rc3:
commit 7809167da5c86fd6bf309b33dee7a797e263342f
Author: Ming Lei <ming.lei@...hat.com>
Date: Wed Jan 16 19:08:15 2019 +0800
block: don't lose track of REQ_INTEGRITY flag
We need to pass bio->bi_opf after bio intergrity preparing, otherwise
the flag of REQ_INTEGRITY may not be set on the allocated request, then
breaks block integrity.
Fixes: f9afca4d367b ("blk-mq: pass in request/bio flags to queue
mapping")
Cc: Hannes Reinecke <hare@...e.com>
Cc: Keith Busch <keith.busch@...el.com>
Signed-off-by: Ming Lei <ming.lei@...hat.com>
Signed-off-by: Jens Axboe <axboe@...nel.dk>
Sorry for the noise,
John
> .
>
Powered by blists - more mailing lists