From patchwork Wed Mar 29 17:05:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192998 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95F82C77B6D for ; Wed, 29 Mar 2023 17:07:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231310AbjC2RHF (ORCPT ); Wed, 29 Mar 2023 13:07:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231228AbjC2RGw (ORCPT ); Wed, 29 Mar 2023 13:06:52 -0400 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CBA66192; Wed, 29 Mar 2023 10:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109595; x=1711645595; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z0WRD7PSxT1MI9gFHxfmzZuO828C1XYh8k3AzLzoH+A=; b=NpfBoHuL3XAkv8dI3dL+X0d02PMW6pMsMfIphw0BUZ58DzwzqVpYUBYY JbRNT2eMyKj4ENdkLOwb7oOoVrwSb2kw/E6fe2JdlGhJMVGShb0nbxxXB 26VYoFETtND2fMUbFWUDDYDI4HGvUCVaYGfAfCOAD7vKHM9dq2H6CgMus MDKROKsIfdi0nFHwMesbFzMzZ8RnmRj+V6lyP0yzJ0taVMgzg+cGBS5A0 LhbgORjH2NfeN+jg4+oQLBw86JnoOfFKHQpQM+hE/fcdi4C4XpQrSN5NO N03ZBXE/UjdvlMLw/CxwjYvvkvcK9InjU8yr+hy61TzHCTAd/479nV1E5 Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="225092841" 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:06:35 +0800 IronPort-SDR: kBJgDeAosX9OqpK+VGPPTvqBehG9cSaSxeN2O20R5WxOQl7R2XwbVuUfSp4sBkhO4LGK4iWU1x s50zcAJrFLYmlbQJz1MIXutBN2BXw5QDDcFpW1d/6oUaN4kLZuP08+1nOp84VIGXr7vzlF+8oS lg+Wacx4z85omgq8JJc2+be6hV3q3Tj7WCmR8ErnPohdCz4YtHje7E/2Ocyv7LgmwQqUH1+UBq jTp8/L2F8hrJTdtMXnOyHPNgILVObTke7sGDQD8dsq3kq7F/CWfLZQ+4nS2GSg1rHVC+AAHB2J MUM= 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:22:44 -0700 IronPort-SDR: LCzDjMY5FJ5sr8pIsHJapmUnHR/HrhUl79JV22sYdEO2rzY0+ynCU/VuOjv7ZALoaIA05uNHnA KLRyUMuwlt12IwC+VHi4otXGnYicO4UmHegZ9Kplvajn0f/LaNS4Vr15N4xbFpRBJEti4HjRX1 Bvit1PEiowY0ep8DeA0czhvEoDRP3Kll86DnbETpHg8w4X4G9iHJmSKb1l58xWudqk0JK6OIZ/ BvTjCmaxL3mPyUI1B6gKVzuL8y2j4E/ZHPehNYyHvH3JipeuiATzGUF76GOIcEtetNffS4rAKx brQ= 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:06:34 -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 05/19] md: use __bio_add_page to add single page Date: Wed, 29 Mar 2023 10:05:51 -0700 Message-Id: <55ec6659d861fd13e8e4f46d3e5a7fbad07e3721.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org 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 --- 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);