From patchwork Wed May 31 11:50:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262046 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 8F780C7EE37 for ; Wed, 31 May 2023 11:51:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EBFB6B008A; Wed, 31 May 2023 07:51:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 29C626B0096; Wed, 31 May 2023 07:51:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13D878E0002; Wed, 31 May 2023 07:51:20 -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 03A5C6B008A for ; Wed, 31 May 2023 07:51:20 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C1F161A0224 for ; Wed, 31 May 2023 11:51:19 +0000 (UTC) X-FDA: 80850384678.28.E992999 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id BAABEC0021 for ; Wed, 31 May 2023 11:51:17 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=nWKBEYpv; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533878; 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=1fr4DCS9z5JgCeOZOjMVffvnm3p1cCoNfC79QY0yH7s=; b=UGUdOFR6Ea7x//Q2q63TnDDnfMqmvW3O6VEEImB+7dMyC96kXhrrOvetqkaO7zs9KWDy4D +xI8ljSuBfhQGGpTdQ7OwECUnoXYYM6k4Umic9FS12zTsqvJ7k4Y5IYDt3+5cuB3yIIUHu yzArSO4yGFdVJwDhTTxvQHoJojt3gmg= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=nWKBEYpv; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533878; a=rsa-sha256; cv=none; b=pdKLNAraTqlqySglblLqy+6jUlGrLnqpWY484WSix4oJ0kohxF1rWbTRNhakJYOy4cO05o sL2vVVL1z3ueWE5a9+6V03m92FJH+pY8KdSf7WTsNfnmF2GoAvfuz8N+fGSlrEurOgN63r UI2cbaNy4xw1HMIMB9QE09HF76hPO+A= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533877; x=1717069877; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5nFlnEeWG8zlFVtdyG/d358hq+5vZL8/oxRNlpo0zRQ=; b=nWKBEYpvxY/fniy5SYSemMNkV+ZAXRIW5+Y9Bhb7L7/1FrpQu6YHuD4h NzbLWTpUex+jOJDTTbLsnqtbXJ7/8NuagtQ0WNK9r53z+v6QOHrDwZWSg TRF9jXufM/jWM+yDibgbLoRiHoKzrb3/wpRZ64IAKwTJdmZHwX/sZIdDp x3EErP2bXtrlmwWmOjazZvOSTNkZTir53Xr7LdOaVn+V9rK+U8/nITf4d HggsA9NsgKNR2F2AB1BNErISrHEPWnCbR2cUT68vJqCXWV+xRE2rLHgTX 2ABgGy4Bh0RE0OZ4alInMc/SgljGH7gjdyuWbSHv7KyStgLS1/2I3w2r9 A==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207422" 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; 31 May 2023 19:51:16 +0800 IronPort-SDR: WM38ohfg1Wu6rQyDqocWkMuWCKKZguQuBXiIMtcV6+Rdf+taU/m1+E/KClnJ+CNFeXSPF42iVX cbg4KksYscZvNsrZOFPC9OmUex7EBn9Lvh0Gw7zBTGy9CLHjEd8kq/sIsytCyStX/X3uERpqzQ bsa9fZBXOFGNsbA+oj9MfHPNqHpgjLseMDIiUUjjlEdHub36yaiBrCy45W2C61Xu5zY7+f5ISi j+yzfASXxxQzaNo5FYoWCeE9fXorw74ck5eq6go5389rAX9dR2358qhnmBjiaxfOtCq+o+/btN gA0= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:09 -0700 IronPort-SDR: N0Mp4y8z2roxzuFvPYeS73dMUyskg4SUdEFYqtiWL7UyYH8QyLK2HbkzyMpGYTT+EF0PQ5R5Nm mbPRnmO0CtIMwMBVMTx15s9v5a5Oh2WyHga/ttkbUx7Jl4Bta6scFUZ2meTIIX541t59maxWrh lWBndZcPbu30Jx/mVNKgDiRjvYH1saj/OjkpXgu9CIhpiu3Rt/dyHI1Jxml0CwwJUNnrSWSZ1k uBy7/6x2V7pUSi3wBQs8HX8G/rHyPZfLVSVpt3mmdn2FdzPjXwB7XpwzdquL7kP57mT3B4RFOz TRE= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:14 -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 , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal , Dave Kleikamp Subject: [PATCH v7 08/20] jfs: logmgr: use __bio_add_page to add single page to bio Date: Wed, 31 May 2023 04:50:31 -0700 Message-Id: <9fb5ed86d19f6e0b6f64dfc4109a48ff8ff24497.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: BAABEC0021 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 9eg6x9css3mqp5y37ygq1w87cy4xenj3 X-HE-Tag: 1685533877-626429 X-HE-Meta: U2FsdGVkX1+mQPFgo39UyacD+fvMz1T1umXqxg3HLpqbcCeP2s2q1WsF1KDgl5SslH6kGNBjwfkgBdxAbyghzeSglrnJJHfwcjs1i60TmRDYgW4Ave5STWzBQUVq2mYAuUhfuDflV+l9kJonsaS/WV6QzrNoKmPcXdh/MwzX9oQpQ2IsK9ozlcbyMviBNq/WTQtrSU/eFZN5um3hQVzpROJ+XUoRJjm/Vf6vUTZoL8r1W7lgxkMj474za1+EFuuWJ0og3sO7uQohit3ryYNH78VCj0SRSEVblqXPCQ36/8r3JtIycHRB6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jLlbN1YS7/OlR9soiypQ= 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 Reviewed-by: Christoph Hellwig 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;