From patchwork Tue Jul 25 05:18:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung Choi X-Patchwork-Id: 13325879 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 64595EB64DD for ; Tue, 25 Jul 2023 05:18:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230398AbjGYFSt (ORCPT ); Tue, 25 Jul 2023 01:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjGYFSs (ORCPT ); Tue, 25 Jul 2023 01:18:48 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E51741736 for ; Mon, 24 Jul 2023 22:18:44 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20230725051840epoutp04a1d71a20a7e0659d21bd849fb1b3fea5~1BKAf7yID0196601966epoutp041 for ; Tue, 25 Jul 2023 05:18:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20230725051840epoutp04a1d71a20a7e0659d21bd849fb1b3fea5~1BKAf7yID0196601966epoutp041 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1690262320; bh=+rtM1aYdkwBMTDQFePMCBtN59+CcRMnrphsS+pdR4Kc=; h=Subject:Reply-To:From:To:CC:Date:References:From; b=FblWcX20dUOQtMjzgQUzH7AFasKoPk7Wk6UL7fjReIApxQ5a0jXWL7Kk6/jMnqdwA SPBp2mH+n5TQGedit8B/CeQ3r+MVyVhXP2tBrkZbtRNG5ynKh5ZAsX40f2fx/LP9kf X7uYTuPILNuj1t+HzfqclkIi4mLYX6T3W+g99apI= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20230725051840epcas2p310fa83ea1083369015ccb5e13d45a280~1BKAO7b0d0386503865epcas2p31; Tue, 25 Jul 2023 05:18:40 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.70]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4R950c1jfwz4x9Py; Tue, 25 Jul 2023 05:18:40 +0000 (GMT) X-AuditID: b6c32a46-6fdfa70000009cc5-66-64bf5b30ec94 Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id C7.26.40133.03B5FB46; Tue, 25 Jul 2023 14:18:40 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH] block: cleanup bio_integrity_prep Reply-To: j-young.choi@samsung.com Sender: Jinyoung Choi From: Jinyoung Choi To: "axboe@kernel.dk" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "hch@lst.de" , "martin.petersen@oracle.com" X-Priority: 3 X-Content-Kind-Code: NORMAL 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: <20230725051839epcms2p8e4d20ad6c51326ad032e8406f59d0aaa@epcms2p8> Date: Tue, 25 Jul 2023 14:18:39 +0900 X-CMS-MailID: 20230725051839epcms2p8e4d20ad6c51326ad032e8406f59d0aaa X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-CPGSPASS: Y X-CPGSPASS: Y X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkk+LIzCtJLcpLzFFi42LZdljTVNcgen+KwZFDnBar7/azWbw8pGmx cvVRJove/q1sFntvaVtc3jWHzWL58X9MDuwel8+Weu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992rrznlC1UO1i7Vu+Wgu9KuQm3eqb+VSJpTgj0VCLuag4 EQAbn+gIFAQAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230725051839epcms2p8e4d20ad6c51326ad032e8406f59d0aaa References: Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org If a problem occurs in the process of creating an integrity payload, the status of bio is always BLK_STS_RESOURCE. Reviewed-by: Christoph Hellwig Signed-off-by: Jinyoung Choi Reviewed-by: Martin K. Petersen --- block/bio-integrity.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 8f0af7ac8573..045553a164e0 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -199,7 +199,6 @@ bool bio_integrity_prep(struct bio *bio) unsigned long start, end; unsigned int len, nr_pages; unsigned int bytes, offset, i; - blk_status_t status; if (!bi) return true; @@ -227,7 +226,6 @@ bool bio_integrity_prep(struct bio *bio) /* Allocate kernel buffer for protection data */ len = bio_integrity_bytes(bi, bio_sectors(bio)); buf = kmalloc(len, GFP_NOIO); - status = BLK_STS_RESOURCE; if (unlikely(buf == NULL)) { printk(KERN_ERR "could not allocate integrity buffer\n"); goto err_end_io; @@ -242,7 +240,6 @@ bool bio_integrity_prep(struct bio *bio) if (IS_ERR(bip)) { printk(KERN_ERR "could not allocate data integrity bioset\n"); kfree(buf); - status = BLK_STS_RESOURCE; goto err_end_io; } @@ -270,7 +267,6 @@ bool bio_integrity_prep(struct bio *bio) if (ret == 0) { printk(KERN_ERR "could not attach integrity payload\n"); - status = BLK_STS_RESOURCE; goto err_end_io; } @@ -292,7 +288,7 @@ bool bio_integrity_prep(struct bio *bio) return true; err_end_io: - bio->bi_status = status; + bio->bi_status = BLK_STS_RESOURCE; bio_endio(bio); return false;