From patchwork Thu Mar 30 10:43:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193864 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 2C928C77B60 for ; Thu, 30 Mar 2023 10:44:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0A35900002; Thu, 30 Mar 2023 06:44:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B93C9280001; Thu, 30 Mar 2023 06:44:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3622900006; Thu, 30 Mar 2023 06:44:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 95D57900002 for ; Thu, 30 Mar 2023 06:44:23 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 67BC0A08C1 for ; Thu, 30 Mar 2023 10:44:23 +0000 (UTC) X-FDA: 80625230406.17.5810689 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf27.hostedemail.com (Postfix) with ESMTP id 59A8140002 for ; Thu, 30 Mar 2023 10:44:21 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=R0kyubAD; spf=pass (imf27.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=1680173061; 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=kcNN3p6S5fn31oSt7NvkB3NfN6Wj528DNJTta2mWC1Y=; b=Go7LgwpJWD3EgeEVpWHGmRhhNuINgVnwSo+qNitkOop5LjC5bccBew9OO7U3INN6tv6kxD W4UFQRTf/A0gRUOJDXKNq9MX9hitZmw620agt/RmFxi6b5yRHhwGaeESLVf1kD1uXmeAAB qrNSa1b14VdJLUkugnjvw+FT47NjBXE= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=R0kyubAD; spf=pass (imf27.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=1680173061; a=rsa-sha256; cv=none; b=Ks1jGRLnN0FjOMPFBPBhnwaLaGVxkAigQt1FyILfBbEd4foAtprcTV8yye5ocrwuCYV7Cu GyKGYvVexxKWbXnQRIhVzOtMX03pW/dAUrKhOQx6eVE4fG96tzDN87NsWcpmmGtH/JCTuf AebIZYXI6nC4w239cgGkJD9wPNONBzw= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173061; x=1711709061; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RpitYrbMFeR5j8yxFMmc3tnhDIhgkd0gY7Yp5w5KjZY=; b=R0kyubADpadLzdKZEoUBJxeTjaqSl77REgYoSozXakA3n6C3H0Cct07O mlCROrf406cjIEdT3i7u1s7J0y+OD/QSWxYkEZy+Uy1ZCwBl2MVNjDu7E k6maIM5o6JHZyoP728LjDIyynkE0/7ZCKPCcCSS+tVH/yIASWkzJxyTtT zX5pTsrr3hrbODfCW/D25+mMdigwQ7cNsgLndxSR4Vy38ElIU+ZDWO6F0 d8AxdmxMe00nywFC3ZC1kZPQnP/C3kvpivPKrd3VPhX6V8vdtvFTHZvgH 2r3VFndneL54AAW8DB02ikJyll8uSZlw+mLjLfstNvv3VaurBasqcz9Mh Q==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853907" 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:20 +0800 IronPort-SDR: ptmz/XGyQkYBt3k/m972mR8t32hT1LuHC9xeH7Xfloung2TA4MTRaUa0tHvWqIpUqygb1cVeZ2 ammuyOsOuhYxm019KxqTLY0FJrcZGPP2FxSLgVtTnc718WLO4YOW/zCC2rZWvudvoUZz/3OrLD sO6TUIpM8RwV0s5fESCPxcvf20Mf5lmQhmuO9i71ld57/LWFFveIkkxPThCJADb9zOXNAzmOi4 8EQeUqS55IkFI9zdG805pEcew0d8QJAAq0VgQ6VFmVkJ+TSeWshuOhR8XYpIpDev22TuWuFffL u/o= 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:54:48 -0700 IronPort-SDR: +ifl+ssGQMJo1793QyummmYdxHd3XzP9XbjKXn6B6L9A/71IfxQfpv8qYdarzpWEctk4Ql3WMW tPTK/6UQPkyog3HY7qay4dpVKeTmP5uIdnwjy4w1mx3YP2Y/toi1PbzB3aslZB5M04afc8o1z4 yZQbo9Y6NFNa+sXQ/Q+D/AMjunNqR24ybNaqHMPMmSEop2iGUVZ7PeH8+3OU/sv+eDng5CjLZz ga7rpWvmqRchNNkmOIEQBKIXfa2Mc8UQommU9tZ/kK5i+Hil+N15boStP09k/34t8fBi6p3L0m tHI= 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:18 -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 05/19] md: use __bio_add_page to add single page Date: Thu, 30 Mar 2023 03:43:47 -0700 Message-Id: <359e6d4d77ee175e2ce7c315a3176ca360e10fbc.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: rspam07 X-Rspamd-Queue-Id: 59A8140002 X-Rspam-User: X-Stat-Signature: f4hwtmgj1jthx7b1apbn3ge9gct698nc X-HE-Tag: 1680173061-222960 X-HE-Meta: U2FsdGVkX19VsOOzkMfXoHF/fZcfyA1VpFFxAKNePNfOZdL6A1hMbpFgCrp3k5oHnOxXzRTWT11eqwDYwwUndM0FGmGddVfvGqRkohLj13edGWqiS6bP3cgBD/dob2WG+p7ZdUK6dV2OgQwMOBBxy25t4+5EjGO4sKIFpBckHlZXc5XtvE6ktPzphI+lRJvCTeS6/aE1/q9uFVdKPz9PKfnc/Ez5DKKr5LLsLRAWrsBRTscjj2AO/WMX5KnmQBEDNs0u9FkVgSg3g8nvCimrQ7hKN62cLkelEh7zBljT8ILEy2LJbj0ZQ3fhrfw5UcZxZES9c5ZfrLsd4NS6f7315XGcctXF3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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 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 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 39e49e5d7182..e730c3627d00 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -958,7 +958,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; @@ -999,7 +999,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);