From patchwork Thu Mar 30 10:43:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193867 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D735C77B6F for ; Thu, 30 Mar 2023 10:44:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0D51280004; Thu, 30 Mar 2023 06:44:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BD67280001; Thu, 30 Mar 2023 06:44:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85E3C280004; Thu, 30 Mar 2023 06:44:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 76FE7280001 for ; Thu, 30 Mar 2023 06:44:33 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 26AB180160 for ; Thu, 30 Mar 2023 10:44:33 +0000 (UTC) X-FDA: 80625230826.25.587C1E0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf18.hostedemail.com (Postfix) with ESMTP id 188A21C0017 for ; Thu, 30 Mar 2023 10:44:30 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=H0ENSjzC; spf=pass (imf18.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173071; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=H3wR0rPg0qOZQvHBdeM7QAiBsaXT+YG7F8LTZ5CEjEA=; b=TKZpFJwojxbd6lLnyeO+y4NBoPl0eil8CHpOV2mB17p5/8dXi/be0clKcXDSMjOg+C12ES aGiTPpeDJx2YlgsHpim2sPX2Dvou1WjcOZ+PhgzxVE13UVvBXA6X6QseRgCGtDY/9/zWEg MOpIWPnR7v7/biwm+kN4teVAz2AveD8= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=H0ENSjzC; spf=pass (imf18.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173071; a=rsa-sha256; cv=none; b=QcNiO0q3gCA1nFXywL0/iYgREAz2kVuZg4cVtUdnjY/rOdMwke6JyWxpzfuc8xIUkEqqf+ my5ppP8gwdD9s5kB32G57DsBgd56sTKIL9100BE9CyG1YRl1juWIcVA0XTwcdKQoK0D/l2 iYQ04U6LC3nHRDAB1mijB0DWJvSdJQ0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173071; x=1711709071; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W9gE6QmsdFRmz0ZVCVa1q8hek9wq1iRj98EqV3wB4Jk=; b=H0ENSjzCdW4ifZs9Wr3xkwxoUZa1s/oyOmfw4LIQULtbEn+N08mTaps0 qP3WpWNqVFvp6jKmhzTTA/0kEaXEGdOFx5GFNvm58rKLZox4DBdB9/adU RWiqqArW/7Zu8GJRQd2sgXSoTODT1958/QvcLFcpFD4WXON5UiXqdCEcu wJbrZ8CQuQ9z8aoR0EQVD8vpzgEqPsyAta3wL+MxEBdH3iaVKOoSkWDYe 9IYqhioARTQ4FSxnr7PcuLlh55CEywJn+0tisZcK4PRDWrypl340XlVdP wvSIlwUuheUUUc0NNxKPCsenGSp5nta68KOjmiC9mgGEkkZ6K59zwE9bI w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853927" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 18:44:29 +0800 IronPort-SDR: 1W8VnXZ9Y2520zeJJ/QS6WyfCab6l3cdhjRhc92k8lmpiozBzr2ZvRTIjk6XGFqvQ5a7K18qZf wi6LZRX2AuIwm3DmWTkC9LqrIxpUG8E2XmjmaxDKZ6Bi4EBM2MsyyT+RI807RvRgBsD1cNMuQr gw1uguWIqywc1NzkSrh8X7Vgi+IvvCwpXV/zSxnmhC40EaIH9skb7ZIMlCVHq9lLzM5jCmI9Os kFvI41lHFPmX3ltYGo14BpiMeBJ+O04o0AC2yDkggjv2/FGfUt4VIxjtrurQUfju1EtMugvv8/ tjg= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:57 -0700 IronPort-SDR: 7VfBtatRUAMSKGZJhueT2GpjhxB7O4zmUTxm3R9MTyW1KAXQy9vKW9iV7AuhhA2jy1ZSsCp98O U1y/h8ZeZN+sRqZVsvVO4hAs927WNwruX7ksWwSZxQaZ7PhnaOJXPNDyTm+sgyqtE99mUZ4qrY atKl3lP0PB5GGkREm/HXgG7Yx5KK5w8jOv26buUSZPHatbFFFBRCcm6OyZcoqfvlkdXIYWwkqC cF0K5nj/s7lS0zwe1pS6KOfyNTJKWJLOIHUhjXr+avwW9dLSK/XfwgZxojo4KfnWNQ5FGo1gwc c7Q= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:27 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v2 08/19] btrfs: repair: use __bio_add_page for adding single page Date: Thu, 30 Mar 2023 03:43:50 -0700 Message-Id: <92c80a1b14a7f9cab366cce2e7c5778de5e0d6d3.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: ts4fhy3z8it9x83ncmmbhwjtnxz8519u X-Rspam-User: X-Rspamd-Queue-Id: 188A21C0017 X-Rspamd-Server: rspam06 X-HE-Tag: 1680173070-922745 X-HE-Meta: U2FsdGVkX18c139J1ph0gxRIzMO28F1MveU2CrarIAjZw0+zj+GdV0dfu/wvmp7gMw7dJwwlHbxm6cR/HkIcYiHaF3SOanMy+XsCt7uTjeYEch/ypUSDw9hnFbWUIYOTul90ypBgJF+HO388u40bMTcHvV3gERtYVsXjP3+Kc2vbkV1hSqRWsrCGS/vJ3sSknPcMfDSR6R/iJwOy8a+v7hUvkB/T7CAauV9z3tMZNv9qw1DcNBoOzSAB9iS0+5g7f0fBWr7yszW5WMTeKpWY3j+6SqtZnJodfv1tu5Y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bzaC/aI8tlgbIMBX1z X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The btrfs repair bio submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/btrfs/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index 726592868e9c..73220a219c91 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -224,7 +224,7 @@ static struct btrfs_failed_bio *repair_one_sector(struct btrfs_bio *failed_bbio, repair_bio = bio_alloc_bioset(NULL, 1, REQ_OP_READ, GFP_NOFS, &btrfs_repair_bioset); repair_bio->bi_iter.bi_sector = failed_bbio->saved_iter.bi_sector; - bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); + __bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); repair_bbio = btrfs_bio(repair_bio); btrfs_bio_init(repair_bbio, failed_bbio->inode, NULL, fbio);