From patchwork Wed May 31 11:50:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262040 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 C222CC77B7A for ; Wed, 31 May 2023 11:51:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 424F26B0089; Wed, 31 May 2023 07:51:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D6146B008A; Wed, 31 May 2023 07:51:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29CCE8E0002; Wed, 31 May 2023 07:51:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1C0556B0089 for ; Wed, 31 May 2023 07:51:02 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DF4901602C5 for ; Wed, 31 May 2023 11:51:01 +0000 (UTC) X-FDA: 80850383922.13.0F8BADF Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf29.hostedemail.com (Postfix) with ESMTP id BC9AA120021 for ; Wed, 31 May 2023 11:50:59 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=CfblHkiB; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533859; a=rsa-sha256; cv=none; b=tk2loVH2/ieDxzQbHS30iqjA7w2BtkTSjznGJoovOR6yeTyJt3hYIHINdZhFIpvCPFjbtU Z6emQ4pKw/zrk6XMhFyu2HjCY+0hcfFcJ6SB27nCsYPjXYCS4q09p0apXHVhqjLURtvCLJ wZOjBuCl8kjAuOcpnDgUkvHUD3CgPiU= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=CfblHkiB; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533859; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AKDiQc5c5mMUE+M48Yw66vq1cPaHt+34Qu81mFVf1Zw=; b=5qolbU/22orj9a34Z5P6TsTMcUbnppCMDIvvWxmw8VmdQ6b6KSAWudzj9kw7MjpdHCMaBU 8ezHIJ/Q/H3b5vpd40CvrjkYKH7z9i1dp+AbjuKJvZCNz28tjhy7ntBeGnuTqwAZzol7+U A/LrtdRk9CmljacLUEJatout/wxNfB0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533859; x=1717069859; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UUIQkUbEvB2cbvY4f/6uCB2pRFVtewbvTxuQqfjccj0=; b=CfblHkiBv+05q6Z1DE+fUsOocAU1IVBUcIrh04CXYoFAQMIW8CEpem2H PBsbjynil8DNS4p/ApObfW9OHAoEwaIixL+zB2MFGiMotBhbk/9tGi/9E zoJuQ5KHdBqr/0KFcJpwvS7nnH+/hFj+C+C/Ujm40OFhvpBvmVGnNrRc3 TNV3Ns+FjMDIIZhPV36iDEPty+hsxeFOMWyz15lPBBm3d1rZzfdGpHdzK 8ScDl2qq8WENGoyDyhOJrJjUWcVcPAeqcQwtk2fMmyCDM8cM8aGn2tiEx agixTgEoCTVXv7HPQduhKKApGM5U82TX9MddHhI9QKC0EV6QDYgEWRp0I g==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207389" 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; 31 May 2023 19:50:58 +0800 IronPort-SDR: AYSZnHXgPYssx2yNjjs2mMBNZLz5YAkSIkH6H99BGVE+Xd/VYURODDjGYwCMsYsXWF6fZPsKdp HgGCvYDZUwYXGfqCzo0PMOjMdFoh5Biz6s2ob1wvJpBflTKlTIuDiTjUDkgujIiyfI69JoaKug mouPPb35Z7VolayxW/ke3Z2GuMuNJxxDUxsDOWhfEmf4ebfiZ8QQLlEm22b3bC+nciaUw0BH3f qai2SqoWSweh49XaE9Z3/NNUmXW9DdvNbQt/WJVS230e54hKVsSRX3ubO3oOjgjzeySjK2iBg+ 5fQ= 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; 31 May 2023 04:05:51 -0700 IronPort-SDR: 5fbhaGDbiXGkg8+3UI34SjKA36qN8yxQFYrOzNfKBiGqGFKkpSit1Ju10bDfGDplQIS0ftPTpQ fD8oNw24RMWU4g7VvkH7fNvddvkm6er01jVyMTVNOtHvSwsR9XJm3ab5VfUwyO9fCxhY/DdOpJ rVRoCbjgJZYRe1k4mgWw9zPuHFpUZXB47XYvnY9pZ9QXi/jP1EZfI0KyE55eH/ZOvARZ0NI1B/ I6tNjRTts0ONBuOq3LjKScjHSb4drUc9pfSOAP0cGx9F/5nOD0Px7pW/36RnXKCA79Pi9R6JLP x9c= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:50:56 -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 , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 02/20] drbd: use __bio_add_page to add page to bio Date: Wed, 31 May 2023 04:50:25 -0700 Message-Id: <435007afac14f3766455559059d21843771fae53.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: BC9AA120021 X-Stat-Signature: j9xwpjbuy5afoi99kin8fq89gb9hjri1 X-HE-Tag: 1685533859-817189 X-HE-Meta: U2FsdGVkX18/fuQlci7mdwn3Zy1sxIWfdoRam1mV74Cfhwmahu5twxa5uMRQbmHnNX1Oo1Paxm0wwWUIpbF/Hnz3rxZZ6EIUwBnEzhxnWXIX91YMITQABKEXX73TP9JKKGFkOYyjahUdm3XNw/Q3/8ckL8iPs40yERTm+fmLq1Ks9NUJ9a5k3N5ifSrwkb5uuhHv7+MUUJG4aWcCIL5Bv0DKvf5OVRv8gk/4bysym7yo57/hd7uPDA+OM0QgXXP3ZFkK/XHNYrYDLSeqviMXsHVMJhJH1u9DRB+3IGlM8K5u73ZTUe1PwjKXGRTXNbAmbVwabRY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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;