From patchwork Wed Mar 29 17:05: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: 13192951 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 A7C1EC77B61 for ; Wed, 29 Mar 2023 17:06:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED60C6B0078; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5E8B900002; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C882A6B007E; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A16F96B0078 for ; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 816C7AC18F for ; Wed, 29 Mar 2023 17:06:29 +0000 (UTC) X-FDA: 80622564498.11.C505727 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 806541C0018 for ; Wed, 29 Mar 2023 17:06:27 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=T1fWwoaG; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109587; 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=XBVoGOaxFjX7F249TlpPBZ0ayzeIHnTslvlScVx5NcE=; b=zy97YMsGjiUF9m+mR7bq65oWeH0V7MIyLMJtz9EN0wcavIMETUjpeUt5lNlqoO84som3iB +IB28tegfO5LNPrgOznFQ+M0MEbHjihBq4ubVZ66EzdyIJZ7wu7C7Gu3KKUGnDT5eAIN9W J5cv6WAA+PyEiLUP+52ThAmWi40pmQU= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=T1fWwoaG; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109587; a=rsa-sha256; cv=none; b=Dri3Xe/wzkY0jWRqNCXJwcQ/KGfSGnS3fRQluPwLvgbt2oWGxynqm6Xsb/pXgL4ePlV6g2 x2dKW5kRu2m2PssETe/qe6JZ9zxAL7Oieb/ByoHOePCiipDg3yuYttTg8ZhuxNdFqmcIWu uEjRsk2V7bjALU9y61oKkjWPgeuzODY= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109587; x=1711645587; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=b2tfkQJHOoMo9xPMUAirVs15MwxpHItWsELh86gGl5g=; b=T1fWwoaGgBPETNaXBBMUA2zmRldhXq2nugPm+SjR9I4cUIdoBF7EH4oq VYBNlX2JgUb0fTSiyBbrp9UfynknhbvvUM8rJQkqg+QVqIr1muvUOxs8l D116NjjxGvEsq1c4z74meB5o+/f3NKnJYJ2g136FGxcOFllzY5MVapcHX x7d8WAExT3ZXOmwdNydXz+Y9pmw7UM2UO42zrR7pVTEevAQsVQDiukZuR 0WZMKmUFeyynQb9ktNrZaluPH9J4w1fJZwoH5pgTOSwRkXM54IifmHiby RJjrrHTw34dLM6Z8X2WBKAD+MYANZsJRe8wlyY5jQruU9eOCnVA99xYOm g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807010" 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 01:06:26 +0800 IronPort-SDR: Vc6WtQuI/zHTDp0LCrbdADaGwmqp1eT56StGm5+eGY0trm5C8ads6Eoe+Wn4g4IXuFhw8t+eFQ w37aiF1+/oN6+KkfDM7ujxjhRniRDbziYqsaj4EG1jIRAH/1+KSd+grDSA4SUt2+3ODJlGy274 7QIUzjDcBRhYk/XthV9OyfBoxKTctXDr1cF1dmBzygG12gsjmAwrLbWoHQ1Jrmcdkk+0aHz/FB 381LYU12IJYMQ2uKNHQU4PvFWV4TJ5eizdv+sxr4+geWOTov2x5ApSYD/ecXcA5ODT1HrIfIwj tHs= 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; 29 Mar 2023 09:22:36 -0700 IronPort-SDR: oN2UR0L9Ic/bC5ZlKdub2hL2B3WzSMNwWPaTts8Go9tRNUBzKiBjVMXtPb1MCBqH30XhfX5VFK r3o3y5lK4V0syF4FJkhuPmKVn0NSvYTqzCGIASu7aUGIjtgkWZfbeiTvlj5dp1GTJ+SAbWxEQ1 bH84aK1rLSnMEBKGsMwYaHXGhkfZPfTCuxZYs+HVziD2+k4Bdwtx3+/JcWFce+mApOYNcNV45r 3t5a5tYLJENitHpxBEddwdCKeyJVZy3OKiWBV7xOctdwFhAm4r3Z/fd+xkk6SD/0qdXQzGwmhy sn0= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:25 -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 Subject: [PATCH 02/19] drbd: use __bio_add_page to add page to bio Date: Wed, 29 Mar 2023 10:05:48 -0700 Message-Id: <87d0bf7d65cb7c64a0010524e5b39466f2b79870.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 806541C0018 X-Stat-Signature: 1pdacbxw877ozy7zdh9qa4y8ubzjmwy9 X-Rspam-User: X-HE-Tag: 1680109587-765351 X-HE-Meta: U2FsdGVkX1/frrmu9Dovl2obtXxcJAzox+VvEDmmy94lFkkMsRA8akZTHJH8OZpMWglsXE3Y4Mi2lPI3nobQszSfsZSSODsFQ8DUn2EtScyagqJCLVYQALwZOpMXwUD9DmwQ6gVKXn8XB0aAtw86+aVJnN4cqsXAd+lVbn0JXpxxS4GTUxv9OTeTKwn2YIgGq5opz30pOPh2xf/3MrS2h4EJDqSuFMMWCPVPdmdo1zKG7mZq7SsyBYAg5wM0qYzvA+RFGJ2GzOgBk3DBgNIRKEdfgTGuU1OVnFEgYCyrk048P7+Y481cJLevKE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4bEdS5kgdi/ 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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/drbd/drbd_bitmap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 289876ffbc31..c542dcf8c457 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1043,9 +1043,11 @@ 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 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->bi_private = ctx; bio->bi_end_io = drbd_bm_endio;