From patchwork Tue May 30 15:49:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260561 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 D7294C77B7A for ; Tue, 30 May 2023 15:50:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72118900012; Tue, 30 May 2023 11:50:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 683A2900005; Tue, 30 May 2023 11:50:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 524CD900012; Tue, 30 May 2023 11:50:19 -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 363A6900005 for ; Tue, 30 May 2023 11:50:19 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0C094A0264 for ; Tue, 30 May 2023 15:50:19 +0000 (UTC) X-FDA: 80847358158.19.3527FC1 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf17.hostedemail.com (Postfix) with ESMTP id D058B40024 for ; Tue, 30 May 2023 15:50:16 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=HVik6zvR; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461817; a=rsa-sha256; cv=none; b=KnmrIhH52LdnYVAG0E39d+jwPQnj/iDMoSJR0tGUQbP5nmoSX6yuiSUY/xyCPtcgUG7+MI CDE1cT2vfhS2EFbschwEYXWldH7WgoEZktZDYBFCbFsQ7xIE+U2Y+zOE4yXFJsAbYqH2PU 0+cJ0Nf4z3PeXSUpE0f/kWCpOxO7lOE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=HVik6zvR; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=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=1685461817; 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=Ep4Og3EKp8jaRB8BhVIgxkzNMdqeXnONg8MmnRMChMs=; b=I0r6Bogp7AGOMiWQjsc3lGpjUEsFjWa9gttdEryPFqRPiS3gwB67zsUqJ2DVqr799orEiH t35L2vUlT1cvmjToe3I7LlyygMt7WKfz8yf/nCf8pK2jkdD4okwou+5Mok3XZb3K/v3u/B ocwsq2Ppyz21EkrLfICoMjU4x9ctDUo= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461817; x=1716997817; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gLNFQ6oFKOXzjx1/s8qharxbtLHt5SQOkfsl+Pqo6CU=; b=HVik6zvRjvaPTGAp0zKn1hSolZ5VQ0+UmtIwpEuuSLMmOQQJAC3xPZEd zhpWvWmxkiP5FMWRi54/V8uQFaa3vkgBt3VeK6hiGuN/Vl6nxCcLujidd Cdq7TVri+jCIjcyPaS6YgTVh6BVPFMTZMhuXKE54cmKVYKM4O2DUMPsDR sZevQAmkBKIkudVUdqUl+Cf020rHnqoUXVpBeNHN18WjHBaYIq27ZBn03 gsC+cnGtElUpCEw7MFbFvlMfAsq7howPJp7M0peMvZxSf3x55jjOvvEmc Be0Icsd4aB8+iWemw5Ga91hcpb/yYYMPrJH/dlsNgZWQ0Cgu7r07n3Lgc Q==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905749" 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 May 2023 23:50:12 +0800 IronPort-SDR: z73r4Zq5vBhf4R9IcX3iJnTtw1DwCtWHAnuHrMfGzQC7fn4cvGYOqDD5l4BotzJiWJ74BQ0o9+ PEH2H7QpdFeHUAvok9iSVJExPQbOnzeCsZ5/ttqFvmiSN6L3QTmfE47XeJ8xniY63OoYrlWDNT 1aaGXOUn19Lp6ZdrdKjyL8zk9BiUhhbzJcil5cjcTf8wQ6lpm2UO+c5dMs0SoQxyiq7PIbvEL6 MNNQQZFhekLjC/TmAZAe95/z+fTAC6QdUK2pcvsU0xffGDjnmx80/iWET99tCCWeJWh92w/Wlo rqA= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:24 -0700 IronPort-SDR: snoYL5vkwQY2fHovd8/bCtXAqv6z6MFk87CGOha3y1t4nQ3bzraGCrnIzedV0/LXm49W2WzhWH OUgIPuepqt5ylCZ0SV/DMCPXbIyw1ZMmkUrTUJnzVN/uHZbS+HyYQMQ7p9zgdDgEpDAO0bKSNQ b9sBV2ZsNYFfhtNaL7pMTYRcvQHa2AW5lh3lf8gZABJoQuBL9ohV1zESC6t075E2qXQDGdMKNU jeEnItThG3PlPxvvohrB/SNHt+pgq8Cps3WQ5E3BrPDTb9RtzCLgejg2k7fg+5N4Buz0u9oIhz Zbw= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50:09 -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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 14/20] md: raid1: use __bio_add_page for adding single page to bio Date: Tue, 30 May 2023 08:49:17 -0700 Message-Id: <05f4a70914885813a2ccdbb8aa7eb7d75f79329a.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: D058B40024 X-Stat-Signature: sja13xpy5s3eou3fwopep3qiztk1z4jx X-Rspam-User: X-HE-Tag: 1685461816-324482 X-HE-Meta: U2FsdGVkX19HG7Ta0N3qw2b3YCcY5fPSjrZ9aHxVRO5OXQHbC4mx4C4k/IO9/R1noY68N54fZyLYALTwADNVqPVopokIrV0ziltPJOQiW82bXc+yjOhQmC1EeZNrhO5diKdDSlaaArDZYA7PA43O4QsLXTXkVXt5W0YaB0nc/CQvaZ2X0PcolzUSUre4mo2n+8MBJ+LLKvFE+xT+9ANLX8T4+UWPy+56mk+rJuepb9HngWyAcOxoV8pmYE4uV0EPBVP+pyaz7gwcpNkx36DuWiBgseZ/yKRqkoMMzwHX57+nbpjXQoyn2z+OGqahPmXIBHb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oOVo2YUnlaCUOuXlmkaUbLyTdGeU8yl+PS51+eztX1z2FXZ5uz+kdYoaKt0nANY8A== 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. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 8283ef177f6c..ff89839455ec 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2917,7 +2917,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;