From patchwork Wed Mar 29 17:06:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192965 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 BCB7DC74A5B for ; Wed, 29 Mar 2023 17:07:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5841D280009; Wed, 29 Mar 2023 13:07:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 50D28280001; Wed, 29 Mar 2023 13:07:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38744280009; Wed, 29 Mar 2023 13:07:10 -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 2394F280001 for ; Wed, 29 Mar 2023 13:07:10 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DF17B160DD1 for ; Wed, 29 Mar 2023 17:07:09 +0000 (UTC) X-FDA: 80622566178.08.090DA64 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 1D4311C0004 for ; Wed, 29 Mar 2023 17:07:06 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="g09kJni/"; 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=1680109627; 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=wOSVNAp03D6yJbEXU5lvzsL+Loo8YVcL8MPqkfE/PTM=; b=yxbKKqKVAZQvD+a/j2ynZBSHHPnodIfoEFOmb5LzoO7Yg33TeaeoJW7/jwhp4vif94C9CT sUjsiui7N5J+ILGnvVW6ptUI+3Hp3uB/1CgegYVejapHzSMiur4Y3snQKsj2Dr7i1j7bKn EPFGZijOzN+qB57z+8sC5Tg0P03bGJY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="g09kJni/"; 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=1680109627; a=rsa-sha256; cv=none; b=ZdTxnDM/GrztaFRC0Tc71uP9B1m/yt6ef7J4yRTiqkpbHX2qIv+VydE98cb3lxuhw1mYJd N8hhUvAy/XW36Ydq+azQgGDaQzCD2sqTDJayzrQN1wSgL4dv2RsHaRWn/0ZL3U54YUgwL5 JgIN7Z+LXBql8O4uIRpBfKHsbUvfH8c= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109627; x=1711645627; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tkkYPg8owa+F6WBdgLFEdkckQq2ouOP6tkr56Y/Y4Vc=; b=g09kJni/YGMkXouPWjIhn7p1pnauVUNpzryO3UTByDCmvfatlq+fvOxd WUBkYOsxY1PSUc9LrWHcuTAuOV0QJgNsAdu+1jiWnKuKfwwE+qSmtcBMP r9r7Oz1gOglFz0a40sa7dJO2c3xsnnmnGO6Ycou8ATc8hdO1/3UYOAcko JkqxJ5dFsNoNosK8J5lKfqLFdaoFi4/ks9AdINW0zW4RgVyUNY1P2GfI+ I1UVseaSbRfRGoPhDCKADt1NuoTYp7gMXYEFrKNc0ED0NadzWc561tTxZ iSPz1Xj85FHI4dqzL0YmAFRKwMUBhshzPmC7bMTWxBncXiPaZbysv64DH w==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807102" 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:07:06 +0800 IronPort-SDR: nV5jH3HwWhUHTm5AEWplH39qP1D1y+wFxMMFbVrYOApvC2BXJK0JYFWpfGTzF3PEWvPxff5Bge Ajc129xQX1um+DPmE+AYtLdI0cMo9ncFpzqM2bqsiTpkYeg24zSkYGVuF66mZ1HrFR08MPrxBU wPa3APlUVdhEba6DW6i73wslkE17+kHDGq4+TFEO3JvISBJq1MbAWI16oapToE1FzMEDD/ZoRW HmIf9wxz8uoaDugV8eMStZ4JKvSfSa6bCxSU0Sf9chgKEcNGxNBl7woZUJzk84kr1oe9/w5OOd WJw= 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:16 -0700 IronPort-SDR: BtjkC8ComN1O7uUI2Q3Yo6aG1eA7nqScdNM5LexHUYipB8t3szY5zi2i62F3kkpHkyVnHuIOGM Ek1ZitEwQvILodyDt/DD/P+4JSQ4FfZCzk5nYQwqhwhLdGUxHoidj3oHzHVwykM3dzMqWELiYj t3kpcItSpp4K3NBCUe8+FOUVxWGvOPb+JBxKANt7O1k/TIuS3Ep1qDEGkSLpmmBcrzqjxJn4El 2r0OJA5Y8NchSO4KSKjNHUAPoqdlwW5gG7Yff3aztbuLDzUEUgexB49y05wzoFymc9aBcG688l mnM= 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:07:05 -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 16/19] md: raid1: use __bio_add_page for adding single page to bio Date: Wed, 29 Mar 2023 10:06:02 -0700 Message-Id: <8758569c543389604d8a6a9460de086246fabe89.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: 1D4311C0004 X-Stat-Signature: azf19mcenu7sowye4kck3b5aanmehygq X-Rspam-User: X-HE-Tag: 1680109626-53508 X-HE-Meta: U2FsdGVkX18XjdQ8h58SIs4Rv+IE7GG2P4uw3edBmwIiGLQCfm4+KU4oz5HW2aJkXHcJ0TK6vXQs1ZcdpmIrRDNlhn0vqNz98UWQSdaffDg9ZHZFWK5Cg7hpEOGwNfb6+GdSxzs24WGJioMUfhjqdqE9zfZdMQMLxU7oLoxMswX/2SVcBrqYgXDa+AzJXJ58FDA9CkdvW7R++bAEwY46V+leslWMoxwg206IWAfUTuWbrIkoOxW0GNaCRPXIvBXTm/hf1so8XAQiXFZFTD9tvuZZFcqGxAB4RtL8lrinooMJkUayQn1ZSNru707miRQB3vReHwlHR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TW6XSZPMe8Dw2h7bJj9HSmhN4QikT2yAJBZSz0U 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 sync request 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 --- drivers/md/raid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index bd7c339a84a1..c226d293992f 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2915,7 +2915,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big * enough to hold all these pages */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); } } nr_sectors += len>>9;