From patchwork Thu Mar 30 10:43:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193875 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 DE788C6FD1D for ; Thu, 30 Mar 2023 10:44:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7296D900004; Thu, 30 Mar 2023 06:44:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B0936B0075; Thu, 30 Mar 2023 06:44:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 550A8900004; Thu, 30 Mar 2023 06:44:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 47EDE6B0074 for ; Thu, 30 Mar 2023 06:44:57 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 24E391C6090 for ; Thu, 30 Mar 2023 10:44:57 +0000 (UTC) X-FDA: 80625231834.26.E3AB1FC Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf13.hostedemail.com (Postfix) with ESMTP id 20CA32000E for ; Thu, 30 Mar 2023 10:44:54 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=SBcf1dAP; spf=pass (imf13.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"; 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=1680173095; 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=V0jPG80dy4YOQg256dCn8ko7STdlb+pxF3jtDwme0LU=; b=54kT/e13YoVE2vFDZnr1x5F05DcFx6FsNjcLmFpfXKN9sG0cncoCvHNjXP6tIvQc7kG5SB uJE6utQraGEipWJQwEFH/ZpFvvMTVu6V8TrnYWveS19n1xcF3IGSLde49NhB5xrlCZghT8 IUjarxf7dvkIg2OEyoPNeXBIqkA40TU= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=SBcf1dAP; spf=pass (imf13.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"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173095; a=rsa-sha256; cv=none; b=lqKWLA8fItOYcyCVMeBjH2zPtAVjtzXPV7hjvkCbc8NoPsNfrSkAlRSQiPeYOMeTkncmSO BpMxix8bMcq2Clj+K9IT5C7gmudiqactE0Si1Gwo0RM+GzZ85f3JLfNPLsUbtyJ7HMRqGt 29jquwO2iAZ/cInzlgtbSWXQaNznvMk= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173095; x=1711709095; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oL2U/g4EaJMTT3671h8rphk5MC+hx36IPn/aySLD9mI=; b=SBcf1dAP2uZA4LMsNUCn8bcFqdRUf69pqS8UqeiAZXmj69e6zwspuxaR tyV4+wQeZNe7L7U0ZUNKPNkcRBk0Vcrmx37PayLVLl1X805QWqTLA3cIt lK92jeKV9fB5PRF6T2aAWIlI1nG14OR9ttyOxvCnXXJxmO9jxhDuhD4/O OQjzVJd0MorrMvMAQS77ZB7NZpGBtGfL+EYikhTh5/8cgl9inOe0SVWhN bOkf3fEgnyZWU8zjGK+NnFj1yxRg+yWPI7eLCLItxxy/YfDYo5b1YEGvf QkhDknx09gqpAvNQI1nKKSrkaiLS9V26C6TR1eUjHNtI65Khuv3/roIsk w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853981" 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:53 +0800 IronPort-SDR: P9ygv59cpX2LEvW97Pe/Ogte5Y+pCgM9jbbElUwVF5O/Acqf55fvBITb2c0oIa3k696qU9G/QQ GwrI0ebETzCMp122SFsX4dv2a5MmqoyEA4P6fWxGip5pqMUHdr+7P3qLm9Ni+NrXejUCxuiF/m QQ2ktE0Y2gec/q11TsC6ZyM1TM16HF38x6lNf6zu5yYHgsxt6BRCNrzJq2+V7SJb3sE5amI25T lKC2RbO7oQME20gJCjrdvEziuQw4NGN6Q0iFgMq0ePavierGmELL1D91eIm9Vg4yO/6XctA2Um S6M= 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:55:20 -0700 IronPort-SDR: CoMzsHiAS2JR6nHz7NkC2bnUoQ56O2VVvllRrO/O/vDND9erWG2x+0sd/n32CtrHJXq89I7Vpx 3yXADu4Qzn1egGoPoaR5LOqXgneY+WCGslMK0kk4RtBPu9UBwrphetuapusHacgSbZc/GjpP04 rOM2hwuQmwq0JHF9BBbZ161hAs47W3Bw7eBGyL1xrobBRYyZFBMncwXMAQ3J+2GPapCugFKR9F g47K64zulVURfvgH0krXU+jb73cw0ekyXDiawSnLCfzfBr1nZC/vguolrUE0Kyqh7/cxMzE5Dn xv4= 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:51 -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 16/19] md: raid1: use __bio_add_page for adding single page to bio Date: Thu, 30 Mar 2023 03:43:58 -0700 Message-Id: <4c9eaedd34f80d3477a5049f49610a8da8859744.1680172791.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: 20CA32000E X-Stat-Signature: 1qwmq3ttmbt63p6ksd88k39a383f9tio X-Rspam-User: X-HE-Tag: 1680173094-683233 X-HE-Meta: U2FsdGVkX19T4woLDxcM01/qb2Ly0+05uDGig/jUhQ9AoynZVuKKxPOl5SmzOqs9VA7w+WdWLM2ls+S4mYCz18G9JAykHpD/dCaDdThwhLun9oMOuUw3AgYdm/EgImPSK9U3ERivkkL22pf5dPTF8Qihx2hbTkb34Q5FJLQ7gbjQboDprRCRBFRmlVJj4KgypYgwIs34N+kI/BQUv7mAHfgjsiGnAGmKorrBcqg79hjGQ99MzbpkFdMZYfLaceGdcxelA7YEhhV2fb/I520+be9sGJJ3zi4YRN+j6rvxcAOo9ltI+894zD/Wj4gxFJaRAec2YjoByISBlqjdAzVten8x6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aR008Uz4f2TTmg== 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 Acked-by: Song Liu --- 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;