From patchwork Tue May 2 10:19:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13229216 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 59F64C77B7E for ; Tue, 2 May 2023 18:07:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE0AA6B007B; Tue, 2 May 2023 14:07:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E8DAA6B007E; Tue, 2 May 2023 14:07:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D55E16B0080; Tue, 2 May 2023 14:07:12 -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 C4EF76B007B for ; Tue, 2 May 2023 14:07:12 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EFD04C0F6E for ; Tue, 2 May 2023 14:53:38 +0000 (UTC) X-FDA: 80745608916.11.13A712A Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 7F1331A0062 for ; Tue, 2 May 2023 10:59:28 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=LcyFOd5K; spf=pass (imf19.hostedemail.com: domain of "prvs=479dded8d=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=479dded8d=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=1683025170; 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=rsEwzp4KUsprajGpTbcSGFfmf+KMGB2h2D2G/ECnUFA=; b=fXmmSsyWrTvLXg7J32WW9cq7AKTNcZ78v/kFj/mUFBxrt3xIutelmiWcz0+xD81GelpFRR H0WaS4eZXoEA3j4C32nEeFEFrMvUb7Ab2dZgDMoALL7LCJiDyO2Gtct4Ugn/2T2ZbXMUMp Mp9EdDW+npVbvaOn51UejMpkr6UfLsM= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=LcyFOd5K; spf=pass (imf19.hostedemail.com: domain of "prvs=479dded8d=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=479dded8d=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683025170; a=rsa-sha256; cv=none; b=RueYN99XpH6dn8oHsU7G+GhIJfEFDMXiOF1797LsSRqb6j2vbMUfPXlUpctHp4fConl71q PRrzuQ4MFAVHb4yR/hH76w1LsQQnibaniXLTfnDfNIpfD7655tkabLrWlb+YruyQy5uuyc HxbcG/4KH3IHaJAIwiWyrCK42GAM69s= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1683025171; x=1714561171; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GdWYuRal4gtN4Ezno5RYxoKK4shSZO/plZI344B5fU8=; b=LcyFOd5KQuvM6zhUCwAB7Pg+nwvTCrpGDbOf/p79gWbPSF73nIMLOoOY HNgJYEALvoZJhXOny1lSm+HE4kg9JSAL2sCaqHggUUQmq+DE2a8p3IlZy jZpL11vGoC/Rc4qd7jqHdqv/WldCP1+D5F0eaEQOcB/uezXTxtIbq8O/J Gc+TfX2NSNoRJZbaEeNo8XSJRfqER3zbIrJ121ydBCSWPZL7ZdLXFh+k+ 5qOvYfZHgd0idgKcKgBY4sh4E+aQUJEkV64uiOSR2Kxc2DTkCU1maKyNX 4waDKHxoGTT1sI5C+ogRuKy4TOmlYeCO5YEXxKpih9YJJDI87OcwipLVW Q==; X-IronPort-AV: E=Sophos;i="5.99,243,1677513600"; d="scan'208";a="334136181" 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; 02 May 2023 18:21:12 +0800 IronPort-SDR: biZg+vDCaoP4K5Sa7PigOyf5hdxfzK61lvtlKAgTRXA8WY+X4kpxa5aWxqxaFKDC6ia1MCGIks XKhMvFsZB1MUy+t71J5hgGokOhJ83R4cyazc2L+Kq0nfc7GYzgKrzX5o/TKqEOihdX5yl29uet gIc0V8CBeBdQ0s6IvbJw8/fxDXy83RP7PaNkDkcITkILBPiB8qwICLHltLmSqNree/hKjgFwNO bmmfWOy0hzOXsCOT5NuCFPJ4FAeJtO1R11OQdXW1ZTvH9PwDi1DnuU7w2FE2kRBTTX1Wkq/ji4 tYs= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 02 May 2023 02:30:59 -0700 IronPort-SDR: /S22iEpnOiCcoykSs4awuNv6zgGhYXfplgG+S3pD2v+040jaGI8/UT37PBAwwxcjkEonrgZmkF MJPvEWtr1zVH0AIddfQ67gYFP3HKB7q55d5Q1Kb8u6skPN7kRW+WuGOCfae67Jkkt8+4Oaw0js JkBz4bNt1kGrsBmJVm+4KD8wEnX4pNgSMaG3kJRUQiB8x1MM+ujOP6oeUZFhoRrtBiBmuCy7MO c0PlJP0a2U0EUVTKgLVaxjO9oJKo1AU/i7anC+hCZa7jKJqlBykub1Cxy0u0yhF0QACwsoDW1Q DfA= WDCIronportException: Internal Received: from myd008205.ad.shared (HELO localhost.localdomain) ([10.225.1.100]) by uls-op-cesaip02.wdc.com with ESMTP; 02 May 2023 03:21:08 -0700 From: Johannes Thumshirn To: "axboe @ kernel . dk" Cc: agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@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, Johannes Thumshirn , Damien Le Moal , Dave Kleikamp Subject: [PATCH v5 08/20] jfs: logmgr: use __bio_add_page to add single page to bio Date: Tue, 2 May 2023 12:19:22 +0200 Message-Id: <20230502101934.24901-9-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502101934.24901-1-johannes.thumshirn@wdc.com> References: <20230502101934.24901-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 7F1331A0062 X-Stat-Signature: u9bffd1zyn3t3wq4a6otx4d9y9pqwo4q X-HE-Tag: 1683025168-711188 X-HE-Meta: U2FsdGVkX1/gj/qSCf6LmvJYv5ExbU6cJfgkaI6LkqO4f9uJVtD7zpn+3NStHk7ZhxUHlEouAfgkUXGt3z4Gt7JcOznQVirMgecD+L5m9uUvS6ibMx7szTNWU72ZhlHsrG4xgDxYJd1oUu3A/L53NnnJTYOTPzl/dFbwyFYwl/OZV5XkwRHmo6vahU8KJR82RJC7cnPyEu5x2Cj+cwLTih8Ea2GBhU9SYF3tUsvIpm1bGUnrUrBuv/1PBNT7L2N2sFLi22dWN1MnEwqLYkb2RiOrm5rsIYmKGdOc80I0tZY3w9p/QM4f2NcogGXz3daTaVAzDd9QTu1efsOE1Oki34F/0CKFmNZVHPxgFv36h2P2zpAjJRekBWQmzAK5K0qhQt5R52O1JZax71N2RIl6Q8QZR8/85tUPBRxRNO4Lp1IwxF0akUEQr+/QAd0oKFMXydHBjYXJSH3f1p4MBgSsATk1pbe0ZmPwOkOUiBOHAM5dDcfEsKh3WuS7cWrisgrURt6kKHW49FEj+AJ3Uqc4MSP6qNZeWE3+HSY38wJ0/mHH8+S2yNYy9M8Jp/nxkZUE+huFpugOwjYfveWXj9dreGwNp1CYfQw6wTlViNkjUeQlYIE9TtyQF/nHhVV6WUSrr4Mh4hn1Plmx2z/NM3HqvXPvTWHyj1vdELRgibtNFkoBG2BAyfGtFyELHtBBOogH7dAgYnwNrMzcj2HZOajrdbLhqvP1pZqZsWmp+WAXVu/gvDR/hlefZM80QowPnig8qiBnLLXt0YKzHOJjiK3MoE3dqbB2XY+NYptjVADMvqXUskuURWaJ5yDSfABoea/6Jy8xTEMIezf/u7Ru7H9wYcpSfjUx48yTebkyrJwfg7S7gKYVxQUhdhqCgeJX69JU7RKKFjH/zYiZ4l6hfpKxzxmEFGOHEIvw3K2bdp5BfShAOHC82iUKrtPTYqMfbMMFx16ICJ3u3a1jMk5sh31 rDSk9X8u CtExg/9z41h9thsCa6XH1O0P76evQpcsI4gALT51el2g9wGDDltR4/gMhjiqNiKxlBLJaHK/QSwBaNhMGORPAneS2E/5plLufeT0ZeA50UAlVZwDB7RHKnt/BfyhNZTIyecZbe9zLK9iJcTVbh/mlu8/djsuFum1otumjN9wnAourvv1jy5OkMe5P5I0V9zp88UnEzFOQ8pXYL239r2uBxqCY3w++sA69wQE6 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 JFS IO 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. Reviewed-by: Damien Le Moal Acked-by: Dave Kleikamp Signed-off-by: Johannes Thumshirn --- fs/jfs/jfs_logmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 695415cbfe98..15c645827dec 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -1974,7 +1974,7 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp) bio = bio_alloc(log->bdev, 1, REQ_OP_READ, GFP_NOFS); bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone; @@ -2115,7 +2115,7 @@ static void lbmStartIO(struct lbuf * bp) bio = bio_alloc(log->bdev, 1, REQ_OP_WRITE | REQ_SYNC, GFP_NOFS); bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone;