From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] block: set rq->cmd_flags with bio->opf instead of data->cmd_flags when bio is not Null Date: Mon, 28 Jan 2019 07:57:52 -0800 Message-ID: <20190128155752.GA29076@infradead.org> References: <1548337430-66690-1-git-send-email-chenxiang66@hisilicon.com> <1c34d6f9-8c3c-a7ff-a956-46e9dc3c2298@hisilicon.com> <20190128140716.GA18162@infradead.org> <55972c1a-051a-1396-6796-84f349830a35@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <55972c1a-051a-1396-6796-84f349830a35@huawei.com> Sender: linux-kernel-owner@vger.kernel.org To: John Garry Cc: Christoph Hellwig , "chenxiang (M)" , jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linuxarm@huawei.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, "linux-block@vger.kernel.org" List-Id: linux-scsi@vger.kernel.org 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);