Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3619589imu; Mon, 28 Jan 2019 07:58:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN4twgiB7l0OVJLi8qoAxRWbg9ErweWkJWMT/obd/97BY8hsUrykeQP5wvPo3qk4EwXCARJh X-Received: by 2002:a62:2e46:: with SMTP id u67mr22011881pfu.3.1548691124411; Mon, 28 Jan 2019 07:58:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691124; cv=none; d=google.com; s=arc-20160816; b=gU/8rY06k9KhK9hSYxTcPiSEF38plmEJ/RORymI1lcA3s+QcvorPyejm7W4aOedn4h bUrLO6BiUKy2lrkZV9+/erA6r47oPsZ58fP1qze6/0iiXRsQFufQd+7MSZRRX/Jz+YZq Cg0ciZ7/UzMrD14M4mvdmm/COy1sSGg16dpaUSBRLgPjfNWBXa10GyaPXIllB/SQXrGw w5/MiPJ2PTDZJ0/iwK9xrszI9IX+AUoIWH2WCmIrvK+EBfC4AQGsqBO64xYURWnLdth7 s/fB6iWKd8Mgli4ge9ZNj2p0Uwf9OYgAFXbg7ibkekVYMOyKvJvlip/kbVy7/XmiVNMQ XfYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nKhBdv+Igs+P4UaZkx5EvY+zcrwZHuUbBgT3qdyrWfs=; b=cYjEuftqSFGeQ3i9EfgJni3W93m1djsJESsAfpkdTJE5MfFSk5GXekWfPw9NYE2bZm DpkHpMB+Ut0E+f37stSlRltTmcpHh6DIYRVOZeUCUqNTPO6o4FnTS7sZwzxZg5rFT0mo vhNQXl41+iIGbgEDGU6N2RiiD5NWrSLpuJepDsHgn/OTsUGx46KNxmxYv6nYRvOQH4wb dwB5QdhNVjc8JlCO3Ibc39Cu7rITH+bqT1ZeLDrsX6AT61o9gu0jRMAyZAB93mYl6Kzq V6a6GM92bPowD4McBSvU7d0gSbBkIC+1BfYkHaaGe+Kp5bMC0T7zMTuuYAYcRNejdB7K KhYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=B2KFs0uY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si33507336plp.114.2019.01.28.07.58.28; Mon, 28 Jan 2019 07:58:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=B2KFs0uY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730022AbfA1P6C (ORCPT + 99 others); Mon, 28 Jan 2019 10:58:02 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:50660 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729738AbfA1P6B (ORCPT ); Mon, 28 Jan 2019 10:58:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nKhBdv+Igs+P4UaZkx5EvY+zcrwZHuUbBgT3qdyrWfs=; b=B2KFs0uYk6Z2cMJtTiOz0FZvk y+i/NS8nc82gKsCjTl8y2jVXutywB+HEslfb1G6HO1yCP81BNZpGdCO5gm/jOTrDnM32YoPXgRFoC uyNFejzTKEx8nTPiOtWZBvuM94KiKeGUHDRpfJ57XVf9SudaYQJPdgDDIla1QbyisC6+Fu1H6IuCN PYgG32Z57QUW3OPvwShHmgHnQ6rnnN7wPv6uKlhjT7rt0X94KBjWcLRB8e0lwiohVakxGoXka+vQ2 RkV/nxS3Pfq/lE6Cpf8JzdVS5jYXuuO8hwY37wZiU0ssyqT8MjPjs655sm0WHHM/MTizTm8ne7G3D ctHVUmkLQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1go9IG-0007oc-T1; Mon, 28 Jan 2019 15:57:52 +0000 Date: Mon, 28 Jan 2019 07:57:52 -0800 From: Christoph Hellwig 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" Subject: Re: [PATCH] block: set rq->cmd_flags with bio->opf instead of data->cmd_flags when bio is not Null 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 Content-Disposition: inline In-Reply-To: <55972c1a-051a-1396-6796-84f349830a35@huawei.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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);