From patchwork Thu Mar 30 10:43:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193866 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 519AFC761AF for ; Thu, 30 Mar 2023 10:44:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E2BD2280003; Thu, 30 Mar 2023 06:44:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DDD92280001; Thu, 30 Mar 2023 06:44:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7CEC280003; Thu, 30 Mar 2023 06:44:29 -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 B62D3280001 for ; Thu, 30 Mar 2023 06:44:29 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8CAFF4016D for ; Thu, 30 Mar 2023 10:44:29 +0000 (UTC) X-FDA: 80625230658.29.44011D0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf01.hostedemail.com (Postfix) with ESMTP id 6DC6340007 for ; Thu, 30 Mar 2023 10:44:27 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ManApTrI; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf01.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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173067; 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=A0QwlBMyB0SwxwD67uqMn4GDPEQ9XqxhlHULEh0VC5o=; b=5RTOzooAdcxenqwrcJzonbKhEx/pnqZmhadXO1WFvVt7VnG8paw6UN6llVaOkpMV9/7YhQ 0WaZYyPejarFZ2Ve8Bzau6CYLLrvDT7FoxpT9/xfAF0bJrbi4mKHpBEL7dWODmllUBCJab aV/tPwOk0DGd070OUfYox9HVp0H3+TE= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ManApTrI; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf01.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" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173067; a=rsa-sha256; cv=none; b=IAT2hWwAV5XKFOlsxp9k0U09LrmR1VxpdichBgUCJPjImO+JKz6zcovkN9mX9J1DAmFfZI hkVhmmnTRW8cqBUsvc5/aMe9lOa8jA+QXTeWjOJWIpSyGMPLdVm+kDADcmpefMOMMRLh6o QoY7HeHN33DbnwSA+4hFSwMidFNac1Q= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173067; x=1711709067; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r2Sf5mUt9HArXYNHtNNZG9NyfVeVIuPp2J4v5VCyro0=; b=ManApTrIi4HP/4ieqCi4A/QEi6YE33HxsRAx5dsLPjahTaOFo9N+hd66 6lPyLmu1LtiNJw0+eYTndbBp1yc94dj8xPXiJtoru64uDexpmJ/Bz1QbF TSiFb3mf4+zrfD8If4hQrzXoev7qYnSj+EK5P5SQvV8BuGeV7Cbwr9CBE bPdEHzbG6CT185TqGmavBu6rws4BQD0RMZooRZbgzR83S1TuAXmhlOu2m oFu/+2kKr+Fy3lzvDrMO/00D3C8D+vnkLjk0Lm8UYVinzbC5m69zznMMh cVXdXcUfDgFW3n+0gl9SUueGL2IyGNRVX4kvBT61jXpp8A864ptmAw+fi w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853921" 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:26 +0800 IronPort-SDR: LgQCAUXmBjSCu+7StUntwIOtWhnz+6eBgqBk8Ks5vucMXqN50ZrTF2pxAGhepPa8rQBtwa97j5 8ObxV2MNxyamlx5it5ONnAw8ZtITHz97gfjORXG8z5AYeJYOMf3w4ArsefdY7AYsCJx6wHmdxN 76ffxtl2etSCcd/CI8j12n+x7Cmx0bgf3Oym3BnWfTipfU+y5ERYFLKLE5IxnpcvoQfjEKGquu ECqiFdlafZOU5yFJ3SfQBd+yatM0bJMY0pFYCzsKOdsHG7nkBucX0SGFjPa2PsB4OQmubky4ph 7XY= 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:54:54 -0700 IronPort-SDR: Rnq9MYYdPgA09fnMFGRGvOdylFjRCrkzOVUrlWYy+L3Pme/NCk8sA6Zn7WCywdDLeWt/7Id+So 1032rM9LOkm6qL/hQgb+OsbJJwqKy6GZX5osAi0JcBf/+HCsJ3q7zLHVPXdvUb7yKaauSdhmYJ UDmdNwRTrKFtqsgT9GXLB7RhMWPPebX288EPBWtvMGFgihtyj6p7/rQAmgavpLeyucAJfIzx2x S6vPkaGyF+tI9E7e6BtHitbJy6rXVY95zbtc7Z9n0bymNi2mvwGRpwXi+6ApwH7c67oPbylcoo uXQ= 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:24 -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 07/19] md: raid5: use __bio_add_page to add single page to new bio Date: Thu, 30 Mar 2023 03:43:49 -0700 Message-Id: <29a2488aa641319199c597d1dc1151c700e32430.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 6DC6340007 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 7sop98zqmk1di9wq9aithc6nmz1ehdqq X-HE-Tag: 1680173067-912070 X-HE-Meta: U2FsdGVkX19sK/bLKn6EeOwEjetfUJFM+TatU7MSnhYTEkzYopwHM+ZmaXSN2wkO2NFRhj3RmVequqnqwek2QruXhokTKZVK0K34JuiNCG5vohe5mAKzR6Zz9yanjKSGzIhVMKEvL5/lC7Zm+3jvhCD8SJFfzs5BkAWR+GHlljahRwSxhxnTw2irN4b/9QHGgDFhwqafg0xk3ltTvmuvjLPBdOKrysax2vQBhWgmg7ro3TvWnOeldMwO5Pap+GeYopEKRZz3JdAUcFtD0134KjezGXRyErOrvCqOswgkpWqn5dTjPIXdqQJD1e3l/WJj8Harg/Yy4i35ip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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 raid5-ppl submission 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. For adding consecutive pages, the return is actually checked and a new bio is allocated if adding the page fails. 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: Song Liu --- drivers/md/raid5-ppl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index e495939bb3e0..eaea57aee602 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -465,7 +465,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) bio->bi_end_io = ppl_log_endio; bio->bi_iter.bi_sector = log->next_io_sector; - bio_add_page(bio, io->header_page, PAGE_SIZE, 0); + __bio_add_page(bio, io->header_page, PAGE_SIZE, 0); pr_debug("%s: log->current_io_sector: %llu\n", __func__, (unsigned long long)log->next_io_sector); @@ -496,7 +496,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) prev->bi_opf, GFP_NOIO, &ppl_conf->bs); bio->bi_iter.bi_sector = bio_end_sector(prev); - bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0); + __bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0); bio_chain(bio, prev); ppl_submit_iounit_bio(io, prev);