From patchwork Tue May 2 10:19:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13229068 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 5D8BDC7EE25 for ; Tue, 2 May 2023 15:38:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF65A6B00A3; Tue, 2 May 2023 11:38:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 885716B00A5; Tue, 2 May 2023 11:38:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DE6F6B00A9; Tue, 2 May 2023 11:38:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by kanga.kvack.org (Postfix) with ESMTP id E00B96B00A6 for ; Tue, 2 May 2023 11:38:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1683041887; x=1714577887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nHbKpL7Y+zm1E2hxTUANJxFynmRK+rVRHRUzVuIzNMk=; b=eKN91thW2ara4gSaGjUwEwWRU8JavGSWYtcGwVoieWq6raW9/2Vt/y4j a8c6jMpkZ0g332YacLExrQ7+b1jcKeWIumWHq7TIUYKZ0UaBnNll6EVZA 1AByllRDtFzrAqAyqtPmbLrrLRKghU/CzchX7y5sVE9d6UOv7u1K42Jb1 Fyugpwq7P00xq4pLaOoNJJ3O3gfFVs5BEIFAjfVwb0+lKTI4QH24cX4hc vBm7A8R8xc60s6yVsgUaQqNN1vEFiejA8QH1IyAu9PnWFdui1qbfYXzdU TuJTHqCFmN16ZV6VlbZCFR0BrEihHr1QlNth+dx20ePwXb/zsqqAPuGXU A==; X-IronPort-AV: E=Sophos;i="5.99,243,1677513600"; d="scan'208";a="234672852" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 02 May 2023 18:21:00 +0800 IronPort-SDR: 1uCOj8AsNyXUKhydi61ZX1RA7hzlbONVGCM7aohGm+2lN/PBQgT7YzPC9npvOeSzelAC6NhwdW JL1Z+omDHq7dv3+Hz9GbCEBPp8XnVjQUAvSQ8SkFI83/QbfVqkbNPvGrCb/jdPMnjVzbeXedKz sl4ZYhxTo+u5AZA7fIzLaJ+yKl6tn3gFhEaHfBKFGyD2UE7h/QtkilUK7gWtal98Wkp3W9zpHK OkWyKpmqCtUjF2dWYw2BIuAex5YRvTba35mcS507LNiFWS754LAJlyoQNwUzNe1zZOrRr6kNHa Sn0= 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; 02 May 2023 02:30:45 -0700 IronPort-SDR: hu84V3jZx46hwEraig0LXQQ9C8XpSBIO6XTGB9pDNLp7rKKsf6bia2072PkFMByCh+d0rCq+sR KzWze2bOJZtPKB78C8HCOcv8XZsO5wHBA97OXB8L0KqMYxhbKFaaAMyShVW48UEROyK3Qwdzly HE4mL8tAp1LxkPWrPNJ2lvmb2X2qj83N7UtkLiwo1J1LF/i9TU1XlJazkjqqJ7qmqzKklcUW39 z8BXZsyHk9r5ZiJReqNNG21+Q9+Vy+cFmuYsdmbMFTgnoYiX0FYOqz6+7Jxq8JAtFbCLRV59wL rfM= WDCIronportException: Internal Received: from myd008205.ad.shared (HELO localhost.localdomain) ([10.225.1.100]) by uls-op-cesaip02.wdc.com with ESMTP; 02 May 2023 03:20:54 -0700 From: Johannes Thumshirn To: "axboe @ kernel . dk" Cc: agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v5 05/20] md: use __bio_add_page to add single page Date: Tue, 2 May 2023 12:19:19 +0200 Message-Id: <20230502101934.24901-6-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502101934.24901-1-johannes.thumshirn@wdc.com> References: <20230502101934.24901-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 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 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 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);