From patchwork Tue May 2 10:19:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13229064 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 DA21DC7EE31 for ; Tue, 2 May 2023 15:38:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E17246B00A7; Tue, 2 May 2023 11:38:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D19AE6B00A3; Tue, 2 May 2023 11:38:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B6AE06B00A4; Tue, 2 May 2023 11:38:07 -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 804BA6B00A1 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=DAUXXvncb57Ca5Ysqy4K5WgFviHvSEfqduS77WKLrRc=; b=LcXj0nHtevwEQb702BUBC4a/YDc/6py5EATOy72uFNIsxF0MJY0F1fbk MTKRmdr8D5yagUD6B8VpavkybD1h91z5ACCNqu8oauiOzVIAZGf/pFHKE 8/QMKtyBN+1Yr2LcpjinZnW4o/lgLkRTuSa9WPkkCuSf2TD7WPjq4arpA 6y5QoBqY44VbHgIn9H3HILdnGCjRFYpqTmiExDDexRs2c/LDj5ZrmW7em Xf1XcllsIf2XmY3tnzfoc2do0qv5/x4nJDrU8J2pIyO7Fjja7HgKJsd/0 jlZqOMvN5wd9WxHAC13yXZHcrGMKZw+Vl+XU1F0jZW8tobS889zlKHoyg g==; X-IronPort-AV: E=Sophos;i="5.99,243,1677513600"; d="scan'208";a="234672822" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 02 May 2023 18:20:44 +0800 IronPort-SDR: ckd52TKh0wmtRzfjjaQuuHAhsRSo93EGV0Bkc3rRkdhf2+R1g4nPOewPhtozC3UmnW79kHI1mg AnYMzGwPMu7N6xAwV08eJM6IkwPpbUS7hYsA0cbBG6FyRbKjbc66NkSrnxUQDxXxe4EeyOYWUz GXOuZbR5kas3e4qtQctumFLtDx4sRfcid7AZuYPp3L14HIzWMi8gW11WFI8g/It0ZgoRpLOeW9 BzRZ23OQL86clWyTw2VZkhKv0e0PINVwRUuI8buIsfRecnO2kDPtz2K6WWOxgyTa2Hc/KvWcrv EpA= 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:32 -0700 IronPort-SDR: 9dAoasd2kUMB9NDuUlrxf2LKGQXNbe7IcqE125G1znIBmvFKRi1+XoITUsIN9ND9OAtiPxTMbd hksUv+zcUrnVuAoUVGO2049xfknTS8aM5hmEWzvj8WhmmTEXP0n/lftv6HNELCgJiPz5gQczyl jSeLS39egvZ6QJ+taxzDgX4dDqXFI5XQUhVg1LiOWyxVbmVWvI6hTsCCj0zcHEW+RxhAj2/6P4 4ouCUXL168ncCOMo7EVwzrHUnj7EWo9bkFcQfzMoq8SDN7OCFeSa+F3X1vyKgUhvKXTrNUP+wD 2eM= 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:41 -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 02/20] drbd: use __bio_add_page to add page to bio Date: Tue, 2 May 2023 12:19:16 +0200 Message-Id: <20230502101934.24901-3-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 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;