From patchwork Wed Apr 19 14:09:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216878 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 72FEFC6FD18 for ; Wed, 19 Apr 2023 14:10:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B926900006; Wed, 19 Apr 2023 10:10:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 342876B007B; Wed, 19 Apr 2023 10:10:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BD55900006; Wed, 19 Apr 2023 10:10:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0790B6B0078 for ; Wed, 19 Apr 2023 10:10:45 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B926A1A0144 for ; Wed, 19 Apr 2023 14:10:44 +0000 (UTC) X-FDA: 80698326408.30.EC5EF6E Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by imf01.hostedemail.com (Postfix) with ESMTP id 6AC7640030 for ; Wed, 19 Apr 2023 14:10:42 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913442; 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; bh=UHB27r2VAJYtptv/DszRuaYXLzHwMALFS99ixQeQIrk=; b=qesZlwDOwO3WeDNTUHb7ZSglIDznHDZreaopJanDCzJakWJ+vAjJyqBSvCpLqEdA1UF4Zb naeT0ShzsPIV2mA1usacffhCsmhySPWFdHeflEZOxFCqypJnXPC5U5xzzprBaqI3ZzW62K 7QPWQj5ATVtYZgzFMyNNs0AZ0+Camxw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913442; a=rsa-sha256; cv=none; b=o8BEYO2E+3gC9UN+gkqqRuPRbn07hJ07TSLGGOVycVGeI95xWwoEuopFyPjiWv7uHlc6Tj Mz8exASiZj4Rq+Ip35YCkdJ3YhDoNf/jHBIiTibhy3JQkltlHgkVU0QDUKnAY2tWVZx9r8 NiIcZ2IMhwGSOgOGh+AURPeWr1lxNOM= Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3f17fdb520dso5922705e9.3 for ; Wed, 19 Apr 2023 07:10:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913441; x=1684505441; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UHB27r2VAJYtptv/DszRuaYXLzHwMALFS99ixQeQIrk=; b=fdxsGbI0OIz8i6DIbAMa7xmKyBtNWSf7e26oXnwqSIkfbiDMl6DwyLk98GYONGzqvU wdTV7/6AlzoWvm+w8MaBSA5QC2bPkktfoX7/TktmEsRARZ3SyEUCzlJ0v838SQvqBuiE sNcWsLAgzGPXIgkWdmPQwXH/C5QbVWs+suPaTe+FT/fcfwxUU4e3DIBFgK/0/wpL1FII jvR/ShmnbmgYIg5nGu3BiZVHohdpX7XYm4eVjqShvfYD5pMhPUxqmNhkxZxxZZhzVtbE IWA33W8gKDGfzk9Mdw8Yoq0yVI5Pk/sWLWjGnxhVVyskzi34IrdQZ6IV5JOvI7YSbvvh kF5g== X-Gm-Message-State: AAQBX9dhkqWPy4tVjq0HbAiogthCYsdoi84Xua9x6P8Nut0sufi/peln G6/6S94hXwdKfRe/ddmIYn6IOIh4RSxyqQWk X-Google-Smtp-Source: AKy350Yzi76bXam/T5ppDWB23h4mS+GurlXtWZ/gJi0rAcUNNcaqO1+varQiNYt0Qa9LFt3v3G5TJA== X-Received: by 2002:a5d:4411:0:b0:2cf:e517:c138 with SMTP id z17-20020a5d4411000000b002cfe517c138mr4900340wrq.66.1681913441132; Wed, 19 Apr 2023 07:10:41 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:40 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 08/19] btrfs: repair: use __bio_add_page for adding single page Date: Wed, 19 Apr 2023 16:09:18 +0200 Message-Id: <20230419140929.5924-9-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Stat-Signature: n9kw618crmpnbjr3po8yxiqxuummqi46 X-Rspam-User: X-Rspamd-Queue-Id: 6AC7640030 X-Rspamd-Server: rspam06 X-HE-Tag: 1681913442-826286 X-HE-Meta: U2FsdGVkX1/37/9yArDqHyVX8Zp+oFTsFU/OdWiBmcc2G7I58i8TKUyvEOFzceLbm2cKwp7IM6VlAETwiFiu+2ei6d4UIDiA04NjpXDX33K6fYcmjkLWuwS2tVWBjoUMxofRPgzjCqHna2LSjIuBioC87lThcpdR+bhWez6nYaP37dT/SzQh9T9tZwBxYJVWVfeOx2iG0q6Z2+Mww84tofgMt6EItsu61QqL5E0nbSUYQdXenCFOqj7KhYMdOoVoV51BgRzbu5XEHCVAP7BDHmcxWp0PqMXU8cLGVqWPC9F5jiTUdGSmozfvrKozL3mLuBwNIEbNYnQy1Xvf/jHEkZKC8nSXX22NCU/uzXRH1p/VWlVmFsqhmijhOPpvYFAJaVKB17XRBbB8j7XbTF9tsKzMLZmYummcfD5CDZhM5oUtyP5trqCJUYMulCT8e+eQYke6G94ueWilRANmwT4c5AdCv04tbU+xT7Q3FYPzAimXnJ+XT3vJ67bgmJnBjjbfXsA820m5JefeCmq7PXcN85gX4Vv5dgCwyW2meyTDqwgw2PDSizLRHHrshqIqqqr/HN17g5bPGj9cCnXprpNt+WJ4Pcmf/241YIq8Pkl5CGwwO3w3zPYiTToIa6lY535Vk1Pui1hD6tRXV6wCYTZTAIsiAQJRxRVPwKs8yuSkCgt5NgVZex6EhLQ3If6WqfwD7cGrD2SmKfH4kA8fFIuEnc7G0WqIJtx9iSqYRxC1y5CGx9c4Qzp77YcPsWiIyIvJbxMO+FGlE62GhwH4yKv27lHes6z3r9cAzRBAcLbkuXn8C+J8pmlb/RlQ0/n3jRpyuUbzS5iXVIECPibYAkrQ+CNvlXyyrU4h9+qH9Cw0wxsXRLGvbLS2RoacLrUHPt46XbqQ20ye/L0MDMMPO7yaiBlaLxB89+GJ9x2xmZBWVDwOkfu+gquAVIjQ6CHJ2jWtjOUXhjaAqECjn/uwZgm fknU92XO FafQX54GGF+KTFQXUI4UsMh++321DJ/niJXrFqVijGnA18yowAtZwv7LmKvwKW4RNYYUmGJ7q7lZRJa2jpP7feUG5vvc27sOyEpJfvqX3HQy3mxJsEjgvwno6pxBA/i2Mra6VrdflEk7oCdtkdajmmjPFoRNj1kwWVm3Oq6QOgwRi4WG/Yu3xR2GqBDXMjfKrn+nzbIxdNHizcc25oFutY0fw8eDKvKFznh3R38ZjcrL3CpdaNToTHKjsR4LL/aFm013bmBn6Dj8ThhOIylBnhe0p8V3BwBNfQ3dQiatdWGriJACijWpJ1QGWavt2Zy7wS3tyOWJF9jjRl/lhUfCPSdJiqgDftaMPb7Y9Ju4tp6fvo95gT2yeQIJaQgJB96fkGv3YRYu1xTyVW3vWV9/WXHeOU9B7fAbT8iYDFPpSi2WMxhoTUb0dN3Uuqe877DMXLurPhtPTC3CsLOvQYUThathKuVKUNwcQLgEbu8OnTg+yVbYLqIHw002qUnhNK2piqVsTdCMS18KtMp47bCV/a+JmYx7iY1tFJrp3i+Wc8p0lu2uiDrs40p5Fq709SBB0DXk1utwwZBKTw/pSiUhFze3JA51xIKdkrEZ9 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: From: Johannes Thumshirn 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);