From patchwork Wed Mar 29 17:05:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192954 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 E0731C761AF for ; Wed, 29 Mar 2023 17:06:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F6C0900003; Wed, 29 Mar 2023 13:06:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77FEE900002; Wed, 29 Mar 2023 13:06:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AB77900003; Wed, 29 Mar 2023 13:06:38 -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 44398900002 for ; Wed, 29 Mar 2023 13:06:38 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 222FA80DBE for ; Wed, 29 Mar 2023 17:06:38 +0000 (UTC) X-FDA: 80622564876.16.1553D3C Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 9CC9D1C000F for ; Wed, 29 Mar 2023 17:06:35 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=NpfBoHuL; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=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=1680109595; 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=PxVbBeSzmaWluu7SLf5jTi3u6gFyXMToz/k4OS16d80=; b=u9S5UmBe3Rq3SJgVfInLNuuvDtcbQvI6qxBWUr3ZdcYXI3R8IPjXUvKIWzCdHdQy1YsSNc OH1FKs+4RZwHLZlsP0N6qgITHvksXFhuq1SGN7Lc5q6irH/VrwfeJjpWcW+kosAIUkDG0O +eMnJPB+DkEq8qVEmkGKkG2KHzCqib8= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=NpfBoHuL; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109595; a=rsa-sha256; cv=none; b=nxQt/iGoZ5lqgJbvk+cGvrdvcwS9go23i4J8ur1MamhJBPoBfqU5NgpWauz32WVEUbcXDA YDQHHx/aY7QIxrB2X3K+ToqVeEr2USHRsepQvc9vHjw5RqZvJfjrBwKwEYIYfv7ACabD0B rcULB1CIc7+sbSOUcPBmKQihEGZIvzY= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109595; x=1711645595; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z0WRD7PSxT1MI9gFHxfmzZuO828C1XYh8k3AzLzoH+A=; b=NpfBoHuL3XAkv8dI3dL+X0d02PMW6pMsMfIphw0BUZ58DzwzqVpYUBYY JbRNT2eMyKj4ENdkLOwb7oOoVrwSb2kw/E6fe2JdlGhJMVGShb0nbxxXB 26VYoFETtND2fMUbFWUDDYDI4HGvUCVaYGfAfCOAD7vKHM9dq2H6CgMus MDKROKsIfdi0nFHwMesbFzMzZ8RnmRj+V6lyP0yzJ0taVMgzg+cGBS5A0 LhbgORjH2NfeN+jg4+oQLBw86JnoOfFKHQpQM+hE/fcdi4C4XpQrSN5NO N03ZBXE/UjdvlMLw/CxwjYvvkvcK9InjU8yr+hy61TzHCTAd/479nV1E5 Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807030" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:35 +0800 IronPort-SDR: gsoMA/4jvP6I9zHtEXCvz8C0Tpti7B4wM6a2SRCgknmLtDhc1MAh6V13OryTopUx6I5oFI4qqN za9shvV1rEybqBjDRzbCzOJJVilK1+08Z8V4CVd9j0ltb9PJ+7rpeOmuHPgpH7PqjfCOp6H56R QftvodeqpHKIKR89QL3tddMXsORHrWjSN0AFO/MUffQXbYEcj7F10Bx7e2ye46Bqd1izSZhlI+ WCk1eaqYbajAymZU5zRmCzao562BWkWQpt7XyJ6cI0hJZoW8APiGaDx6VGG3UG7txZZhztPrNw D48= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:44 -0700 IronPort-SDR: LCzDjMY5FJ5sr8pIsHJapmUnHR/HrhUl79JV22sYdEO2rzY0+ynCU/VuOjv7ZALoaIA05uNHnA KLRyUMuwlt12IwC+VHi4otXGnYicO4UmHegZ9Kplvajn0f/LaNS4Vr15N4xbFpRBJEti4HjRX1 Bvit1PEiowY0ep8DeA0czhvEoDRP3Kll86DnbETpHg8w4X4G9iHJmSKb1l58xWudqk0JK6OIZ/ BvTjCmaxL3mPyUI1B6gKVzuL8y2j4E/ZHPehNYyHvH3JipeuiATzGUF76GOIcEtetNffS4rAKx brQ= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:34 -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 Subject: [PATCH 05/19] md: use __bio_add_page to add single page Date: Wed, 29 Mar 2023 10:05:51 -0700 Message-Id: <55ec6659d861fd13e8e4f46d3e5a7fbad07e3721.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9CC9D1C000F X-Stat-Signature: tiyyuj54r9snbiqf55dku617ojgdytby X-Rspam-User: X-HE-Tag: 1680109595-954198 X-HE-Meta: U2FsdGVkX1/prm26UnG6V2+G31kjTSFsVvAIjrnvpbi1dcU7mIDyYs+7aArwcM/CIE8o26+1yL5QmLOFkr5+dHl4xrLfeLsO5xZSKj7v/9rvKcMdmr8r13jt3HRozLkuWMgOCpINGOiCEUtYU7E7SA1MkeFpMvkxMY5j7h6sxiAmWOzzzevoAntW64oWknoB7QsHp/NOTnbgS34deTCHdF4LBniZaFRqY2WbCrE27jPPiCyC5uieiHvUPdMe1ULNBUqyZDKsV8Y+Er+gJNiQMKrciSHSxqp+6eP5QIocFMFf0sFFK8Ie0fhyrimFk2I7UYO46crdQ2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y 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 md-raid superblock writing 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-of_-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 39e49e5d7182..e730c3627d00 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -958,7 +958,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, atomic_inc(&rdev->nr_pending); bio->bi_iter.bi_sector = sector; - bio_add_page(bio, page, size, 0); + __bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; @@ -999,7 +999,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio.bi_iter.bi_sector = sector + rdev->new_data_offset; else bio.bi_iter.bi_sector = sector + rdev->data_offset; - bio_add_page(&bio, page, size, 0); + __bio_add_page(&bio, page, size, 0); submit_bio_wait(&bio);