From patchwork Thu Mar 30 10:43:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193885 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 20BCEC6FD1D for ; Thu, 30 Mar 2023 10:46:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231270AbjC3KqI (ORCPT ); Thu, 30 Mar 2023 06:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbjC3KpT (ORCPT ); Thu, 30 Mar 2023 06:45:19 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BC9D86B4; Thu, 30 Mar 2023 03:44:56 -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=1680173096; x=1711709096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Kw/gd8mi4cp3C+0+JmkC18fkS8wJMSIrrh7WtKkZNvs=; b=ZO7bQcqFZlTxhjHpBb1YdUsdPFShgOLUZfgwMKoWDTAlkJCYtaxHG1cz m58HPiprakXtOLt1ncCHcErC24G4+doEwPM/cErLtgiZofryT/Vjibiev 7IocoC9fFXAFmZj4o8UeCfnSPHMRgx5fG46eJ+J1B8mFB536kdTL3w6go YiQOsf18GYn2RbXuPe0Z5SeLlaudHT+5a8t9DaA8yosHwk7SMBpyWo+lZ lbqYUWTs6V3Tsw17LGwtffAasBm6+d5le70Mk2BRffyB2tdQnb3FNi8/p DgpMKYqixv1rNfFo0SIzn72+0rTjRip8rYmbAZ+4RvWBaKpViFVQ1eP7F w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="331317836" 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 18:44:23 +0800 IronPort-SDR: zWrmNslAH9mXoPhIO1nfSD3+TZtK6ONNAgznD4vQvxcbBoSrT958ozDl5DBkXLOlSZlfkM+QWQ LpClT/e19GiIuAFN3jGrm8WbKg0srCBIDAotrSZcHJw0xOqQxVMD664iPNnvEfCE/yECHzOs/B TWT4j6CYcY3+u3QadLCLF2gIligJS91KoDBO7TSW2w4LY0DzOvTJH6gFgtWDpNkaCJjDP7VlnG /DRylOyYWB2s/hzTTNmDHTe1Sn1paZXD6qHPsBu40tqcN5iC5v78pHECWL/B0h7UwsYNDTpD0/ dAY= 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; 30 Mar 2023 03:00:31 -0700 IronPort-SDR: V9njnv+t+GuKggx1vZa0T1MyyD/4iSSXEJKOary+Bq17fidU3Wq1CXNYZJCw9uLZGgQvn++tes OUuz4YBad4EEj5SCwfzseRk61pTGeIXQTJ8sWWZ6C/a6IojWDHpOIMFR1kBlWwqA9+1RZimaU2 9ugMrtf5vwEtfAfHMV1SAmH0gL4ClOl0L1H4690JPAzrH+EYrtPzKQsIBiaqdN4IhpHVhohUHn t7AtVhCoScM7RNoNSFn3XL939XSpDOx7ZCfy1+MZ2oQUID6IQmdyOsZrB+CvmCXJX8/vdquFwu xWc= 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:21 -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 06/19] md: raid5-log: use __bio_add_page to add single page Date: Thu, 30 Mar 2023 03:43:48 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- 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);