From patchwork Wed Mar 29 17:05:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192959 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 C6C1CC6FD18 for ; Wed, 29 Mar 2023 17:06:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 64788280003; Wed, 29 Mar 2023 13:06:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D17E280001; Wed, 29 Mar 2023 13:06:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44ADE280003; Wed, 29 Mar 2023 13:06:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2E0C5280001 for ; Wed, 29 Mar 2023 13:06:52 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 103FF1206CA for ; Wed, 29 Mar 2023 17:06:52 +0000 (UTC) X-FDA: 80622565464.24.03E91A0 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id D785D1C0013 for ; Wed, 29 Mar 2023 17:06:49 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=o9st69p7; 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=1680109610; 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=RODw3ACWKxAOhmw0RScWTNQz4RGJcUvFm1DA3dH/iMs=; b=mzYmYJaMFmk6IBDODNoGTk8+fDJ8Ft8HJvOgiTwVFXAg9ur42q/jrhHw7MHAgSsvsShSm/ 5bd5S0agJbjB2uDWEj1g4DwtoSpqqEoekn2mlp7swvQkMosBzhcGBItYDprkqUrn38Utmp BaWdLev+z4g664frvCRNffsgAfjUlwI= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=o9st69p7; 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=1680109610; a=rsa-sha256; cv=none; b=WQVGdleWp1HStQ2tGbCd3HfknSqNgtHsfZxRYPTyAvXVY97RY1rma76NtZsYGi9AoL54OX gJJTSslsdbPdFYFRukCemp4vSoRjcmaC1p5Pw0YL7T1ZH9wOxjmiuSXCAhQdSMT+f4RbTy CW2A5igELZ9htgYCKbra7V+RfYqPMhc= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109609; x=1711645609; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i7JyUij1Ub1O7HqbOeYPQInyJM26bTtTnu0sfac9RNQ=; b=o9st69p7Dg4LhIisrR0KMlF4T3pKg1mLJTQnMEw7XGrK8wtPxrVE5RdB y+cJWXOw3IaFNYC7v15BFKxMBlX9UWoe1JExdG18DG0xbABfr14Au5DHL 943NSJutG766/22SkIGFXmkAQID9AWq4ASd5X2YWlreb99bZPBh8BOLVI xT8YF1ySHtGWdgYHvBQv64oR0/8OLDgVDJtHF83C33UWp9nDnuCkr7Ekz 04GomKGyqj4Rbvp36bkEdiyCdVBaMfnEyofv3KoZlZnPzDdcszsgkckV8 AyFt2yDA4/GE84tOwxYHrsiFo3cyjTPA9CbK39V3jS3rQbV+IAoe/622p w==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807065" 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:49 +0800 IronPort-SDR: Mfo+4HftnKW2z7BrZAshLj80QV7Ivg8yoXT3TfpfOH09MguaXqXMHm6FV/UeqpoHc61PnHKWHy QYExNg5htyTfJvybZDc0wlabDROvLif4AkR3h5fL9Td40CDN7SDfdu7H09zNKb8HyJwJVIl/Cf VUxZ5HNUm3JyIQN9RNMwKywf3rCTpxoa7PAHXRt5Ctt6d7cicmHrPNRvv8mV3T7nGj51bRAGvg p+JCvTGCe2Yw436+6iGS+D3dyHlDCRB0a2K67OpoqKwVGpKds3r9uUkN8C55zYyN2he6wqjXKx ST8= 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:58 -0700 IronPort-SDR: qYm/yHxdWsn4PdNU7In0p9zW29uqLpM/KDDhaShYGqmgAouVltU23pwtiDrLcUkxqLoKGpWanX KdIaI00A9Tcxh5akMv0Mg9mzy1VnQEctwuee7xO/j/DPrFAHW8t1jmq6JmwNycdN5GKOwv9LqD EwWq9gZmEVjS+Nt+UWUBK3vepfteneMD0hPTTSlwc9wqo7tnmscJXQAHH1TYXa775C3cNxwC/g gWNbfWYibYW6ZAMQvInFb5YgbQ/DLueK88vnvV9kIxEJhKmn5O2bRK+Mb1jpC7O7+PM6IArPK7 iYU= 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:48 -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 10/19] jfs: logmgr: use __bio_add_page to add single page to bio Date: Wed, 29 Mar 2023 10:05:56 -0700 Message-Id: <902f83de56c67b333959d8b8b4cf37a25414e927.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: D785D1C0013 X-Stat-Signature: sfi3b7a7jzkqffwz6947ndphq8ure4m8 X-Rspam-User: X-HE-Tag: 1680109609-553159 X-HE-Meta: U2FsdGVkX18yNkG7nIz6yysgWJ9IH6LvWq6j77xMjLvwbQ+wdCX8L3W8WLuqvnhs+k8wn85jBO/K56sc15xr6r9vDc3Yhehol72YCce8j3GNAUwAoo+9e7NcOvnhaDfE0T5H5MWckbz0eizuGXICwns9+7AQLPFP5QSrx0NW6yNrdToXU20/uC1uWuAOpuAaC2OcJ1wdE5p8LSe+Ahwq8XoX4GwlXDuoOJQKt4Rj7Uuw0X9+w/gSg3A1JD21dqnz5Q65uVUZlOhoEMxkbXvCLuFkCwoR1WSB504KXvJdrZbfoTv7aJSGc2EMuGwLkrn2Jmz0TanVCCOh25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=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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- 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;