From patchwork Wed Mar 29 17:05:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192956 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 95189C6FD18 for ; Wed, 29 Mar 2023 17:06:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ED7E900005; Wed, 29 Mar 2023 13:06:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27644900002; Wed, 29 Mar 2023 13:06:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1162B900005; Wed, 29 Mar 2023 13:06:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id EFE6A900002 for ; Wed, 29 Mar 2023 13:06:43 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AF9931C62E7 for ; Wed, 29 Mar 2023 17:06:43 +0000 (UTC) X-FDA: 80622565086.05.899F4B6 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 57AD11C0018 for ; Wed, 29 Mar 2023 17:06:41 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=VXfIha9g; 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=1680109601; 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=ffTON0Kh+3rXjuVpsfT7Vu3uoqtPOS/kkdvUs5WLrAY=; b=jomjGWWrNQRD6M8pqEM7GwTYYmKf3J68ZFDRU36IpbM93s1hu3nUXaG35b6z2xKCzNCua+ ZHTuyd8ZrheZZPLPcfoN0qNAeaUaMQmHb8jMiv7uSMeGgZsA50H6z+QUVexuF4f2qu70oN jaFgBif5ozlov/Ye+J5CyrjnIzypAQU= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=VXfIha9g; 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=1680109601; a=rsa-sha256; cv=none; b=Sn5Be/sBIHNQVIbaWuIbb511AtH6GzBIWxKsvTJMtuUQgr2VXCkHF8Lp9C8DIhjGNwGjUA h5/6X98ol9iRwgTFv4ikE+bfQ76ILSeP5o95gHTrsa1Vwnqb2Y1HRcW9AiY6ND9ExGt91+ u3Qx7ffE29PEFlDcjHtnsUq0DD0oOUI= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109601; x=1711645601; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q/MP05JbL9vu4bkJls/w75JhMUACKtyWcGW84ceCR9w=; b=VXfIha9g01T508W8Yz0QixXmDqP/5MjDLtF0U1yi+QKYtftkpf2E/SPC /mUD8jjWLkSC63MPSUoHzITQDVStylx870mtx7dKowxZbOQH5ycWUSyNi O+NIP8VXhuftUShr/P1PknMi07Da46qQoMx8jIieKwzkYi0WAQEigNjBT uHRDD6UF3ABzqax4p99yrk8qojh7pkojZ7JiADEooKIOm4tpegmbZ1sFn PqWDznOeYHCntQJxilvRWUaX10FebmTh2USv8t/wY4xaVuBIahZZE6sD6 9MewX0edjrcYTGWuyWwDEg95a7M4Ljhg9CIcm59Ik+ck4GT/h9B7+Dq2M g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807045" 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:40 +0800 IronPort-SDR: nTGL5sw50T8NTE+6MoIqH1/ovLCuT6fzXRywRe9Qh5ySn81lH60yfx23m0iDfa9YOdVyV2Y+si k2tsdpOkKMa0zsUWe7pETOlwXV/vb8hZf39iQ85u93/L0lJH7azY+TYCmTQYqnxyeAwyGYaGKu +bcgc4lON2N5Qm6+qzWeFwd1QUOtW1uqQqiHK9BH1lbL7KkGP+p11LvIB1d/9f/+GCc6UBzXs7 nlP/9QICJI5U+4FcSxHTt5CqQyZ9RcPSO+/5cCsckrbgZmGen2VzcAtQO0QQ4eMsGlPJkd4bXU vqQ= 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:50 -0700 IronPort-SDR: 0NfE3MwgkRGnbsEfrD3apWVDkRRWW7BpA7q/3BVNoCtKDaOSbe5GU28nZB2Z0Nd+ot/O74I4+M JfSMorqce3BJ99gveZBSA3tXb3rtCze2wGqglc96V0F4bjY5VAmksMNFrMU4tQ8Fio4zpCh3pF xACTb67zGAy8FiCgshGR/AfPrmuBbIYsQe+Z+dl2z3ZWIDuzh9xoVO70zJS6Sz3VA9bGxsm9+b US/RqUK/CXiZRj0Wy3gVSwcyo5L73qLzC9KscH/xn/Y+hWXc2XyYuRcML08nlwTplE7o58ytpj uSI= 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:40 -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 07/19] md: raid5: use __bio_add_page to add single page to new bio Date: Wed, 29 Mar 2023 10:05:53 -0700 Message-Id: <7ba6247aa9f7a7d6f73361386cc7df5395436c33.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: 57AD11C0018 X-Stat-Signature: epckmtk1k6b8wzxce4aqbedb1x6e9793 X-Rspam-User: X-HE-Tag: 1680109601-486623 X-HE-Meta: U2FsdGVkX180Oat655Z3svpLzvIfVEn98FJ2VAWCzyHIDgQvYBxkMsnj9HgcjqDKAg6nSYTcjxEPpfVfGX5iteD0MjQigEzObj8+R92UAgqU0/g8njALYuLmljXvn/CaodXqhA7oKsFOY9IcoTfbq5RI1n1DsVAjcmlat3N39Ziri5LvQI29oMGPzAJf4oobcrWdiG+4ScTDDOjkmGBOziTibSCddAMk2lwFdvvc7oAn9HlNWyS4NgvjGIp8Y8hzKGRAaxiiXHdUfEEvZc2zwRJXK5QIq4hGnYEto29ysDWMCd4XTC9wZmYrNbIXAssm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4XZKJ+AP5CecoLhyYVz 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: 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 --- 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);