From patchwork Wed May 10 08:51:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung Choi X-Patchwork-Id: 13236646 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35E82C7EE22 for ; Wed, 10 May 2023 08:51:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236824AbjEJIvs (ORCPT ); Wed, 10 May 2023 04:51:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236839AbjEJIvf (ORCPT ); Wed, 10 May 2023 04:51:35 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F32C47EEA for ; Wed, 10 May 2023 01:51:14 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20230510085113epoutp02913f6eb6149ce1f03c704fb5968c0226~dvB4rEHAJ0104101041epoutp02Y for ; Wed, 10 May 2023 08:51:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20230510085113epoutp02913f6eb6149ce1f03c704fb5968c0226~dvB4rEHAJ0104101041epoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1683708673; bh=SMZ7aaeVPcRwQ18QiSqKaop+raZWNO8lsaDIbQ+02HA=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=TWcJKNXImvYJvCzWTvitvOs5oXmTxT7WU4sVw38I28KIFR5u0mXaChDuIGC5YVNA2 ZRZ8sEkjyfrfkQtrWLd33NWtBza9VGTrhMXjZ8WSWlmNPpLec3fbLymM5SoSNHWF0j 3ZRJBURmSkAT6aoBv+wAvDwKsnA9TM8lDVDyqUm8= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20230510085112epcas2p3c8db972028412c72bfa8006f836edd58~dvB33_zG80654406544epcas2p3z; Wed, 10 May 2023 08:51:12 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.89]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4QGTJw046Cz4x9Q7; Wed, 10 May 2023 08:51:12 +0000 (GMT) X-AuditID: b6c32a47-c29ff70000002007-20-645b5affbfbf Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id A9.F5.08199.FFA5B546; Wed, 10 May 2023 17:51:11 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v2 04/14] block: fix not to apply bip information in blk_rq_bio_prep() Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: Jinyoung CHOI , "axboe@kernel.dk" , "kbusch@kernel.org" , "hch@lst.de" , "sagi@grimberg.me" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "johannes.thumshirn@wdc.com" , "kch@nvidia.com" , "willy@infradead.org" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20230510084407epcms2p123f17696d3c30c749897eeaf2c4de684@epcms2p1> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20230510085111epcms2p7022e97fd97c1a32c59f935d72f8dda94@epcms2p7> Date: Wed, 10 May 2023 17:51:11 +0900 X-CMS-MailID: 20230510085111epcms2p7022e97fd97c1a32c59f935d72f8dda94 X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P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ZOW+1bLXd9ok+iyMICXIShbbsUxj7TKL4dTjfY/65jygUvw7Mm3vHeWnzp6l79m 0yp5y9WKvNrHrjn4nTaQ4L/bEbFq+/uXd1caR7Dsay5RcW9ePatp9+PAl/tT9X4U6H1Nz93T Gtf99/mumb2PKnzuHZro8fVCmVf5sZbj1QmFoWKFvUUaf1c3LJau2n9Qql0wcO7u5KnhvA1z /j/Y9ZbXOGJt+k75bUx3J8bfLV0q5eQ+J0hxxsNlzzIEbJMP5py4PLmxsWzicu6Zp7edeKzE UpyRaKjFXFScCAAYywQtSwQAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230510084407epcms2p123f17696d3c30c749897eeaf2c4de684 References: <20230510084407epcms2p123f17696d3c30c749897eeaf2c4de684@epcms2p1> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org When a request is initialized through the bio, bio's integrity information is not reflected in the request. It seems to be missing when the codes associated with 'nr_integrity_segment' were added. the lld such as scsi does not refer to this variable. It uses integrity's bevc to calculate the number of segments for sg-list. So there seems to be no problem related to this. Cc: Christoph Hellwig Cc: Martin K. Petersen Fixes: 13f05c8d8e98 ("block/scsi: Provide a limit on the number of integrity segments") Signed-off-by: Jinyoung Choi --- include/linux/blk-mq.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 1dacb2c81fdd..9310c94577c7 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -961,6 +961,11 @@ static inline void blk_rq_bio_prep(struct request *rq, struct bio *bio, rq->__data_len = bio->bi_iter.bi_size; rq->bio = rq->biotail = bio; rq->ioprio = bio_prio(bio); + +#if defined(CONFIG_BLK_DEV_INTEGRITY) + if (bio_integrity(bio)) + rq->nr_integrity_segments = bio_integrity(bio)->bip_vcnt; +#endif } void blk_mq_hctx_set_fq_lock_class(struct blk_mq_hw_ctx *hctx,