From patchwork Tue May 30 15:49:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260592 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 44143C77B7A for ; Tue, 30 May 2023 15:50:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232443AbjE3PuB (ORCPT ); Tue, 30 May 2023 11:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232493AbjE3Ptn (ORCPT ); Tue, 30 May 2023 11:49:43 -0400 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E2A3E8; Tue, 30 May 2023 08:49:39 -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=1685461779; x=1716997779; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UUIQkUbEvB2cbvY4f/6uCB2pRFVtewbvTxuQqfjccj0=; b=SfoPf5otv26oVOwnNPa60YerJICm11qq0xfGRZ+IfSYL+QwGHPjS6Iw/ ibhW/d8aApmaAAybHLogeMrgyAOjTsgjPksHkwl41PGeZkNqN9md2c0G9 NwLWa6T1MDLmZ2b+/xVgjbensq/Nl3ScLv7ycFxIsxDirf4CHnmbPppmk z0ShuvLvZXweG60OIQGliHDIRCPWSI0heDhoXX0wVX9469eNd7QF5xJJG 7CSkJIiKfv8ZDdGAUb8e8IdjuoniQP0YKbn1p/O0+c7mBNEPndurbkuKE qhAJkytYFrv0i2A1/UfMh5LfpunezyYK46hzRNJafT0/9sRtZLytKozmf Q==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129744" 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 May 2023 23:49:38 +0800 IronPort-SDR: ZmvKuexgVBbuxJRt0SLuyepXOzHPZ+6OtlcXDkgIveTGJBN4Jxa5NJQWj//lD2aNgfDZujH01t hpajlyjLGCVorzMBsOI/7RXZWehiLUOoF+SDYEoZizgSDTN0w11HcxLrvFDo1djNtc8ePKw6p1 Uns1yjWl51iqOMMsKBfXdzDqMyyZAp6w/3E/IxjVeGQNGZz70LsmQ2dEntM2Km1FYX7aFC5k3t rL9WUBhA6kMz1lMxji8T6Og2+oEmNucl3tA1xeFF3V4vs633NkQO1RTf65QtihS+6SGba6ABfo ZoE= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:31 -0700 IronPort-SDR: yyyyMz2TAyAtxiGu5+SWb7d/x9PogCVD4itlH+FOZL5M/obbujzn0nPyfJX5f76wmH56HSlR9F zkurIL57b/oE5ItIAM3mh+0TCxwpK0Osc0l70ZtbuGZDq2Rs1n51DtbbNViftHEWLZ73mey9zy 2cUmbpQh/Z5J5zOcjj/YTd3YK2PiCTKftG8A1EENSystxnnFIuMK7Oe+UZdJx94whGX4awAqm2 /U8JBrcdaMvSOP4HNMkLK5PxyRVKrvl3XxjQW8zcaD6MbGJ9RpKug8LVrI9FIoeuVVWNz6eSxF 8ic= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49:32 -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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 02/20] drbd: use __bio_add_page to add page to bio Date: Tue, 30 May 2023 08:49:05 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org The drbd code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/block/drbd/drbd_bitmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 6ac8c54b44c7..85ca000a0564 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1043,9 +1043,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO, &drbd_md_io_bio_set); bio->bi_iter.bi_sector = on_disk_sector; - /* bio_add_page of a single page to an empty bio will always succeed, - * according to api. Do we want to assert that? */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); bio->bi_private = ctx; bio->bi_end_io = drbd_bm_endio;