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: 13193931 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05F94C77B6F for ; Thu, 30 Mar 2023 10:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231167AbjC3Kqs (ORCPT ); Thu, 30 Mar 2023 06:46:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbjC3Kpn (ORCPT ); Thu, 30 Mar 2023 06:45:43 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78E55A244; Thu, 30 Mar 2023 03:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173112; x=1711709112; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HqGEov3XVaUSsU1qoKvlSzA5WCxEWJpL8TqhnbfeoRI=; b=FMSsMNmEbe2UUJAcD4iJuSmj8MniAl5M6taPCR9j/TpK+gfDRnj8l1Fa xAhNUO66xg0E7oZxYXL8XnLLQGzGCNqvZBQ7+6cSgLtlLukuEPj2oWJ57 G5th6GuqLWgBh90QZ3Z0GJbUMVWXc/+W/J/vGn3p29KM4qCD/l/fUmkLY nO6YhqKCBXUhonzsnqi8aE5TXeGnLsLViIxWcWd2njV1jlHhhHuwJ1EOM GzA7V03K+hH3htQ5I7XNrDyHnbhBsIhlKWFrxg0qrpC2Ptvu7aIfd4/oH ohe50kHJZXBcOvurflozzvumMiZnB4VfnyK5yGFA/5F81msJn9Cg57cvD A==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="331317859" 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 18:44:35 +0800 IronPort-SDR: 5bnsLX/33pT0DHZ9usfxn+SFAT+D2VhNk8VjsruKwnA/k83Gv5eN1X6AxTWQph8deRhtx/KCoJ 85FK1dUuxRLuTDF14bNa3XR2mY5ipDiiRuc678JeXzKY0fmteoIOF/XNgfU551UX/kZj2GKP9z TcCh1Etj3X56usCv/DPOVCQ++URzBWpKM+Hafq/QVW4b9GbYPXi8ubn4ypT/0d0CiWmR6ZtZxL Ov+e5b3HADkezwoIKAy0c6MQRg0SNFYduOfKRgpoqFJa9ZKGgvwCA174CCBwCYRkdIcYe06oKx tA0= 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; 30 Mar 2023 03:00:43 -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 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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;