From patchwork Wed May 3 10:09:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung Choi X-Patchwork-Id: 13230009 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 71DF6C77B78 for ; Wed, 3 May 2023 10:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229678AbjECKJN (ORCPT ); Wed, 3 May 2023 06:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjECKJM (ORCPT ); Wed, 3 May 2023 06:09:12 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D068844A1 for ; Wed, 3 May 2023 03:09:09 -0700 (PDT) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20230503100908epoutp03ac55905eeb668e910adf6229943446d0~bmk6epIIR1928519285epoutp03e for ; Wed, 3 May 2023 10:09:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20230503100908epoutp03ac55905eeb668e910adf6229943446d0~bmk6epIIR1928519285epoutp03e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1683108548; bh=kra6K6+UrYLIE+JQHy/nrTmW6GTWNgEH+aD6dQYjQ8E=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=WsAfJpBqvVnJDYUH62PLtpP/C7VxG63VKV4tLsVXFUfWa0Fup+Ut6FVbmDxfsqHjT rVyWf08TUWJtHTYDtqp2k1LU4+wsRH4BaHqKES/nXkiseGUSMKVtJydBBJLjcebNN9 b1PH+MXzvU7uLN2zzb7Ewo9VW1UxWYe2TyhdPnpg= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20230503100907epcas2p3449f6572ea0db3a9b054da777cfb6efc~bmk6Aaucn2526925269epcas2p33; Wed, 3 May 2023 10:09:07 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.88]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4QBCN3198vz4x9Pr; Wed, 3 May 2023 10:09:07 +0000 (GMT) X-AuditID: b6c32a45-c6fb9a8000020cc1-43-645232c276f4 Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 70.1D.03265.2C232546; Wed, 3 May 2023 19:09:07 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH 04/15] block: bio-integiry: cleanup bio_integrity_prep Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: Jinyoung CHOI , "axboe@kernel.dk" , "hch@lst.de" , "martin.petersen@oracle.com" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20230503094912epcms2p4bef206eab1c41a92eba2583a69c74323@epcms2p4> 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: <20230503100906epcms2p35226430da085d7449840bb122a6b193c@epcms2p3> Date: Wed, 03 May 2023 19:09:06 +0900 X-CMS-MailID: 20230503100906epcms2p35226430da085d7449840bb122a6b193c X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-CPGSPASS: Y X-CPGSPASS: Y X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPKsWRmVeSWpSXmKPExsWy7bCmhe5ho6AUg3e9TBar7/azWbw8pGmx c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l/boxIkfbGfmuOR5fklsb7c9aaPLef9H1qqtCF/k6XmBhLJZbijERDLeai 4kQAQxDxARIEAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230503094912epcms2p4bef206eab1c41a92eba2583a69c74323 References: <20230503094912epcms2p4bef206eab1c41a92eba2583a69c74323@epcms2p4> 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. Cc: Christoph Hellwig Cc: Martin K. Petersen Signed-off-by: Jinyoung Choi Reviewed-by: Christoph Hellwig --- block/bio-integrity.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 74cf9933c285..329c44eca83d 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -278,7 +278,6 @@ bool bio_integrity_prep(struct bio *bio) unsigned int len, nr_pages; unsigned int bytes, offset, i; unsigned int intervals; - blk_status_t status; if (!bi) return true; @@ -307,7 +306,6 @@ bool bio_integrity_prep(struct bio *bio) /* Allocate kernel buffer for protection data */ len = intervals * bi->tuple_size; 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; @@ -322,7 +320,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; } @@ -346,7 +343,6 @@ bool bio_integrity_prep(struct bio *bio) if (bio_integrity_add_page(bio, virt_to_page(buf), bytes, offset) < bytes) { printk(KERN_ERR "could not attach integrity payload\n"); - status = BLK_STS_RESOURCE; goto err_end_io; } @@ -365,10 +361,9 @@ 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; - } EXPORT_SYMBOL(bio_integrity_prep);