From patchwork Tue May 2 10:19:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13229066 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 CC79DC7EE26 for ; Tue, 2 May 2023 15:38:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 889276B00A8; Tue, 2 May 2023 11:38:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 837226B00A3; 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 577776B00A4; 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 24B0C6B00A3 for ; Tue, 2 May 2023 11:38:08 -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=1683041888; x=1714577888; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rBYMP1Pe8TwSmYGwoyghl6QR/JjrYRcvKJesaYzswP4=; b=D3Wnw6H2Qwst+f2OW5H6KJIainsBTN5O5iTmPvDxGLUTSodA1I6C6Lkt ZNlxU2yXxfWkngJEihxFP2o5DCj+mLLiNKERWytShBjFCb0m4Lgy9nb8I 2+q4YxJiPJ4PzJxeUaH1b+PkHizqIRJj971dzRRXthzbE4h06SCeTKGQv 9HkimXf/yXrH2P5zOloGI2IPfaOmTwGGmDkWWwu9Pj8vhK9L/XZ6HEm9G GiXoF3hViXNnSernFkMO2+5JeV5JvRuqd7pCJFV6D8pEFPQ6qlwgxI2Dp fDZaKy8ZjE69Pkm2Jj6Cgmm9MZ8L+mfts8eSAknHu88esV4i+kGYE18om g==; X-IronPort-AV: E=Sophos;i="5.99,243,1677513600"; d="scan'208";a="234672857" 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:02 +0800 IronPort-SDR: 9L9PWMp3/KLKmbIfO7alb3nunWHBad2ghr62R3KkxmLqFUZO0az4fYzkIzHbMlJEV47iU+5g43 68y9YaIOL0iR14muxMrlTT5aMzH5W7J0GKkT3f7GZXj+XQCzFQexo5Nsf39r5aP273jsPBYdWw NYcHwkyPFUJ8OJNGY4Lm17E2aBoLhB31Ef0aMZwsmOxU1FoBf0/uA0F8KBtX2ML8IFPBadkBPm dlXt6SsblwAW5QaTEP2RWvWsstuv5RgHMIEuWgImTjnUs4XGfiD/EkPpavey34k0JloEYeLHX1 tqY= 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:50 -0700 IronPort-SDR: SZmZ1SHPv3v95++GFX5GNI6yfBnql83s333Ffj/oLNOQmf9D8iy/39hpJOR20wh2bRQOn2BLgx JgK8optZpMM29mBuHDuYbtPMvrfJzCOPOjU1ETAscqM/qXxlIOLWAiI2L9V4G24RfZiHJtRFwb nHkwAJfuiGHAeRk1K8JkyFhVzb1twO5S5KKCSXFwkpHiNNZYu9hoApYEuIS5MMXDA41EViqm6d CXVhoNk5GYQRyxsfvtCIIoju6VaQTS+kujPXNp1hy/QiGKYe0KkAqZ3LX7HI48Z5fruOSDEpAU 8cs= 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:59 -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 06/20] md: raid5-log: use __bio_add_page to add single page Date: Tue, 2 May 2023 12:19:20 +0200 Message-Id: <20230502101934.24901-7-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 raid5 log metadata submission 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 --- drivers/md/raid5-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 46182b955aef..852b265c5db4 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -792,7 +792,7 @@ static struct r5l_io_unit *r5l_new_meta(struct r5l_log *log) io->current_bio = r5l_bio_alloc(log); io->current_bio->bi_end_io = r5l_log_endio; io->current_bio->bi_private = io; - bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); + __bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); r5_reserve_log_entry(log, io);