Message ID | ef742ee32fd0623008114e929d9a3e688fd721f7.1680108414.git.johannes.thumshirn@wdc.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 9740EC74A5B for <linux-mm@archiver.kernel.org>; Wed, 29 Mar 2023 17:06:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ECF5280005; Wed, 29 Mar 2023 13:06:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27573280001; Wed, 29 Mar 2023 13:06:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C966280005; Wed, 29 Mar 2023 13:06:58 -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 E365A280001 for <linux-mm@kvack.org>; Wed, 29 Mar 2023 13:06:57 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C22BC140DAF for <linux-mm@kvack.org>; Wed, 29 Mar 2023 17:06:57 +0000 (UTC) X-FDA: 80622565674.06.31EACF1 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id A14AC1C0004 for <linux-mm@kvack.org>; Wed, 29 Mar 2023 17:06:55 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=LQqaE53g; 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=1680109615; 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=S+BFwWLZNY+XTztAeZgIYhwSmFf4miqDC5Fj3p8mNDo=; b=LieddOw3BwZfkbPrMkqqWcff7rd+CZpdRFv7ARgE5w27RbxzOMlpFw5jVn4mhgnG3Th0jH ifOm7ctaDn9muLkTBkrYg90ThhuzEwM76GNPyb1BWQvlH62wieXhUbWAILK1imPUZqcV22 cUN03duOoep01LMHIpmMW+9silPHmQM= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=LQqaE53g; 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=1680109615; a=rsa-sha256; cv=none; b=vp7PEvIkxm/d2P2+Lu2fsANm351VnzkowKq3bFYN55wpmB1pQveoHGxxw6idXECsx3XbLH Pg6/guT4J6Z9N5tflAbw9QP3jrheEbTmf+4NoDwBYhoMSSJLN9G7sqmAeLq/lkCbFdOwbE N5kcPFg1pGIgOp564ajxShd71W6utYE= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109615; x=1711645615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M6quq1m4TWQi9osOf7yGXSERsZmThGo4OIw78ZEc0Rk=; b=LQqaE53g6gBGm9E4XjDUtfwMdoznSgky+mtx1L5Dt1HRfVcejyqaxgZy GJMY4eFv3pVbsh+OpMi+H93/iJphTrJ5k6ATxnJuqPEofzB21XTuSkgIf CBqlZXzD1MmMJw6fdt9i6Aj0Qd41/eMgVp3OOzqmELT4slUDadiPiTSu9 IExTpvtzKDWqgAI7AJwIVqEo5cTA1wp43mgyqUr1gPYrLpgtVZx8dKTeY Mu9tTWvu0xKsHMrL+tlNrmtqSzVz47VYRTHm/fV5kWBftHrKVn3IfVMrS otwm9RUd7Jed2G4gik+mLz93XPRU6pv7VQogQoWvPkg+429yK4D+SKn+V g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807075" 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:55 +0800 IronPort-SDR: V8E1WUFU2BZv20JPVHB9A2cwqijqdyqzF2gNd6qVZKFmOkAvY2u2MXIAT4Z9Sh2tQiX137FIkV 2FrGeOo/NDw6jPgQJXMv0BR5HypvkN+2w1t8c4t1ckx+1JMb38m6CRlgZgnFrkGS5czV2Pj8Pu pcEhxwptlfGZR9skKL79mYF9UgpTtEytmVLGOLiAHKs1Nwh8rAsp6VoJZGNJvq+Q3enMfQIcdM jakui3iw6eAf1GAedW+dntkA9SRxc7qwPrB9NAI0PyX1KCipBkmRcWdV7rjRb6x3mgFI4BQyRV /Go= 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:23:04 -0700 IronPort-SDR: EfB1mid7Yp3/W8x0cv1xCvTqB4tmpDb7gKC20U950XR4Kv25uQEBdHD2sX3z0ZSLxA8GI0cOXU jE1Ay6UJMQxVqHXD8lvWm2TZROkyzsfKMaMopjdSYaXULQyEClmuQw9VtaHAuYJDBQyPZUJCRQ vKqkM9YtA+Ksasx1R3ikQB7dJRHIW5dQWGWw/GmsLQGP/xKSrev88U8DdNIM9yoEmWmnU6huII pnzvTC1RT/B69S+Qs3+2aJU0lcD20LvjPRlcXyQ/bpLKfriwZ9RZdJzOSPmCY3zHV4Gxs0dMBD Qdk= 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:54 -0700 From: Johannes Thumshirn <johannes.thumshirn@wdc.com> To: Jens Axboe <axboe@kernel.dk> Cc: Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>, Chaitanya Kulkarni <kch@nvidia.com>, Damien Le Moal <damien.lemoal@wdc.com>, Ming Lei <ming.lei@redhat.com>, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu <song@kernel.org>, linux-raid@vger.kernel.org, Mike Snitzer <snitzer@kernel.org>, Matthew Wilcox <willy@infradead.org>, Dave Kleikamp <shaggy@kernel.org>, jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson <rpeterso@redhat.com>, Andreas Gruenbacher <agruenba@redhat.com>, David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org, Johannes Thumshirn <johannes.thumshirn@wdc.com> Subject: [PATCH 12/19] zonefs: use __bio_add_page for adding single page to bio Date: Wed, 29 Mar 2023 10:05:58 -0700 Message-Id: <ef742ee32fd0623008114e929d9a3e688fd721f7.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <cover.1680108414.git.johannes.thumshirn@wdc.com> References: <cover.1680108414.git.johannes.thumshirn@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A14AC1C0004 X-Stat-Signature: 3jzwseewkmhuibk7rjpzeagshkoh4xmq X-Rspam-User: X-HE-Tag: 1680109615-851249 X-HE-Meta: U2FsdGVkX1/2aDXWzC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2T5x7+xCqB1OWmRb0/tWKGlyFCbdrLw7diDPqz5Vq4jdNCAihlPMRopsPZ/W22gd3AoDQeHPzldd0v1lBNKt+8Zg4XuaL8qRiHRK55n4+s81cJT0XGzcDuBGVAYU4AxaXwpXmw1C+ktsTaIh7RU1NEeZ6n/1duaW5l6xwvuklJNOQAlrNIUA1M9fJyhofc8l6nrMiT2yobUx+9GNGntyXB3K1MRH8LmO3GFfgeE5DKaDGDopzPC3NR/iFYYzebLFKMMSJVktnng1p0R+i4RAc6GtQmlPFTG2HrJPW2JDLGGxMpg 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: <linux-mm.kvack.org> |
Series |
bio: check return values of bio_add_page
|
expand
|
On 3/30/23 02:05, Johannes Thumshirn wrote: > The zonefs superblock reading 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 <johannes.thumshirn@wdc.com> Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 23b8b299c64e..9350221abfc5 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -1128,7 +1128,7 @@ static int zonefs_read_super(struct super_block *sb) bio_init(&bio, sb->s_bdev, &bio_vec, 1, REQ_OP_READ); bio.bi_iter.bi_sector = 0; - bio_add_page(&bio, page, PAGE_SIZE, 0); + __bio_add_page(&bio, page, PAGE_SIZE, 0); ret = submit_bio_wait(&bio); if (ret)
The zonefs superblock reading 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 <johannes.thumshirn@wdc.com> --- fs/zonefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)