From patchwork Thu Mar 30 10:43:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193869 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 295BCC761A6 for ; Thu, 30 Mar 2023 10:44:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C32CD900005; Thu, 30 Mar 2023 06:44:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE156280001; Thu, 30 Mar 2023 06:44:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA813900007; Thu, 30 Mar 2023 06:44:39 -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 9D28D900005 for ; Thu, 30 Mar 2023 06:44:39 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 533571C64D8 for ; Thu, 30 Mar 2023 10:44:39 +0000 (UTC) X-FDA: 80625231078.03.2097A6A Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf27.hostedemail.com (Postfix) with ESMTP id 3191C40019 for ; Thu, 30 Mar 2023 10:44:36 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="J4kg2/Jv"; spf=pass (imf27.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=1680173077; 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=D0ZFCVm07sl2SAdt9JeasHwEhYY1Ply9ltkVWbG5P58=; b=COeGlB92CdDQNNuYxcxB9a7N2GhZhhbWJrSZQVWs0A2p9UZH36jHUNDmbQ79+zJCO6vSuD HeRAYaoiDMi9A8TJ6GJoXufAqDckY8w1wx9yHUsuL+kjxctUH+Ab5nVqqeTrYiTdMKBVvX RNUagbrBzhBtDDgh6Q9K/z8fuNgLuVo= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="J4kg2/Jv"; spf=pass (imf27.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=1680173077; a=rsa-sha256; cv=none; b=u/8doWWVeV1wg2vTmu6Ia/8Lgo340ap4rgFOKl1Cr33K73nbFQHXmyByHyGw/lhAe1D0B/ URtivRxJmDrUV9DyrE10+ExtO0haBwj2TmM9mp/CT1eNh2KLoU2B2RUsvKYpzo/MTOJoy8 aagrsJzYbs6qzXk9iUxFc8aH2LCX+po= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173077; x=1711709077; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HqGEov3XVaUSsU1qoKvlSzA5WCxEWJpL8TqhnbfeoRI=; b=J4kg2/JvvTMLea0LzGHi5ZuNGtqEPbI50g6HPBTehbQq81PXdtLMz6HT VHJQXyahyKU+4Yr/WuA1RE3lO4NZBy4sL+mxgC4oIjvKOr5fU8uucAN6Q QiW2FuSTAZTgepDmIFMPvlr/w4wWx/1P4T5uhBc2rdumqTiPZAHF6Ht29 DZXLvTRFba0KuvvHos19/6carQtDil/uSI9ncQs0UZdbabiJuogR7gbaa Ln5o6LleUFVp+rjtN9xy2tBDu244TCdOkV+TkQPThijPkbQSr5qYSyEcG FPJKs3czRqSzmTjOnqMjclumdLueZ5o35SY4skuGGHUaGR9UmBuvx+C+R w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853939" 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:35 +0800 IronPort-SDR: L18Mb7j74imc70GR+wGn19lo8H5DXd8R2dLAXqAQO5mPcogpM4mkaAvjMO6KemSIjf6nv8rmll /JnR1oq9CsVulVF9Y87YqW3jT6EbgCQRh1WbDZp1Of4SibuJsnN8mOdara0odEDpdPtFBVudZ0 OECXdmn1+EJmZSlSoDsJox+hK3IMc4Dx7TP2XWq0tpKyLvUSLkkgQmqkhkrmrmxZ+XWRL30A1h 5k1cwQHZZQnkJtqsGshri93ZSUSv31yjkVAYBr8A1kGiTZYwYXaNwyMGaNfJ3f5tMq0S0OxrHQ cmk= 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:55:02 -0700 IronPort-SDR: 6WIc8day8NQBouRdTegvxYDP8rVucIjXCP3Xboyy2sbFZ8keAmQDsm9vsW7DO2uS+PyzZmmxhh KWnBTNrkDqHgMcs2uBQzwRKlG8tO/YWT1kyWWWUk13jmX+gnspuRhfKtnbJCyojYxI5SUBXIXL VN+gFqfEZ9ZD+g90ovrKSGS1DwHcbU8Nyz3Gb2ej0XKsCA5/rzxVTofn5VQAQFFvJRswQRcvYg BnU5nWDerGRuzg3XZHk8LHfbUEZFO9ewLWes05uTBeATlTFNUM+742btiJ6qAWVfdyqNm+r+ki dRc= 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:33 -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 10/19] jfs: logmgr: use __bio_add_page to add single page to bio Date: Thu, 30 Mar 2023 03:43:52 -0700 Message-Id: <820f11140138c2deb4a649014556aef27474c13b.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3191C40019 X-Rspam-User: X-Stat-Signature: qsqfdmdpqhxbi3pyy65by6wq64dikiim X-HE-Tag: 1680173076-566835 X-HE-Meta: U2FsdGVkX1/a/LWaMgj1cJ+aEUHU0lnoLleJFDcBOifLUdvhPOWj+PgLdV7LPcv+8QFbDYGuntxBH9qunCylm8dCqR1+x90X20SUozz8BNtVUx3ycBYx0ozI2JjcYjZ9/HUU9tngXn35vE4FoYHl2t23DWHU73dpMTwSDFtaAjbSFCXtQEaSrfLViC19a69j2brD/0dqVlfqreJdVysupZQktk4BgkOy57H78RlBjfuEbKuJV95OZ7fFdeBqu9czmEyrggDqxuzXfleiCOuhCutulLacRLW11eSoLrVg7adljky7ywEqJzqnjsadiXG0+vxrsEAWO4y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amicity=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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Dave Kleikamp --- 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;