From patchwork Wed May 31 11:50:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262043 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 9EB5CC77B73 for ; Wed, 31 May 2023 11:51:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 424E16B0092; Wed, 31 May 2023 07:51:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3AFA76B0093; Wed, 31 May 2023 07:51:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24E756B0095; Wed, 31 May 2023 07:51:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 124726B0092 for ; Wed, 31 May 2023 07:51:11 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id E048D403B9 for ; Wed, 31 May 2023 11:51:10 +0000 (UTC) X-FDA: 80850384300.06.1BA020F Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf02.hostedemail.com (Postfix) with ESMTP id AD8588001B for ; Wed, 31 May 2023 11:51:08 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=UZB0yu14; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf02.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533868; a=rsa-sha256; cv=none; b=5APKIxvzFDkkVWdX98DKAg2/zWlIWo4HeDhR/ibKBDkJa++0XxbyLQL1FhB+lXIw4931GW fN/rGx9cbBXc18JCmh4YJmXxIfiGZULNA2pmqJJHBvc3zoFTh4iIa8KGaoGX8mbd9x33sQ n+r6kiXBnCiCSOykswRpvd3iv3Ee8uM= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=UZB0yu14; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf02.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533868; 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=kHQVtEFS0ozGR/5wGcgQIBQdU8zXb6vbZolyTo60zkg=; b=7yAEMJy5DxH5TAqVLZe9wnRqD09gD3TbjcI7O2hF60oUVCL4avRIzbb0szwIZHdPBt2NOX WVvBm/poiU/PshH9OLonhew7GpUYVGvssh4x94fCMGK1JT5qaVVc7MFi3T2czYC6pTsM9u lHyuP6hIyMWkD+jawBbFT+4FT05DMSk= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533868; x=1717069868; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6fCkYLHLU2sdscgq61bKtq6BxI8MUyl+IQuxHUEXz0I=; b=UZB0yu14SRbdGeDKgPlFtPtd4DqHHYmrJFFOXcljuoSgXftLX9uZH1I8 V3SvZNKjfUhB2pgLUS76CDiG7r5Tj+0k48COH1G8XcWeDm4QNM/pIkumh T8TCMhRY/zG5VrRGfyeP3LZvXrBunDmJoZtaRTr55e4Ykwjww35tPocQH ZeZw36CU72vYQGmpt3H4Lj6urlFdTmNQaluRHpGlCyZwDB9hBfxkOq9dN BHJpxH2g3KorsA0c+Zznso0UQt+krPtTcIyIYwOZfqzCax8NaAj+lfFEg Bl+uqr9eJxDrdZXyf+RJgpQZrgtnintDYlDGR/olUZmoNsNpir5mEQKAp A==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207406" 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; 31 May 2023 19:51:07 +0800 IronPort-SDR: MDJF+1b3Q8UORwhVkG6ZWdhnr60O9ZLWCUaLSrFP1WRaCYyA7oxz+461YDXQZqGbsd4QxzUxSg 7RBMsWd0ssiB7ByZ3D2FOeAhG6Hvac1WHugMKBsLaWmL1fex2BWlTheTtBFEkVFHjPyRl9uZFk irrKgLhvem4r3rzYeBd1iOAviyoqm/ZpKOL7vNH91WYYPNeTb7RgQqUwRiEBnYFSxPFcWQ20K9 8ZVA81guDbE/SlrDjkBBtwbujaETho7gg4WuKUm4Wx4Ealw0ILqyne3lGOLaJ7xpJ9kzeZkZM8 Vro= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:00 -0700 IronPort-SDR: Gn53kE5C3awoJBs1z8/fu9zSK3J2c16Qw5Ap/LwMuYuq1ak1onfG41AzuFrfFpDgw093xXiL8G 5IDcs8WVq7GROIbadARWQhW/82INlpRG5KezVbrpCpjOVN1FS7s+chB6/dVDBhvHoAzlmzvsFt +UZ3q3RZ0XLcO9O7h/52/VdpNEexXInUlEcbNXk1U6y9Wg5zi88lpDr34tQ0Wi9aG36WAafIri cEDqzhOb2lXEhROumtjAKvyFK4NA5YKzTDsiWVMUWQxoi2jyv0y9vscB6TDzCHDh05FrNT2GE7 w8Q= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51: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 , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 05/20] md: use __bio_add_page to add single page Date: Wed, 31 May 2023 04:50:28 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: AD8588001B X-Stat-Signature: 4qyc6hkqrejoo8izsjqccwt5t9z5hnrm X-HE-Tag: 1685533868-601753 X-HE-Meta: U2FsdGVkX1+1BV2rxPg22V0C9F240GSrEhuaACyo6GXLrqM4PGhFq7/sYJPN7bWQJpBijJBP26JiD+u3KlbrQY1wPV7QfMThyuWqADQHL3Ux8aozSTdY76JHY7MjnLcjFI/uZwF/XmJfK59EgBG1xW3VLutMjz5h6raoSZoJerZjyWg5SPq67VuVLujZ4ACsQvXQXcT71O/EP9xuCS8cfeuMIId17A7zFqBdlxWkWwHEO+Iqsr3aKL1Hn+330HvoWBWPn3vcKxqzRpT/g6meKxfGKRdbwMcMk7FvX9tABQk7/YbH3GmHTetiNzzkf7i4+Zr2l5UHYEIZWVpITWEgwdwFSPrXESH8j4ib2KMEgvWMaMIu0Ox4zO/RjeLM3lk9PMMJqV+pGbUcV/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.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The md-raid superblock writing 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-of_-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Christoph Hellwig Acked-by: Song Liu --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 8e344b4b3444..6a559a7e89c0 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -938,7 +938,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, atomic_inc(&rdev->nr_pending); bio->bi_iter.bi_sector = sector; - bio_add_page(bio, page, size, 0); + __bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; @@ -979,7 +979,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio.bi_iter.bi_sector = sector + rdev->new_data_offset; else bio.bi_iter.bi_sector = sector + rdev->data_offset; - bio_add_page(&bio, page, size, 0); + __bio_add_page(&bio, page, size, 0); submit_bio_wait(&bio);