Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3505184imu; Mon, 28 Jan 2019 06:07:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN56/bGUHea2BYRfdpAU+Lnh3EB5ogS9vM9c5vKoObLgXUxi8r3wXj34wAFOO6zVHhDu5wOO X-Received: by 2002:a63:fc49:: with SMTP id r9mr19545190pgk.209.1548684478588; Mon, 28 Jan 2019 06:07:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548684478; cv=none; d=google.com; s=arc-20160816; b=eAvUu0nuoBcXsxvycbtG6CwutbJrCO4dCa6/UHeNqeWTyDyehQC2xqxazUb0zxAcs+ 6u3fr/8EezeFzkYbo74QSbMBwfhZBS64ALTAnAmHvj12PoKJoH/5QtJEkiyJqw2vopun RrJVmBuo1DpVENyq1bK9nP3kyDiY183ZNSbN1ZbAIvdEQMRwlaJUycr9Jh1W+DxBANLt VSlUZ+gwGzOasDPinj0qkS4RailEtq8qhdxUKskDb8qnN37j4OUJjrJtXudszuvs7WSj pDVSoqBmw8KkKTPp9fX6Mptcj9DVECFhV1OxqnXR72iF46KIo9SQSfav3Bxj7kflXkgL o56Q== 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=vDCCNOwUm0Qt8G/hWqB2tUkiWFHll9WCDvoKYxad5T0=; b=Ua2xjIhGyy6YbmDAkDARzoJ+IuogaEMSoYlVBHSCtlqY9qdy0yqUqEUvlkENo3QG/B GLKMv1mflrhIGP2afPMhbVaAOTP6MsPez4Sa53Zo6Ny6pKYE4zPcIeq+N8dyJ56CVMli khfNpqSt5wfzcxiZLt6NtfSLFcSFGRsTn8iUd5UXxH30PEchdu8gY2JGuC6Nhflicak5 kC22vK9bj8D/VNeviVl+No4ePfBHNLbRsCLCcs92QoqUZvBtlvK/sfQWzWszyTJUKF4T naw1aDrwxQdrHZdvdOsbZIYnw/bMIEuAi7ewH3ol8hyBxSxjw/TD67vOKVCigIjoklB4 3lrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DtW8guzV; 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 m4si21871954pgk.399.2019.01.28.06.07.42; Mon, 28 Jan 2019 06:07:58 -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=DtW8guzV; 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 S1726766AbfA1OHZ (ORCPT + 99 others); Mon, 28 Jan 2019 09:07:25 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:51926 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbfA1OHY (ORCPT ); Mon, 28 Jan 2019 09:07:24 -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=vDCCNOwUm0Qt8G/hWqB2tUkiWFHll9WCDvoKYxad5T0=; b=DtW8guzVcMSB+Tzs45kNOSA9o rU1K04LWeKGspwX45lfk2e6mYAZmjCXVXoRM8Tqu/jNsXXPg/cVU+6cpdKRCNqNFgtQHAxY5j4FZt X0r54KJxgt1kN+OyF/4Z1muFa9fH5MyEOwsFUEJbIP9DkkDTKMFoTGZpwPUUpmPaqHcvowZQdNXL2 CsKiGEZY+83A4j6mxHIKKmUHBImhfppYt20uYMyfwL98RmZCsQKa4M2PXd5ieNz+O1szpQV/KEJc1 +bYW56P93NF4wVULtdEdAKqrcX9C8hYYUceJtHaU1YXkt5IAryMu6OaKGGGWLaIcleaFqZEpNxnVs VSGmIIM6A==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1go7ZE-0007An-Un; Mon, 28 Jan 2019 14:07:16 +0000 Date: Mon, 28 Jan 2019 06:07:16 -0800 From: Christoph Hellwig To: "chenxiang (M)" Cc: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linuxarm@huawei.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, john.garry@huawei.com, 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: <20190128140716.GA18162@infradead.org> References: <1548337430-66690-1-git-send-email-chenxiang66@hisilicon.com> <1c34d6f9-8c3c-a7ff-a956-46e9dc3c2298@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c34d6f9-8c3c-a7ff-a956-46e9dc3c2298@hisilicon.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 > > for rq->cmd_flags. It will cause dix=0 in function > > sd_setup_read_write_cmnd() when enabled DIX, which will cause IO > > exception when enabled DIX. > > > > For some IOs such as internal IO from SCSI layer, the parameter bio of > > function blk_mq_get_request() is Null, so need to check bio to > > decise rq->cmd_flags. We have data->cmd_flags to deal with the NULL bio case. blk_mq_make_request initializes data->cmd_flags from bio->bi_opf just before calling blk_mq_get_request, so I'm really missing what you are trying to fix here.