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: 13260549 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 E1751C77B7A for ; Tue, 30 May 2023 15:49:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65EB1900002; Tue, 30 May 2023 11:49:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60EA9900005; Tue, 30 May 2023 11:49:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4879E900002; Tue, 30 May 2023 11:49:39 -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 2E2B8900005 for ; Tue, 30 May 2023 11:49:39 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E89441C6FA4 for ; Tue, 30 May 2023 15:49:38 +0000 (UTC) X-FDA: 80847356436.14.57B0304 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf02.hostedemail.com (Postfix) with ESMTP id CDC7F80020 for ; Tue, 30 May 2023 15:49:36 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aoHjwiFI; spf=pass (imf02.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=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=1685461777; 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=RkxMMjbLFnLbZ9i6d8wkHgzwvwHI9JVX4skU36LxLeSnMtU3j5/Js1wPZmicXJo0lrJVzO kq4zUFaXAbzKi2zZSecM5A8J7Cj9Y5A5gnwfZ6k7L0Nif872MV2lDHt3x2Eo4iiCD7aAJR 5W5vHUuXLf4UPiroes35WKgIzF7gMwI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461777; a=rsa-sha256; cv=none; b=yvEMEKvy+DE5SupKNuB2PgQdND2OVNDwGMnsNMP0GAP+iHsRtmxa0VdNkjHZx30FKt4stU HHesUd9ow5n1H8iUKLBx72iId97pk3G1Pd6isjWn0uKM1cQYFPpaLiD/LcPByHmwM3aNQe W9YKEGeYr6KTNKQb+PTLAIQrfkEUQuA= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aoHjwiFI; spf=pass (imf02.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461776; x=1716997776; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UUIQkUbEvB2cbvY4f/6uCB2pRFVtewbvTxuQqfjccj0=; b=aoHjwiFIRU4Mna08NyP+F/h0U21q3vXJ54pqa1Hqqrdfim1qG0x7lseP 6mjnGhpPglqLvD3vdk26QwoyVj+armKic3wLGBDSe9kEdqoMsKKyYzSWV HQIj+/TGuhBlnDkw2oCVlr/kaeeAspx1MfR/Ozba1s7hziMFWJK049B9j 2TmJGCY8gwQyCRd7AJOVvN6LwB35jUHGt2c75V3Yv8moi+HF7KGOb2NLr 9XDIljkB3RTcGfJ9zGgCqzT/qNIw1M4fopRbJAOt/q1HET5tbIz/AgOBF dGG9lYduY+Vyu6feIPlkGtBLb2Lq2V1XZJHlDnnFTO9tp2x7Gsg2xBUGc w==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129734" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:35 +0800 IronPort-SDR: j+GZZncwHIw+Ff/0OpmkKsg+58/dR3l3Ebsc1YgIAtU6FOlgpDCWTQ9LM6HmZATEnNWxjj1ZsD N93IsCvon87u+74opJ7K0it2tMV1hX07CAZpu2Y9XuLBnUtxTWLzIsFanscjeHA+SeIe0mjgpa +MyBSL2MITAjoBlA4WNEV2DbfdJsv1gt6tz9OwwiEA+Teo2Sa3qhcWpSqaNb4wWLfGjgpvt0S5 HZhOAb8jzB5wcot7UUYzbQ/b/NhUSeNe9elrnUfIm5jCEA+qfGnfQEXH3nq/PqUVJ43uB5iqwL o54= 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; 30 May 2023 07:58:47 -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 X-Rspamd-Queue-Id: CDC7F80020 X-Rspam-User: X-Stat-Signature: yek1xhepc8a16dqyfwg4tbnaoc895z44 X-Rspamd-Server: rspam03 X-HE-Tag: 1685461776-539655 X-HE-Meta: U2FsdGVkX1/eI8JQVuBehk/xKYLld+VQKxHqMpKv/L9NOZ2z2O/++yl3I+VkCD7fryoebs/7hajlPAsp/UfPQP4FU9pFVZvfPpEC51JAjZCvKvjF/iv7GbHvfvxDJE6KXY34yBpJNK0K96klCVa0r+nntrigseqthX42um5YPHdezWLz3TAVsr0z3Djbz01iM7dC6z5FqMjLGObrzJvqCHDe7z6maPyC4j71RCZq2u/6VxKNSKJenfBIXzkIOvvGxt1Umn5h9heDmrB60zVKfDPLy360o/pXsCcJu1K/f8Wff+xwC4c/DNktteaKFc7U1GNehW7O9GHszVYtXAMSHMpouYZTdvVrzn7NZ4hOUHJh5zhCqFh923zgXryja6Get4GRmiSeSixdea/Q2d5T4tMxxqp9mlaUcapNsbEGlEvXosjwZU/XNkdlvMEmuoFNcVIJJoAv7dwijDwyQ+IAqf+MfGL/vHmfZ+w9wJWYuYThH5gt1/dh5w6foGJbKrzIl5sfvvBThCBKdlxSzr8zYSLTlhH5Y3lTa89PRLR37oxtJKuKSwVjmhIZLtwHsEuTnxSDh0IOjNrN78FAQrzOlcCPdKjkMRjR7MWb3+QBYktMrj/TWP5v5BL/b5TLvUml9zRXv0uUpIo0Mb/3fSNej0aIU/bFLYOQXfbUfTVfZ110vMhg2HPI2UIXjf4cPZz0ctfP9NDHEz9GCbCiHSfqL0rQx6MP7CgxfeSrBfyGsDh8hJxUUZ5mjRUSRWMqmmWnc3nOnMiPObOerkzII/VS00K0UFxth350kS4ysSl3XL2AM3NT2VjDlaCCngv5JBh04+IHCrKSHOE4u5psyXzoA+vb8Q0jc496XNsQG85MTgwEgDXfIVvZJNXixwLG0CBbR1hGWSsWVqw/7MHqVL6EicwqIqWeEApqx0ndthIw/mU+GyKyKQ9W9hpu3kr/ML6t90AS50o7C0CWtqmew4q pO3TczB2 /W048r5+ni9lkvud/7oyYZ7nigxSSuoWc7yEsfF4zgS/fzjvqkQSGIPw3Va/clNAA1RlpdcA+FgodjIYv7GlqwACNfVe8GgnCLx4ROQTUYKivpEHZY4/bXlsFqEESwJB7eSRBT893eDX5hCYecMS2pgLrtiJVyxkDUQDTQJUVStnlLueMHAmQK8rPbrrgOKkJN7ibRDfbjSKmWdGIovWfstv3VtauC7Boldo/FQCKnhqQVr4gmfTPsO36QzflJkw9iu+/hePj2v1yfhUDsyUol0RO0MuMxIIM5/zcZpbwlzzos7TDyuvUMD8udaehpLT1E5k9TvDrSUhb64Fgbjv/Hna7qxpWNTV3SYTDtyI3Si3rFFxvFsg7stUP6GFaHRa6omwWdk+1Dji/nNBroflnjGDS1A== 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;