From patchwork Thu Mar 30 10:43:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193860 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 00234C6FD1D for ; Thu, 30 Mar 2023 10:44:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9BF706B0074; Thu, 30 Mar 2023 06:44:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 96FD2900002; Thu, 30 Mar 2023 06:44:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 811326B0078; Thu, 30 Mar 2023 06:44:12 -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 71DFC6B0074 for ; Thu, 30 Mar 2023 06:44:12 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4715D1C60F9 for ; Thu, 30 Mar 2023 10:44:12 +0000 (UTC) X-FDA: 80625229944.01.6173E33 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf24.hostedemail.com (Postfix) with ESMTP id 32BAE18000D for ; Thu, 30 Mar 2023 10:44:09 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=jUwhR2oN; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf24.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173050; 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=fBgtsJyXk0EAT3J0eSAFsyV+pbYcdx/VRqTHS9gHVxo=; b=msEmroU2A8PSjkaJRQ1WBotcqW+bHqzKRZlZnFm/mItx+9ybQMapdU4vinX2nBy1YAdzC/ 96qgYN+6vBWENZ+STpqbdamZhJDufn8jHyU2gbgvmJQOoH3+7DbU1MfjMgXprPiaxOTnki UxjDqdgq/7DPazHFQqRWeecT0nw3vGQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=jUwhR2oN; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf24.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173050; a=rsa-sha256; cv=none; b=8q+yWwZD160rHBT7vn60HB/lY31iaGUfPLodEZH68oM2qlhCy5ciI7GVMU8wErKN1Znu8v aY8Y4xAJmj8UqNbQGXfa0WjZJbxr1K+78sQQyiBwnMVNRCRh1CcE3tnrOw5iOEFhMlOJea SYwHbBwYrp2R+GKKWL+5M1c9zJXL3JA= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173050; x=1711709050; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MeMNKZaQHr+yr8lVVtTFZ83iufEDICJEVqW1zFBrgYk=; b=jUwhR2oNjBmyaBZoHl8QVueIkwRGpup7i16yYMPeHW+oH5a2Yj5IGGzW fcjQ5SSryDcEGyEy/woSCNf6dZXc6RjDhtTDULlx9yB5kvwal5fYpy0Rf x4WeY2TD4JXbKwPqdLigU6nnlR5sjBuN56IicAqUnUOlM67BctBX0SEBd j09GVUsN3c/hjjnY2nD/DZNEGIdkkl44oG6wl7yGOP5ubc36mqlYMw3gY AIak+zBryx+7heL23V16CVSnkDcuTFJlEtM2KPMVqYTAKSEssvqX5LQMr Zm9M4tq2BKyLVxJmvqZhl3fyYs21XZ3L/550dNnMhpwM9WjdZtOwktAGu A==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853884" 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; 30 Mar 2023 18:44:09 +0800 IronPort-SDR: nXNWbhcjRaVLSPPddwrx61jSTqKIemPcLveEhmrJdXQUAuHAC0JD2wEHcoAYsdZjMdZSM8pgId BKAk5xaHzEET/HPaXHhVidNtgt3lT36vezMtLQFTvM9duYkE/JotOxYhm06Wrba8XD98ZabDYU PVZEfYPWm7Xx3aiJ5GWgs4ILC+FzAiT9sklaRlokKzThMhjl8A06y6EejyKSgVIVUgLvLXiqxT r/A7WC5xnUYy5IJ+/7bWMWmnU5hpk1ql9QRrHR9p7v8+g23yngeWUWcb17kOsmbUvuD53e3t03 /nI= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:36 -0700 IronPort-SDR: irX6OTnvg9dw1UMM/jf7hWOL5xe43IpHWVi+biFSVu6y2d/gmChxKlBzDVHMcPFGp/PtB7lqMk pBd6N7vcJjZegk2VaDw0/5ijey8D+sko6yUo9ep1HredzXQL3kXwoHvQPgPQwgLytjM1orqSW7 qft4pnKuKQ2O3XfxcS2iqqLj68WmBpFjU48f2PwSRkyTtwxu5wYQn3fHIka8vzMjRF5aE80zL8 5pWdl7OIVMeXoW6bPQzgsDJLAEL2hVYT6WjK3Ym27QSIeOu/Mm/2i/OBfOoisD6h4Rm1EKjgoI tzE= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:06 -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 , Damien Le Moal Subject: [PATCH v2 01/19] swap: use __bio_add_page to add page to bio Date: Thu, 30 Mar 2023 03:43:43 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 32BAE18000D X-Stat-Signature: tpzp68w8b4kwpuon7ap55xcdqjjdgzh5 X-HE-Tag: 1680173049-449990 X-HE-Meta: U2FsdGVkX1/lviz6A6nuwF33aJ186jMfboWZjZjHAqaFeJYbpLGsqILslcebREJuKVmRW3pmGhdxmxq+UmOsPEX30Ozv+KyWlVF7+hz7b8qpt9BL0dvDsMIXg5Ec2O/qEeHj2BhghQwHOLrxLAFKfW2eujxhQUwetQdyIHPMKlFtKTtLh2Q9/ABJU0p7kaeNYoezUciHs1nhwhi/LrHyNiTmho1zN8f7t2BwYRpICdRJFJ4ZgduzjBhnh04CTqmH3imz4eIHGw2QWn7VBe0qE1FB0w+ai5DINqYa6PuP+tJW/CqxZoHYByTcPxbdPYQHjVf3U+OEa5xqdZ4zReC4NMmkotY3Y/TmRzT/4Xr9d84tfsxjfdo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2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The swap 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 --- mm/page_io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 87b682d18850..684cd3c7b59b 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -338,7 +338,7 @@ static void swap_writepage_bdev_sync(struct page *page, bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc)); bio.bi_iter.bi_sector = swap_page_sector(page); - bio_add_page(&bio, page, thp_size(page), 0); + __bio_add_page(&bio, page, thp_size(page), 0); bio_associate_blkg_from_page(&bio, page); count_swpout_vm_event(page); @@ -360,7 +360,7 @@ static void swap_writepage_bdev_async(struct page *page, GFP_NOIO); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_write; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); bio_associate_blkg_from_page(bio, page); count_swpout_vm_event(page); @@ -468,7 +468,7 @@ static void swap_readpage_bdev_sync(struct page *page, bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_READ); bio.bi_iter.bi_sector = swap_page_sector(page); - bio_add_page(&bio, page, thp_size(page), 0); + __bio_add_page(&bio, page, thp_size(page), 0); /* * Keep this task valid during swap readpage because the oom killer may * attempt to access it in the page fault retry time check. @@ -488,7 +488,7 @@ static void swap_readpage_bdev_async(struct page *page, bio = bio_alloc(sis->bdev, 1, REQ_OP_READ, GFP_KERNEL); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_read; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); count_vm_event(PSWPIN); submit_bio(bio); } From patchwork Thu Mar 30 10:43:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193861 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 83E08C761A6 for ; Thu, 30 Mar 2023 10:44:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0709F900003; Thu, 30 Mar 2023 06:44:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 020A3900002; Thu, 30 Mar 2023 06:44:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDD07900003; Thu, 30 Mar 2023 06:44:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id CF324900002 for ; Thu, 30 Mar 2023 06:44:15 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8E68C120882 for ; Thu, 30 Mar 2023 10:44:15 +0000 (UTC) X-FDA: 80625230070.25.80B15AC Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf24.hostedemail.com (Postfix) with ESMTP id 711AE18000D for ; Thu, 30 Mar 2023 10:44:13 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=q5fWOifU; spf=pass (imf24.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173053; 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=Qg/Z4HsvCeaPa6Cba5WAwCsrSCFAhIpWvpzK/p/YtJo=; b=t6ue2M0uTH0tA6QOwv8AFEgU+ecAIKoDV/ghOxA0X1XAd2YmvfB8J6sXxiCcvsTo39f1oR X+doHNa8YYOvQLWFoGOFx6Ipc2X13VA3uSUzZ9tL57QSOMKdCgCrspyQhExwjvKGQilYWU wvsU9k+5jcf30EoMJoj99/PXJDFuHfc= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=q5fWOifU; spf=pass (imf24.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173053; a=rsa-sha256; cv=none; b=Cz/Cp4Ze6lmF4oZrXaO+JAXpPT3Nq7O5yhca4UF1zm9XL0uoryfQolcS6+XSzY1MxjG30Q yxeomKpn2lHoIURf2G3gxHtKhaH6GLuJon8Lq5QL41IFOv/dttQtG9x3aiZ1balRI0KMzY yx01hzdJQlyvyXDMafRG4IP8wboq+4Y= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173053; x=1711709053; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L3cfRA2wikfkIsf3C8GxTLr6ByhKgTx7ps7OwYMzkj4=; b=q5fWOifUX2EhOfNPlDP8n3Mrngs8gQRKuZqgb0GYUIbdczF4nikjSSsE L/YO2Jan1SCJ8XgMbNvD3leun4QRhfL7PoEAzcE+AvsHtzd7citbUuR/u m1yCQ+ZN8GdtA+D5eWV4bLjJqYBjqBuJBi18bimpqx4hphr3sK01UuCT9 HRsJYKkJsc7rxihMbOYinPka6/8a2VlwsJpuKgKoKVLfKrf7378hXS1X+ VzGFW2b9ZP4dAbgPFbYnCJ+vhyhqJCrK7s1xhlK44gBgQT7mCVwvoq8ka b/t/qLWm9IhBgx5UsysJ3bCD86XSuagD/low8DQYPyYM9Yuc8WYp+08D2 g==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853891" 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; 30 Mar 2023 18:44:12 +0800 IronPort-SDR: z7173R0lwoZZWU5jPBTQ8PqQ1menm8WwP9B8wx2bSxZzh/hewV3cMYWwdegZcHijI7TrW1d8sO MC2BlUCYoa5hpFSDML9jknz7Zb+LqOhfARVlGIJ+4Z7Ew2lNosmbw+ecScZv051Ij5MNX58f4Z 8z9bys6OwshuM0s1VTlRsYGPOFPjn2xNRu1RREg6pI5XZu/I8+CvHIjCfJ/fpWUhMhwtktIh7B rmXIOex9AOgB475VcKhBK4m8zXjgbnGPiHIkLWZ6UwvbCWu3YoZld8w5BAFMBDc7w2fbviMyav RG8= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:39 -0700 IronPort-SDR: RehRzaThR0hc37wNjqkltJ+dfO/hlRGJetFrnAX1UOANVz9k5ZIJ+kSDt8opKJGJOwIrFyEeZk TwtDv9Huypg0wYz4dm/8NDnvwLaqh3eVfRvAkWkT6VvIVHouxmJ9cojW5aiBrZ2cuUyar8GmxH pM7pZBufBx/ouszcaAOPMBaDxfOwlbo6DAOIZUQEsZdRgiXOJyXcbpTXXM52G8GbwuePmG9tD7 6CT3hnKgyfR15tAPquXFKRiXeuWuTEb6OxiN0Sdo2XMa4aDdkQ/G6vt9d7MC/I6z4RZ/z+UW9i T4A= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:09 -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 , Damien Le Moal Subject: [PATCH v2 02/19] drbd: use __bio_add_page to add page to bio Date: Thu, 30 Mar 2023 03:43:44 -0700 Message-Id: <01716d15d92c2dc01607b0491199d7a4ad3fced9.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 711AE18000D X-Stat-Signature: piwmcd3f6pzt4tiqarkgjsadswp6gctn X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1680173053-987612 X-HE-Meta: U2FsdGVkX19B39wLruuET8IHtLbxbdJVTMnxeSUUDT5zsFJpYk1/FRkB7E7LjYJ1bXQf0bgNUYPimqO6oth3OCHs3L0QgJ7ohnK563p/MA4LdJFXwMFCgpB0NohYx9CVNLEQxkS3lBULMkJ6hY1PlzuygwNzyiA+dfejCFb+ip+fvsIaNc+WV3zCNB6tYGDQ3D2iZVcbxMUbB7RxBIju9veGkUQIWK5XImaYDCeqdlVPuJg+e+8uX1Jy8QbhJMTFt68X8VBRNPm8c2yeilrTi3YoiSiKJgpC7qrsaYmQwv4ye2umIaE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eP15pEuayxDBs9PLJ3otmm7O 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 | 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 289876ffbc31..050154eb963d 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; From patchwork Thu Mar 30 10:43:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193862 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 53760C761A6 for ; Thu, 30 Mar 2023 10:44:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B6CB8900004; Thu, 30 Mar 2023 06:44:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B1D02900002; Thu, 30 Mar 2023 06:44:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BE16900004; Thu, 30 Mar 2023 06:44:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8C45C900002 for ; Thu, 30 Mar 2023 06:44:19 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 693A51A07CC for ; Thu, 30 Mar 2023 10:44:19 +0000 (UTC) X-FDA: 80625230238.20.F8F42BF Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf27.hostedemail.com (Postfix) with ESMTP id 0DB754000B for ; Thu, 30 Mar 2023 10:44:16 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=WgbQE63F; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173057; 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=AUXGgNT6cs6FilIOLXof8jwittuzkqjgm4UW4TirO18=; b=p1EG6xDh9QFK08N+Q/JvJWIcaU/O45Puf5ImQArmCCc3yqyjwME7t7FdSKhlg1GxAiYcPr BxA7OBJXBQiD7FzYzssOK9jILz0nULmtvSNiC86cj8iaVVeK8stK8J3puPrida9ZJEmEKQ TqK7ddtkHBefhL9GINCPwf5LsBMz5ro= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=WgbQE63F; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173057; a=rsa-sha256; cv=none; b=cMuI/t0w+nUO+iraWHZKduO59ES0mkS+Cwb5lAiZjiDAxpMSaBzf4Z3t2tttRyngKpGf8o n3dLgHe5x7mixWY1GasiZfLpdAI7DIyGMiWhAPOvQ93BUZChMUaMiY+NINYlGgdBoEUb/n X6rCGzK42NBb9YEOP1wBK+rqayHGoiw= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173057; x=1711709057; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BUmURHFdu9KejVTyXSm50CHGFvGjlqfpSblNCpyXxd0=; b=WgbQE63FHBN0J1jI1J1ZvQYcFxRtmOnXpckBBmh7pSkSwwRYMGP9lr2E 0uUZdHMP0WD7Nb8To4NkbBXvROl1w2tz/qaoBw6Hrgc5SNIg8s3d79hA3 pDAYp/M0KJLjeOH+MbSmS0gIv+C9iuBX3mvd2ih9ieqI2l/na+rOckCZk gDB1cBVCH5QyELsMxibXFy1TJ5ScHRoswu9+1yBQOmnfO3SWUJfIWEWF+ uCrXYuQNpb+q9ochBcwb19slx8S9be4bz+u98Hv0Eo9x9wz/TJqeoJhtK MlCtw/Sfaq+2EmiFXZW4GQSo4eQDpIVwaiicdM8Wn6pbU0qR0D4dAJxEb g==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853896" 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; 30 Mar 2023 18:44:15 +0800 IronPort-SDR: GFM9P861YeMeBZnhrv39ikHnGYn4JJSt9N+cLCe7CDiBGTP7vBChaTqy/1N4bupXowyJOVU8Sz wl/sTNjGH19SvZNM6jG89K8xSPq0AmpqRg3nBpgQwd/FgLYGrAuEz0zs1L778lqxjOmg+i4fyM KePwwFU9Yis2kCbYbqkisjlWZWn67UJ9+gIO52JDpThe3aoWyzn8ACRpqZyGWWGDjtl7fZBAsz +7v6jX4XIajbbFlfF7K54DvizsKiZFtzf1ZBJaVC5JSF4fmIquLEitUmgoS4ZGv3MB3BwmD68t MKY= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:42 -0700 IronPort-SDR: zqJUuuEWGvtk5ynuIvdoGSTcK/Y7DxRZqa2AqDl93PHBq8zvX3+RgmnnfgDIeH88tY2GRigaWC ksCV/5j5AZp1gugBzl1vz+fSlxsewSxY1IwvAF8Z1UQmeURLZPv6rUrbXBVcc6ZKqszwyeJr9U LQsK3/q3aYuyJzksTzLRhNklEISxCuzFF/G4VTc5KVfAu43VSgYzFZoy1iZQGI8hm4vbdG/U+b a9LQ6+vlvJUUlbReY3s1WU5G9fOKBxzpyEUyM461G23b/3bmRf1IU3OFcf2/9bo9XK1+73YPu+ eEA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:12 -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 , Damien Le Moal Subject: [PATCH v2 03/19] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Thu, 30 Mar 2023 03:43:45 -0700 Message-Id: <0b8d78cb8d38e4d4e3c5b1c187c81194b6403251.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 0DB754000B X-Rspam-User: X-Stat-Signature: gsj7dfds7qfafaakftwjmwpsy8wku94r X-HE-Tag: 1680173056-125728 X-HE-Meta: U2FsdGVkX19OWv091cEhoGQB4Jg/HFIJtcsYL9P9abBMKhWKaLMiddHrB6rvxtlSHORXNV6/z1uKPcB7QZ46+s31aDIV2tXJAr42SI7pqasJdJ5nN6XgtLqGY+bY/uykj1WFvkz7P+XTarNCDtoyZqBdwMJBgITGVyJJ2UwMu2SAL32bqerE82KKOqhNwjGb4UQfxXQ7Tqwihna5AlRvlIVWZ6Dv9quHeKW35kjeH8d6jd3F/J5EAXdtOAHgVpgEyYZLcx9cmSxrxMWla0GI/z2pI2A8Lk07VWcgypVjGv7wvHoGWxU79KaXziuo3LKcKJwS/ir6xvBgCHJWhu39Y48WSx3VtjjKtyCRWrvZBXuMtOHB4YM9p70mKdZMy3SEUwLlxq9UVCn7AQS43HdFyF1KlWudcD7X59VErb+BmZOetbTY5OKksQ5uuzWK4A2QBhTDh+/7tFHzuaBD6ZKrEZvFCzax9ysZN1Y86HVgR6flzODs+NFVw2Rokmhi1U45TCZ/4AVWBDbYxwcWU0vNGdoUGtPcx/r8oDYaI1BY+/JlN8dPpWNnFC/XMBYk/RL88gWp1iVpFeEgzE16DGBzt+DmbPeZ4cgIlI9YsCyjUN4HZc6DC1IWLvE1SbROuZwqlMRCAQt3NR/3GoYa3IoATjSqi2YSm2Ckek6hr8m2Xfsd5BmFO/PWEoaCFOizuoizUNdgDUco48EMLp6gi6xV9lm7Pi4ul10c/jLEbY72ISk0xmfT7b1vo3nxfyJyAAadx5JS3zpN9l5PUrpN4VjC2EjT2BCuAhqRAttLy98GiVmRTQ8GsjiA5xgPeZHtMfvcKZ7Mv20B7LAotfAgX8wRrGxs61numNofO/1FkcDk3x5wXbk0QjMavUQUKXEb28R0pI/Sr2UPPWfwajDgByssiIBzNcUE49JhXCYNOpYbAt98eqqsiAMLNhWu5rVT23e+epNEC6qyl0PY7QsjEQ7 OfqQUH7g jgoQ3McCHXaGZYZD10M4tRdIgliqlet4+jeut95z6U0rpWiYzP3A/T6xwywH9owIEo1Qb9eZ0Wauc6Da0FohhAJu/epNhsFmv6E0828I4T8BjFs4ujwOJaz8eOu9gQ+Ma5R1mHKaEoa3cDgXukwAh2R/wUC/TLBdSWwoHJ/uhIuMlqtG5fCyKjdR+X5wdDLC/jofYnvb4Y/Hh5mqEXK2LM5qCJA3thf302fiSb+NkOdE4FhVpTsmtkFXdBxRQjo7lqXnXjAvhr4j0PeAMdVWCSMImmwO/lVd4M/GTacPfhFXsNjqIBc80K5Q9Q5qSzmCExihnfjo1e1wKGfA8hkXT280cxTuZEtwpTesuZkTF7der30UNayilYk7Rae3YEf9EAvUUvWac0ACriOol/3BTPIcs51rRLPBh8ReU 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: dm-zoned uses bio_add_page() for adding a single page to a freshly created metadata bio. Use __bio_add_page() instead as adding a single page to a new bio is always guaranteed to succeed. This brings us a step closer to marking bio_add_page() __must_check Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/dm-zoned-metadata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index cf9402064aba..8dbe102ab271 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -577,7 +577,7 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return mblk; @@ -728,7 +728,7 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return 0; @@ -752,7 +752,7 @@ static int dmz_rdwr_block(struct dmz_dev *dev, enum req_op op, bio = bio_alloc(dev->bdev, 1, op | REQ_SYNC | REQ_META | REQ_PRIO, GFP_NOIO); bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); ret = submit_bio_wait(bio); bio_put(bio); From patchwork Thu Mar 30 10:43:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193863 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 4154DC761AF for ; Thu, 30 Mar 2023 10:44:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D696B900005; Thu, 30 Mar 2023 06:44:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D193A900002; Thu, 30 Mar 2023 06:44:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB9D0900005; Thu, 30 Mar 2023 06:44:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id ACA49900002 for ; Thu, 30 Mar 2023 06:44:21 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7AF83140168 for ; Thu, 30 Mar 2023 10:44:21 +0000 (UTC) X-FDA: 80625230322.03.D203679 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf04.hostedemail.com (Postfix) with ESMTP id 640A140014 for ; Thu, 30 Mar 2023 10:44:19 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=i+baureG; spf=pass (imf04.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173059; a=rsa-sha256; cv=none; b=u24B6zsrZ3iWaGMeQJcQ7Ks9wHCkd9ag16nmEsUazcVnu2RISNpt+vl46FoNb/Xp/Fw5th Axkyac6A3WEH47m2OV17LW5L8QxmTB9c5R3Sxj01v5EVdAI5m7E3h3zZv8vSUzGcGhkwS4 3DTv591LK7b+0o6PuNsGCm8LkvC8xtU= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=i+baureG; spf=pass (imf04.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173059; 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=rj9p2ML7UHam5+bM5W4iYW8IY6YeiyfeC2bpmKX2tVw=; b=pP4UWp+w4dk2dQMmbqikxw8aNyQO5dtXlPbX6hKot0Rt3XB5JkxKpUXDrcB5/oPQy+e+zC 7HtHiF75n/ssnSEo9SH5Eya9wr0lDo0bU6gk8jp5dyMsTkWMgCh5+1ahQlFlMXt/V/HkI+ 6sHSwgD+hvNCRZRmO6WAZoY5GiNdwXU= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173059; x=1711709059; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mX1ugZUMlV3kS9C+vBwAioR51KxgcrVIz/0Juw9keV4=; b=i+baureGrXF/ZIHW41rfKyEOHJCvgtnB1JxGi24QK4VCWG6qtJFu35rk 6CtGSDJCDlADNKedKTqSX9Qi4U/h2gCTe5GF6BVHRG5kXlg7hISCxV/2Z Z4oEyWitv5wXRBxjCd9DPk6JVcSv9aokK4JzVEjdsXPm4EBdqyJlYg1lL tm/vy4TD58xWOVI5GDBKdHO5dbiIqRVLnUF9q+RgHUfN+B+1/HlLkHW6u dJxpgHbotTt/NQqiOB8EN4ndsO3dltCler+lGOLO88q8ug5W4+Tb6Xmr+ me96BuzcmOaf/pTKtAEMYqXWXicEKWPOYkU9QwpJXQRh7X2VZ/22k15Gr Q==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853899" 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; 30 Mar 2023 18:44:17 +0800 IronPort-SDR: B5S+MrWswuhnE8VtOcjamppvt2rs7y9rQRGuh8VzwGhzIf2HHZcI5Ku+0b2f7v7iqH3bEp+pZ7 w3Dm5FDGMYxioMWJaO69P7UTH3Nig6Mw4AUtO68RUdOFzfVEzAeTUrIrManNoXuykh6YUaOzNP 4VpLHr7HiOgU2mpImPrmLFKc5FY+j3/sgKtkIxncb7BmjVisyBoJcQ+ArT/FNESQxZpe2OxcqZ hA9KeJ/33hJtPaxhIXvx8k11JnGMSpZPLnm0CxWeKXWlK8axSm8720Sibrcx71GidKA8u7T4oN 7ww= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:45 -0700 IronPort-SDR: tGiYEQMjhW4+FrecuKxL+pgIOJGkToeN8EqS2UrmeIc+jDKs2LGUqC5wI3lkpfIG0rY9KtD7vW nIXhgAj3MxSOzjMcp86VQe4PR65gCJ8t/Hr1B/e2y6ez9iviPUznUuSsFvmn3O88X1mcUdVcMt QW0hYZrihvAJT5JS7wACEa1P+gmczN4rkDt/LCKCq32xB6tvek7oUUECHgErjCvhLuoZBvN/xK 9puzg1a+1RXgqpR24l5LZUwbmEKk1F58oXHxor04IMFieHnETCM2z+v6HEWQ9+B8eqMai+lo6B aDQ= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:15 -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 , Damien Le Moal Subject: [PATCH v2 04/19] fs: buffer: use __bio_add_page to add single page to bio Date: Thu, 30 Mar 2023 03:43:46 -0700 Message-Id: <1848c9a0ec37fddf7bda3f97c6363a7de97eae19.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 640A140014 X-Rspamd-Server: rspam01 X-Stat-Signature: bfkex4hr6sfpr7yeont3mhfuygix8uzt X-HE-Tag: 1680173059-296222 X-HE-Meta: U2FsdGVkX1+zPtm9pZlEj2bhQ8YfPLmJ9D1HMyVynQEyTrL1BlaYVgBhOH0DfWmDYulpYmVbRhYad+SDv8fyCoVBsQZFm3pxCC0fYjOzB4957dz9J6D40oQu/IPY2qNhfXZCbgK50FrqMo410MjGq8StyIGYGJShi3dCp0vUJYji54r+gmeM+1vk2JBJxzcSAx8VmHWia345bp+rjP33tU7Z9RPmMwRNI9vqmmuAEP26l+cLWYmO2XK1Ec45nODwI05P647NwYCxex4wPfOWyEhnSPl44pxowqECZBGYeDc+GVWXUX0PRmWBLj4DLugp0cjIX15JYyWJJdO9OK+Hitnv7gfMAW9gcaXgO7UoIeEWEjdp4JrR2KwAHdXI2h8XJsRQRKW7uc/hbY3Y7nS33dq6KHfgF24fTgIs2ek1oWXS5KFBDtUHV+C2shhM1OVqE9UYW5KjNRF8KpOss2Jzm92HGDesUsAQhcQLlxQ78GfNx2qIigVI1M2ezkBwpIllKSNRrNRrJNSIuIS7FpPakwHhn7CfkCX+JIuGw1EwgQsrYqYmkST9wMxD0u3g3STcMzxTuK/TCEkCn73w17SjE9Q/Pcqca8S1q9YUgXPNShSkKypBHqPY8ORH7frfJMbWPsuqFrlESBGbtDuv8XJVqJ2iNWbnP+tvzAXbN7pUI4ssRS1jM6iAVC3O03hFm/ZYZTZe/d3SRSzoLh/gaMI6H2evPYj2H0XIcAUMpsjnrSxrq9eLKKYjlCIIGsURo3mZY1/jyYa39rxmhnr2+vQaN1rdbEurwpWzEsRGCuBoaV1u1d/aXjH8pdEfyYlTGnOc8pe+quiTyr0LAsYAdZndu2zq4biCsX9FlxtHjlXxkX52BSDgkcmm6pWN0/4Lyb/8JOfT6iCyYQUnyIEqqys6bYEKftlkudXz6P4JM/HztpXSpqOC9E24kDNlogf5XnAkibkgqQ60XwYddwUsrp8 uZ4u2OJs ZounpJcS0El1JzrzYb5G0NBgBcKctwYhofMT5mqZgMwSM8t7sUPaBt7AhGk/n7MA3dJoH/01X0CXGyFIj+M7Nm/R1Sw+M4hFUNAt4sNMZ1+JK6KkdRRLbJRHxaUcSskq65jHMf2/juWQ0Xd+6dJGS9cDHllj27m0G8w7VrURhuK2CAcIiGMbPlrCl8MsDMQ2tImDwOS32AY5vJaao8PVkOCAums2o9LbS9/dBuZUvz5DgxJU6LT+M8t1Vg4Vxx7TpQost2r37f+EyMhPc94eOS+9SxymxqOdTR+SFW4mQrYh1ks6LKiHlcPeuEjfwHMXn20FmA7ciOQXWGgE1Gpftb+Cp5zZ7WUpe8XGewmlkUfMSf/3fO9pDNHZer3z3xviqZVKJ7kfcuXoavNq0o6Z373VX6qegxHuH5xLk 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 buffer_head submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 9e1e2add541e..855dc41fe162 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2733,7 +2733,7 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); - bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); + __bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); BUG_ON(bio->bi_iter.bi_size != bh->b_size); bio->bi_end_io = end_bio_bh_io_sync; From patchwork Thu Mar 30 10:43:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193864 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 2C928C77B60 for ; Thu, 30 Mar 2023 10:44:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0A35900002; Thu, 30 Mar 2023 06:44:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B93C9280001; Thu, 30 Mar 2023 06:44:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3622900006; Thu, 30 Mar 2023 06:44:23 -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 95D57900002 for ; Thu, 30 Mar 2023 06:44:23 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 67BC0A08C1 for ; Thu, 30 Mar 2023 10:44:23 +0000 (UTC) X-FDA: 80625230406.17.5810689 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf27.hostedemail.com (Postfix) with ESMTP id 59A8140002 for ; Thu, 30 Mar 2023 10:44:21 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=R0kyubAD; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173061; 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=kcNN3p6S5fn31oSt7NvkB3NfN6Wj528DNJTta2mWC1Y=; b=Go7LgwpJWD3EgeEVpWHGmRhhNuINgVnwSo+qNitkOop5LjC5bccBew9OO7U3INN6tv6kxD W4UFQRTf/A0gRUOJDXKNq9MX9hitZmw620agt/RmFxi6b5yRHhwGaeESLVf1kD1uXmeAAB qrNSa1b14VdJLUkugnjvw+FT47NjBXE= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=R0kyubAD; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173061; a=rsa-sha256; cv=none; b=Ks1jGRLnN0FjOMPFBPBhnwaLaGVxkAigQt1FyILfBbEd4foAtprcTV8yye5ocrwuCYV7Cu GyKGYvVexxKWbXnQRIhVzOtMX03pW/dAUrKhOQx6eVE4fG96tzDN87NsWcpmmGtH/JCTuf AebIZYXI6nC4w239cgGkJD9wPNONBzw= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173061; x=1711709061; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RpitYrbMFeR5j8yxFMmc3tnhDIhgkd0gY7Yp5w5KjZY=; b=R0kyubADpadLzdKZEoUBJxeTjaqSl77REgYoSozXakA3n6C3H0Cct07O mlCROrf406cjIEdT3i7u1s7J0y+OD/QSWxYkEZy+Uy1ZCwBl2MVNjDu7E k6maIM5o6JHZyoP728LjDIyynkE0/7ZCKPCcCSS+tVH/yIASWkzJxyTtT zX5pTsrr3hrbODfCW/D25+mMdigwQ7cNsgLndxSR4Vy38ElIU+ZDWO6F0 d8AxdmxMe00nywFC3ZC1kZPQnP/C3kvpivPKrd3VPhX6V8vdtvFTHZvgH 2r3VFndneL54AAW8DB02ikJyll8uSZlw+mLjLfstNvv3VaurBasqcz9Mh Q==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853907" 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; 30 Mar 2023 18:44:20 +0800 IronPort-SDR: ptmz/XGyQkYBt3k/m972mR8t32hT1LuHC9xeH7Xfloung2TA4MTRaUa0tHvWqIpUqygb1cVeZ2 ammuyOsOuhYxm019KxqTLY0FJrcZGPP2FxSLgVtTnc718WLO4YOW/zCC2rZWvudvoUZz/3OrLD sO6TUIpM8RwV0s5fESCPxcvf20Mf5lmQhmuO9i71ld57/LWFFveIkkxPThCJADb9zOXNAzmOi4 8EQeUqS55IkFI9zdG805pEcew0d8QJAAq0VgQ6VFmVkJ+TSeWshuOhR8XYpIpDev22TuWuFffL u/o= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:48 -0700 IronPort-SDR: +ifl+ssGQMJo1793QyummmYdxHd3XzP9XbjKXn6B6L9A/71IfxQfpv8qYdarzpWEctk4Ql3WMW tPTK/6UQPkyog3HY7qay4dpVKeTmP5uIdnwjy4w1mx3YP2Y/toi1PbzB3aslZB5M04afc8o1z4 yZQbo9Y6NFNa+sXQ/Q+D/AMjunNqR24ybNaqHMPMmSEop2iGUVZ7PeH8+3OU/sv+eDng5CjLZz ga7rpWvmqRchNNkmOIEQBKIXfa2Mc8UQommU9tZ/kK5i+Hil+N15boStP09k/34t8fBi6p3L0m tHI= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:18 -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 , Damien Le Moal Subject: [PATCH v2 05/19] md: use __bio_add_page to add single page Date: Thu, 30 Mar 2023 03:43:47 -0700 Message-Id: <359e6d4d77ee175e2ce7c315a3176ca360e10fbc.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 59A8140002 X-Rspam-User: X-Stat-Signature: f4hwtmgj1jthx7b1apbn3ge9gct698nc X-HE-Tag: 1680173061-222960 X-HE-Meta: U2FsdGVkX19VsOOzkMfXoHF/fZcfyA1VpFFxAKNePNfOZdL6A1hMbpFgCrp3k5oHnOxXzRTWT11eqwDYwwUndM0FGmGddVfvGqRkohLj13edGWqiS6bP3cgBD/dob2WG+p7ZdUK6dV2OgQwMOBBxy25t4+5EjGO4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pdtlIwLD2JfDSkvB2jqaaaALP4ozThz42BsHjbeUvTthBaHENcOyviWH2Y2A3loqqRMwGugvSvhoGxA2RndDc8ZRpnyZdoIrTVyIT2Wwt1nJKV5lT3yAx1zXzrPjd/2kKW2l+/xnpXpjSlJanqDt7Lfh2acW9H7hiAnxedG6w0jcDQXR 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 md-raid superblock writing code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-of_-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 39e49e5d7182..e730c3627d00 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -958,7 +958,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, atomic_inc(&rdev->nr_pending); bio->bi_iter.bi_sector = sector; - bio_add_page(bio, page, size, 0); + __bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; @@ -999,7 +999,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio.bi_iter.bi_sector = sector + rdev->new_data_offset; else bio.bi_iter.bi_sector = sector + rdev->data_offset; - bio_add_page(&bio, page, size, 0); + __bio_add_page(&bio, page, size, 0); submit_bio_wait(&bio); From patchwork Thu Mar 30 10:43: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: 13193865 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 114C8C761A6 for ; Thu, 30 Mar 2023 10:44:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA9B2280002; Thu, 30 Mar 2023 06:44:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A333C280001; Thu, 30 Mar 2023 06:44:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D34E280002; Thu, 30 Mar 2023 06:44:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 7BA39280001 for ; Thu, 30 Mar 2023 06:44:27 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 448D1A08DE for ; Thu, 30 Mar 2023 10:44:27 +0000 (UTC) X-FDA: 80625230574.14.6D2B9BF Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf01.hostedemail.com (Postfix) with ESMTP id 36CB740009 for ; Thu, 30 Mar 2023 10:44:24 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=nif1B7PP; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf01.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173065; 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=NvLJF7eTLo27RNoKIJRG6qSoRpaf2jS02f120/4JtBs=; b=rUiLedZ7bESw9lalxWRb8zoVXzAgLDTG9N4NZJAXng2/pdH8zmbBS5l3BbfXdrAe5v7DdY kjCRnRaVzAX0Gm5d2wM2rx6kTB+T0DPjBIkWNEi0Ozde/tf+w3DyuLG8kNoGe1dBUGrKHW c5xuqbELwMxv22SuHhX1zb7tl112TMY= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=nif1B7PP; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf01.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173065; a=rsa-sha256; cv=none; b=7lSSsyrFniQL5SA9jkE7pljmeADHpz6sWjxg7omN48yh4BD8rpAcJiQdfmJh75yFFu4rBD I/D6XLT+RcGHaQFM79TfPER0LNjhggWz9OkTAenOZM0bxtEaKOunMa0nzoPjW5j7BqQWV2 7SjHKIBPXBehkekGuO/JMdEH+rRXNyY= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173065; x=1711709065; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Kw/gd8mi4cp3C+0+JmkC18fkS8wJMSIrrh7WtKkZNvs=; b=nif1B7PPVKW9Jxy1vcPGQSthlZ6STQqB7BqHkAPddXpbfgxMeSL3sGd8 KUx8c9qzWOjoYt2Kj5zQlKkOZTmQzYGS+BgZz5CrX3kC0ZO42pAh0CPSq l905eCykkXkzLAHRyGiZYqKesYL/2h0vwRtX6z3MMeptIdx0NTlB2HRJB XpU71Ry5Ryc+LtObsV+1oHnHfGON8ABSToSyZ8T1FmGW+VDFUWiLREz3j J+2UEFNwR2IgL8cWpAClrGPkoVNuFD8c1n9cMGo1g1dZtZxPSDNo5hTLz mF3eDRtQ5c/OpYBfwlaH8CHN0zATVR0RB2fO0h8W/kkyx+Dg9pCoo6hDI A==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853912" 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; 30 Mar 2023 18:44:23 +0800 IronPort-SDR: zomX7gclwU7ngxzID33FKMzCXBFTNxoHMRYIjEFMJwtbm+AtBjRlv0ueE2oRW2QxgnLd4li3Uo LVOn/cvx+UnWWGruwR9yBolRUzV+uF7wOErZLLoxgG7WV5Wr0mbOHl9wFe5IYeNfHOUk4dLV91 2v/PsYH6sF3qYWRPqk/8E9ZvhIDuha0Z8FN/9KOWQUvhaCewgg/goSqDt/C4+kJgrHzJRDbdNz zykodo6gjgVQ3N0JSIiNFjLzzVAtp2sTNUNmLO0VNH3EPM//xomq3S8zoY6sgFgIqMRtc1wWs0 BAk= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:51 -0700 IronPort-SDR: V9njnv+t+GuKggx1vZa0T1MyyD/4iSSXEJKOary+Bq17fidU3Wq1CXNYZJCw9uLZGgQvn++tes OUuz4YBad4EEj5SCwfzseRk61pTGeIXQTJ8sWWZ6C/a6IojWDHpOIMFR1kBlWwqA9+1RZimaU2 9ugMrtf5vwEtfAfHMV1SAmH0gL4ClOl0L1H4690JPAzrH+EYrtPzKQsIBiaqdN4IhpHVhohUHn t7AtVhCoScM7RNoNSFn3XL939XSpDOx7ZCfy1+MZ2oQUID6IQmdyOsZrB+CvmCXJX8/vdquFwu xWc= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:21 -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 , Damien Le Moal Subject: [PATCH v2 06/19] md: raid5-log: use __bio_add_page to add single page Date: Thu, 30 Mar 2023 03:43:48 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 36CB740009 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 5jc8n567c7ygbh3o499jugd3prysnzd8 X-HE-Tag: 1680173064-470583 X-HE-Meta: U2FsdGVkX19DcO27Wy/qP5sXUhNEXM2hUQktQQpyrswy0jGPw44U9xkHO+8Ln/3VSGgO7WuvzG2xAUC/q9cF/3cuq13MJ1i11Oq4eWHg49IZes/+hZeO43UgIA0hKv9LSbiy/0k8Z6ihAr8J8Zb5ds8H7tiyRdWO52sLOVPkX9gbE5BNewGhJYJQLEMdyMQQvu4H5nffCtc0dGQIIctYXsVQOafR6qnntlXIjCLPWkNhyEejlsNfwk8q26QvQi4SI5eA12WAJZh1bE9S+VQXQqoPVRm64v/rTita726U24BTQAt4D9EnBpGQtnrj2dwIAleJ60uvYZHnUlp2OJvJr/XkzDcmCrHsb6G9IyhLt1kFSX6umPfFdHQ6PmvkpOheofhKIGGTCmi53y25vTBRG5K+ftjBVhOhbhjPESKO9KbkszZhyrvI2Yb5P44DYlvbgAXGQxE1tvuwAJdTvyizHkBPWix1sQ+JqzJQx2NSdoSVzy3ui4DLUkp9boMJec161Bm6dKhE2ebqKk8kbyY1pGtHh1buHBrFZN6pVqnAVA+prLTCgsjntQyNRqr6hR/r9n4mU3vwNV6iyR9wAOAnQvcBlwaQXznSFVTjNMRYaaj2Jq5uiJGwPw6TvBuUgiTBHrA/HnD5ZmIizfNetOx7PTf7IAvgY6TF8o99ks5DyeOHPGIz+1JIFE9KyASv27GRr++Tqh6dPfe8inFvcyRaNIv36nGjFfdB7q0dC5XIQ9x9YdXoWPf356AmxaB95wp8pEARQsK5xeFhiBgcFZMiKiI8WDfMLjJ/iqYuU5se121oJ9nYiuyw3nyCkcss87VTocVoaD4CD6jVg4EiUmmNyMUP22vHVo6aKfiYDyrTbewKz6zwTKKny2nhLiG64OuTLq7dry2QTWJ8k8eun301I7Ak4OwcasZ/K7zYAlFRnBfGBHA+jqqbvZD+iWTsD631JZ6hNnUwjy9PHxok0nE miffBEYH uSrxPbIcKot+EyyL5gWC/TnbME0Rqi7cic9KQpiw0VFgaqEx3EpUycRXS91y3nVG0twzFuGDgvT27/aux3OwmXqzljCXILYgpJwU6rrqNM/Uz0amctx7twxUjPVWjD+lBAKI/JNYbHOJFfFMzlRc7bjtR/CsqAPSqUY9A8vcWsBfGLFpGeZHw91Q36lVDf/6+M685MaQ1I6sL6XY6NphY2/Q5ED6s+dLzkIA3H33R2po9SHhLYhnLeu5fVOt7OGRndYJ04LL4VG9ZqdHuqM1lcl9jgYBC+kUMaV97jPRCvU+jZ1yGkC0+Kel4JhY5DJ0EE9PdT0J1nCnZ0+WTe4QrGL4nDoxtkwKDp0Du964b8gHltjw+WEUsgLP1Y5iygRk3RvMB3LLS0BSgNomjpH9q47y9n/JeyYJ/wzBr X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The raid5 log metadata submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/raid5-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 46182b955aef..852b265c5db4 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -792,7 +792,7 @@ static struct r5l_io_unit *r5l_new_meta(struct r5l_log *log) io->current_bio = r5l_bio_alloc(log); io->current_bio->bi_end_io = r5l_log_endio; io->current_bio->bi_private = io; - bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); + __bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); r5_reserve_log_entry(log, io); From patchwork Thu Mar 30 10:43:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193866 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 519AFC761AF for ; Thu, 30 Mar 2023 10:44:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E2BD2280003; Thu, 30 Mar 2023 06:44:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DDD92280001; Thu, 30 Mar 2023 06:44:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7CEC280003; Thu, 30 Mar 2023 06:44: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 B62D3280001 for ; Thu, 30 Mar 2023 06:44:29 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8CAFF4016D for ; Thu, 30 Mar 2023 10:44:29 +0000 (UTC) X-FDA: 80625230658.29.44011D0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf01.hostedemail.com (Postfix) with ESMTP id 6DC6340007 for ; Thu, 30 Mar 2023 10:44:27 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ManApTrI; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf01.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173067; 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=A0QwlBMyB0SwxwD67uqMn4GDPEQ9XqxhlHULEh0VC5o=; b=5RTOzooAdcxenqwrcJzonbKhEx/pnqZmhadXO1WFvVt7VnG8paw6UN6llVaOkpMV9/7YhQ 0WaZYyPejarFZ2Ve8Bzau6CYLLrvDT7FoxpT9/xfAF0bJrbi4mKHpBEL7dWODmllUBCJab aV/tPwOk0DGd070OUfYox9HVp0H3+TE= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ManApTrI; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf01.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173067; a=rsa-sha256; cv=none; b=IAT2hWwAV5XKFOlsxp9k0U09LrmR1VxpdichBgUCJPjImO+JKz6zcovkN9mX9J1DAmFfZI hkVhmmnTRW8cqBUsvc5/aMe9lOa8jA+QXTeWjOJWIpSyGMPLdVm+kDADcmpefMOMMRLh6o QoY7HeHN33DbnwSA+4hFSwMidFNac1Q= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173067; x=1711709067; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r2Sf5mUt9HArXYNHtNNZG9NyfVeVIuPp2J4v5VCyro0=; b=ManApTrIi4HP/4ieqCi4A/QEi6YE33HxsRAx5dsLPjahTaOFo9N+hd66 6lPyLmu1LtiNJw0+eYTndbBp1yc94dj8xPXiJtoru64uDexpmJ/Bz1QbF TSiFb3mf4+zrfD8If4hQrzXoev7qYnSj+EK5P5SQvV8BuGeV7Cbwr9CBE bPdEHzbG6CT185TqGmavBu6rws4BQD0RMZooRZbgzR83S1TuAXmhlOu2m oFu/+2kKr+Fy3lzvDrMO/00D3C8D+vnkLjk0Lm8UYVinzbC5m69zznMMh cVXdXcUfDgFW3n+0gl9SUueGL2IyGNRVX4kvBT61jXpp8A864ptmAw+fi w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853921" 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; 30 Mar 2023 18:44:26 +0800 IronPort-SDR: LgQCAUXmBjSCu+7StUntwIOtWhnz+6eBgqBk8Ks5vucMXqN50ZrTF2pxAGhepPa8rQBtwa97j5 8ObxV2MNxyamlx5it5ONnAw8ZtITHz97gfjORXG8z5AYeJYOMf3w4ArsefdY7AYsCJx6wHmdxN 76ffxtl2etSCcd/CI8j12n+x7Cmx0bgf3Oym3BnWfTipfU+y5ERYFLKLE5IxnpcvoQfjEKGquu ECqiFdlafZOU5yFJ3SfQBd+yatM0bJMY0pFYCzsKOdsHG7nkBucX0SGFjPa2PsB4OQmubky4ph 7XY= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:54 -0700 IronPort-SDR: Rnq9MYYdPgA09fnMFGRGvOdylFjRCrkzOVUrlWYy+L3Pme/NCk8sA6Zn7WCywdDLeWt/7Id+So 1032rM9LOkm6qL/hQgb+OsbJJwqKy6GZX5osAi0JcBf/+HCsJ3q7zLHVPXdvUb7yKaauSdhmYJ UDmdNwRTrKFtqsgT9GXLB7RhMWPPebX288EPBWtvMGFgihtyj6p7/rQAmgavpLeyucAJfIzx2x S6vPkaGyF+tI9E7e6BtHitbJy6rXVY95zbtc7Z9n0bymNi2mvwGRpwXi+6ApwH7c67oPbylcoo uXQ= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:24 -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 , Damien Le Moal Subject: [PATCH v2 07/19] md: raid5: use __bio_add_page to add single page to new bio Date: Thu, 30 Mar 2023 03:43:49 -0700 Message-Id: <29a2488aa641319199c597d1dc1151c700e32430.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 6DC6340007 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 7sop98zqmk1di9wq9a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OQRF/aW/clldszs/K00h9fBIoUVwBZuYJRHzXHt2mPgQ+ST33Tm6JLlvlhEOjHehf2Qlc3K3kwGGLu2+EVgyP8A8ijPksZHRYNHkjshfHliI56mhOSswxAx2V6BKr/tWdlqNXAOubviyk1Y/+/hUmTPXONJh7H+Wys+8PxGUmvUpkLc1hWtWLwtu+oYAw5K35h5nvTTNWGYxUF5dpJBP+qkCynLt46vzMqb8dSEu2DIDDf2ll58THstDFup4Wx6rr2TG1xyb97/V71rPsmZY9dzWzka21/obaQoY8roQ6JpSSmbbIx1fNo6i9C5tRqhi+J00jhEvrikaIAa2FnR39L60G0uB5V2ik3q/QWEQl 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 raid5-ppl submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. For adding consecutive pages, the return is actually checked and a new bio is allocated if adding the page fails. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/raid5-ppl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index e495939bb3e0..eaea57aee602 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -465,7 +465,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) bio->bi_end_io = ppl_log_endio; bio->bi_iter.bi_sector = log->next_io_sector; - bio_add_page(bio, io->header_page, PAGE_SIZE, 0); + __bio_add_page(bio, io->header_page, PAGE_SIZE, 0); pr_debug("%s: log->current_io_sector: %llu\n", __func__, (unsigned long long)log->next_io_sector); @@ -496,7 +496,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) prev->bi_opf, GFP_NOIO, &ppl_conf->bs); bio->bi_iter.bi_sector = bio_end_sector(prev); - bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0); + __bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0); bio_chain(bio, prev); ppl_submit_iounit_bio(io, prev); From patchwork Thu Mar 30 10:43:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193867 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 1D735C77B6F for ; Thu, 30 Mar 2023 10:44:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0D51280004; Thu, 30 Mar 2023 06:44:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BD67280001; Thu, 30 Mar 2023 06:44:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85E3C280004; Thu, 30 Mar 2023 06:44:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 76FE7280001 for ; Thu, 30 Mar 2023 06:44:33 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 26AB180160 for ; Thu, 30 Mar 2023 10:44:33 +0000 (UTC) X-FDA: 80625230826.25.587C1E0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf18.hostedemail.com (Postfix) with ESMTP id 188A21C0017 for ; Thu, 30 Mar 2023 10:44:30 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=H0ENSjzC; spf=pass (imf18.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173071; 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=H3wR0rPg0qOZQvHBdeM7QAiBsaXT+YG7F8LTZ5CEjEA=; b=TKZpFJwojxbd6lLnyeO+y4NBoPl0eil8CHpOV2mB17p5/8dXi/be0clKcXDSMjOg+C12ES aGiTPpeDJx2YlgsHpim2sPX2Dvou1WjcOZ+PhgzxVE13UVvBXA6X6QseRgCGtDY/9/zWEg MOpIWPnR7v7/biwm+kN4teVAz2AveD8= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=H0ENSjzC; spf=pass (imf18.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173071; a=rsa-sha256; cv=none; b=QcNiO0q3gCA1nFXywL0/iYgREAz2kVuZg4cVtUdnjY/rOdMwke6JyWxpzfuc8xIUkEqqf+ my5ppP8gwdD9s5kB32G57DsBgd56sTKIL9100BE9CyG1YRl1juWIcVA0XTwcdKQoK0D/l2 iYQ04U6LC3nHRDAB1mijB0DWJvSdJQ0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173071; x=1711709071; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W9gE6QmsdFRmz0ZVCVa1q8hek9wq1iRj98EqV3wB4Jk=; b=H0ENSjzCdW4ifZs9Wr3xkwxoUZa1s/oyOmfw4LIQULtbEn+N08mTaps0 qP3WpWNqVFvp6jKmhzTTA/0kEaXEGdOFx5GFNvm58rKLZox4DBdB9/adU RWiqqArW/7Zu8GJRQd2sgXSoTODT1958/QvcLFcpFD4WXON5UiXqdCEcu wJbrZ8CQuQ9z8aoR0EQVD8vpzgEqPsyAta3wL+MxEBdH3iaVKOoSkWDYe 9IYqhioARTQ4FSxnr7PcuLlh55CEywJn+0tisZcK4PRDWrypl340XlVdP wvSIlwUuheUUUc0NNxKPCsenGSp5nta68KOjmiC9mgGEkkZ6K59zwE9bI w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853927" 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; 30 Mar 2023 18:44:29 +0800 IronPort-SDR: 1W8VnXZ9Y2520zeJJ/QS6WyfCab6l3cdhjRhc92k8lmpiozBzr2ZvRTIjk6XGFqvQ5a7K18qZf wi6LZRX2AuIwm3DmWTkC9LqrIxpUG8E2XmjmaxDKZ6Bi4EBM2MsyyT+RI807RvRgBsD1cNMuQr gw1uguWIqywc1NzkSrh8X7Vgi+IvvCwpXV/zSxnmhC40EaIH9skb7ZIMlCVHq9lLzM5jCmI9Os kFvI41lHFPmX3ltYGo14BpiMeBJ+O04o0AC2yDkggjv2/FGfUt4VIxjtrurQUfju1EtMugvv8/ tjg= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:57 -0700 IronPort-SDR: 7VfBtatRUAMSKGZJhueT2GpjhxB7O4zmUTxm3R9MTyW1KAXQy9vKW9iV7AuhhA2jy1ZSsCp98O U1y/h8ZeZN+sRqZVsvVO4hAs927WNwruX7ksWwSZxQaZ7PhnaOJXPNDyTm+sgyqtE99mUZ4qrY atKl3lP0PB5GGkREm/HXgG7Yx5KK5w8jOv26buUSZPHatbFFFBRCcm6OyZcoqfvlkdXIYWwkqC cF0K5nj/s7lS0zwe1pS6KOfyNTJKWJLOIHUhjXr+avwW9dLSK/XfwgZxojo4KfnWNQ5FGo1gwc c7Q= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:27 -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 , Damien Le Moal Subject: [PATCH v2 08/19] btrfs: repair: use __bio_add_page for adding single page Date: Thu, 30 Mar 2023 03:43:50 -0700 Message-Id: <92c80a1b14a7f9cab366cce2e7c5778de5e0d6d3.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: ts4fhy3z8it9x83ncmmbhwjtnxz8519u X-Rspam-User: X-Rspamd-Queue-Id: 188A21C0017 X-Rspamd-Server: rspam06 X-HE-Tag: 1680173070-922745 X-HE-Meta: U2FsdGVkX18c139J1ph0gxRIzMO28F1MveU2CrarIAjZw0+zj+GdV0dfu/wvmp7gMw7dJwwlHbxm6cR/HkIcYiHaF3SOanMy+XsCt7uTjeYEch/ypUSDw9hnFbWUIYOTul90ypBgJF+HO388u40bMTcHvV3gERtYVsXjP3+Kc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NdhJYpWjx9qXDv0YF+Wygoid0zRpHyJxV8ndv3gN7ST9kDyW2yZ+cEvpT/79W3BuMUVZbVMg4TDpK/8J10WoDyQ0or6uR6yeEjsQH1pdRC6idLpgXeasZnrpr0nrO3DCbzaC/aI8tlgbIMBX1z 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 btrfs repair bio submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/btrfs/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index 726592868e9c..73220a219c91 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -224,7 +224,7 @@ static struct btrfs_failed_bio *repair_one_sector(struct btrfs_bio *failed_bbio, repair_bio = bio_alloc_bioset(NULL, 1, REQ_OP_READ, GFP_NOFS, &btrfs_repair_bioset); repair_bio->bi_iter.bi_sector = failed_bbio->saved_iter.bi_sector; - bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); + __bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); repair_bbio = btrfs_bio(repair_bio); btrfs_bio_init(repair_bbio, failed_bbio->inode, NULL, fbio); From patchwork Thu Mar 30 10:43:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193868 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 3B2D1C761A6 for ; Thu, 30 Mar 2023 10:44:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CCE51900006; Thu, 30 Mar 2023 06:44:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2E9A900005; Thu, 30 Mar 2023 06:44:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF761900006; Thu, 30 Mar 2023 06:44:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 9E409900005 for ; Thu, 30 Mar 2023 06:44:35 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6E6724016D for ; Thu, 30 Mar 2023 10:44:35 +0000 (UTC) X-FDA: 80625230910.08.A7AC4A3 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf18.hostedemail.com (Postfix) with ESMTP id 462DC1C0005 for ; Thu, 30 Mar 2023 10:44:33 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=TQ1gRQEN; spf=pass (imf18.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173073; 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=oWxxzkupGP3zZ8EA8mimp1VOh/9W6PeHdnUpiZAKea0=; b=serxur7dNfkWBwqSw3+9RU1u0z/BIOym0EBWAFMdPgQFk+r1ryTloQZuaD05s9jU+R+Bt/ InwgT9h9otz1s4wYQSFvo5e8Nq2ByhLo2sDcNYtBcyrwFi3Z7dqPASekgxobGg9jjRrKZl M5vI37uOepoxOniYzirhmLWGoQHH/ag= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=TQ1gRQEN; spf=pass (imf18.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173073; a=rsa-sha256; cv=none; b=tCxiR4d3WJhPQkItJPkE6Ey7yvGxuCnoryhZM0Xid6WJEfqQt0G3Uj/n5m+lZOswfn5rcg J4LPTZpOaBF0DRb1zLNHGFLErhwqIIdtWpMMB8De6z/plAPN6ZpUq5YHMzM+y1t9gVmIuz JgCmhR78ieCv5Z5I8pMzT8G5c0rFBt0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173073; x=1711709073; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=losNsOzC/f7Y139Rf9MlNoUaYWQhJEhtWroEro9w4/M=; b=TQ1gRQENq70CaXPLg1PlX2mwgI5A5mGgYbRcs1Km3SA4ysoCiyG4OYKr hc9wOQwj/vHMvjq4KhfprXbV1VdF4KHEp+TCUyOIDNpit7hul7UJe4AJu 3Am79Q/ib1vUfHaVcmq9nkmPE1+W+ewzta5DfMVyeokmkMv1V+gN7H5aA GZuay4tra2Oc5BCcpiqk1JHNHkSfeX4H/J3FmoKkdaF/EytvXp6eElsFE dvvLMmXLlxUcGZAH0GnpiquGIwB4WUFd8hz/L8oUu//C8TNR2OmpRveb9 jqlQl33YSlVtjyaXo2DGDIk4+cmu3R1Gec/Ktjarlexi2yZYGcerNgMtH g==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853928" 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; 30 Mar 2023 18:44:32 +0800 IronPort-SDR: jPulm7pFSJP89Onp5errLTGKKDD1oiZgDaHrxo4zmLVCgw0FX6T9NHtUk91a7DLJyXRLXDAf1C 2oB1r5FDGeZ9z0N7NWWH6LAx1jelsho1sghwsgZgy9BQYim3NAlbibDKFyQLte5qyi+EZ0bwGF qyVnC+fa5moDfCWsPv7RVbZUfCU5qZ98RbJ3aEBT74ZcepItgYy8d0z6ciCQz5GcbBaEM0+xoe yqJeeNHaEQuK0sT0xz+43ZIkIYx/Z5iIwE8Ruy5TcIzwnqnr3jr/o2AU9nV2OmTwTZZyNZPXcJ yzg= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:59 -0700 IronPort-SDR: LLyR2Npm2+MAJM3XIZClgMxoi6I/W/dIVvFOaKwZbXR+FXU/hAizNCjpHL6vVJ53LRicCLvlw6 5vJSG8HqxBWOqmVv/563WgNcBAKcQrTbUaISiCtdAKhBTNUkKx21Cw/LpFv6nwsVXjwJUXttT1 Ouz87wSgGmy/lK21UBktPDa5DL8h2pGw5G6UoHn1GsKFWFrgaBgxcgxKAEyMdk+8OOry+WySWP 2F6SU6oJeDkTWv5KZR1md8qL0MPIRJYLz7AIbGmgoPFt1/WpjDzmEIsUXysP0EYjsW8qL4qhU5 Fe4= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:30 -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 , Damien Le Moal Subject: [PATCH v2 09/19] btrfs: raid56: use __bio_add_page to add single page Date: Thu, 30 Mar 2023 03:43:51 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: bupyehspnfwb8qbapckx7enfdwi93q4a X-Rspam-User: X-Rspamd-Queue-Id: 462DC1C0005 X-Rspamd-Server: rspam06 X-HE-Tag: 1680173073-926231 X-HE-Meta: U2FsdGVkX18HqwFOyWtLl3ZzwWkDHWYf1N4psnbnYvZYtZxIQMnURJLRi+G3zmi8Wyohn/k6yBYfLK69ur15E9FbvbC+fgaOnR1LnXh9Fv3OgnmT0F/DKnYx8KTwzctv5yI88qme9Zv7SsjZXQPJIE/KqEMKRBaSO/m0n0rpSuvBPpEjyNgphktd7cgEWhmOhv6cSc5uD/DH7H2c7AlTyx6K95UEblVjbw8OiQlAMlfVodReWX2/Kwh8AT7B6cb1dKNJhV4YKwZewF7xM+arEuAqTJ9BQyaiad3Ra/4UXaCuFW3VLVHtT+TJcruwm4sdHPWRZgzSPyPcKSZB25Ml8wfP+LsM1Io/7wsLw29NXlqhh4Q/nuhak2/tRWZYA/ETQrmU92bhgV88ReARCKbiMAIQaMdtcajC484PpIDA3htEWHCuscNwwJlBPP5TMARe1RJWss9iGOqH9b6eBfZHead0zq5H1u9drtQhYIPPJSvyPMAsbDiG28+xiAbXcqQ9nNgeJEgATXI8QzHJtNSWgV3zVra0cszVm1Qjpe13nWV+h3JNLR4OaDLku2/TnOiM3kNqdnEelAxrV2HuF9gi1IOjmUIAWrhW3SmOKSdRvuEj5Wajo4I7GDUqRPjAV40I3Fd/60Wv8A1uyV5c2E9mCvezrvDY63hBHL3Cr4CHBO5zTw9Fm5z0rEnGtyjoB8Gd4gwAA+4efVJV0uswYs7vMQeWrYLu63Zyt1B+BsVN6T8pZ6uRYnKeT5+Xr5D0wTzHGm5en2S/q7mze6WLOBkMhREvgUxWxhIICUaHKJEKrRguLe/SoCjBrI8jbkZs3T5OGqVQ4XrbeIzVZgL5zlimyHkPFLOIxCqKOOpdVIO9ZUewvnxhqPVgu97zVucopsPfE8tDJfX4gLtY25VDV2pgilbLl7bKFjcpnu8z/lAftjykRTXlPJuABsKUUKlVSzgHhW+l1Qn3M5XqQ6RaXoi CPbHEdAc 0Q8T1Ao6aR2vHtqsscS9WP+rIrm/ZNX270mOY/IH82Go7vSJNFb0WwRis0p31Pxzce3eUXDqoN+7g6PV8OfMxOjzu/ZUBQ+s4AnNpSAdPUlYVQX4O/K8AynohzRGO/Qz44Td509rBiJiEa9tS3L8RexBU+aB1jcYlkJvaXEt+RAyl6h7JetrX5sC3NjWTLrGho0HDag4cyaCSZXOqQjtmQYxb4dT2rddYcKYwcSy1LSbvtorZF6WeptglgKSM8JEuv9Ck4wgG15F+ZA6lPgAPrCLgWPoFOeYONQXkSb576vcqXnevPm5X3fDnVmopU7SNizYyBXbulD1mlDDaSD6abyoJCuTj1zMNdEfHaqxgYMOOCpcJUbgq/zEKVmC9dS49Y4kL+bHbQrNo6lOxpIiHaYCzzhqGyMMVIhgF 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 btrfs raid58 sector submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/btrfs/raid56.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 642828c1b299..c8173e003df6 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1108,7 +1108,7 @@ static int rbio_add_io_sector(struct btrfs_raid_bio *rbio, bio->bi_iter.bi_sector = disk_start >> 9; bio->bi_private = rbio; - bio_add_page(bio, sector->page, sectorsize, sector->pgoff); + __bio_add_page(bio, sector->page, sectorsize, sector->pgoff); bio_list_add(bio_list, bio); return 0; } From patchwork Thu Mar 30 10:43:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193869 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 295BCC761A6 for ; Thu, 30 Mar 2023 10:44:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C32CD900005; Thu, 30 Mar 2023 06:44:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE156280001; Thu, 30 Mar 2023 06:44:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA813900007; Thu, 30 Mar 2023 06:44:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9D28D900005 for ; Thu, 30 Mar 2023 06:44:39 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 533571C64D8 for ; Thu, 30 Mar 2023 10:44:39 +0000 (UTC) X-FDA: 80625231078.03.2097A6A Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf27.hostedemail.com (Postfix) with ESMTP id 3191C40019 for ; Thu, 30 Mar 2023 10:44:36 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="J4kg2/Jv"; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173077; 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=D0ZFCVm07sl2SAdt9JeasHwEhYY1Ply9ltkVWbG5P58=; b=COeGlB92CdDQNNuYxcxB9a7N2GhZhhbWJrSZQVWs0A2p9UZH36jHUNDmbQ79+zJCO6vSuD HeRAYaoiDMi9A8TJ6GJoXufAqDckY8w1wx9yHUsuL+kjxctUH+Ab5nVqqeTrYiTdMKBVvX RNUagbrBzhBtDDgh6Q9K/z8fuNgLuVo= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="J4kg2/Jv"; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173077; a=rsa-sha256; cv=none; b=u/8doWWVeV1wg2vTmu6Ia/8Lgo340ap4rgFOKl1Cr33K73nbFQHXmyByHyGw/lhAe1D0B/ URtivRxJmDrUV9DyrE10+ExtO0haBwj2TmM9mp/CT1eNh2KLoU2B2RUsvKYpzo/MTOJoy8 aagrsJzYbs6qzXk9iUxFc8aH2LCX+po= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173077; x=1711709077; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HqGEov3XVaUSsU1qoKvlSzA5WCxEWJpL8TqhnbfeoRI=; b=J4kg2/JvvTMLea0LzGHi5ZuNGtqEPbI50g6HPBTehbQq81PXdtLMz6HT VHJQXyahyKU+4Yr/WuA1RE3lO4NZBy4sL+mxgC4oIjvKOr5fU8uucAN6Q QiW2FuSTAZTgepDmIFMPvlr/w4wWx/1P4T5uhBc2rdumqTiPZAHF6Ht29 DZXLvTRFba0KuvvHos19/6carQtDil/uSI9ncQs0UZdbabiJuogR7gbaa Ln5o6LleUFVp+rjtN9xy2tBDu244TCdOkV+TkQPThijPkbQSr5qYSyEcG FPJKs3czRqSzmTjOnqMjclumdLueZ5o35SY4skuGGHUaGR9UmBuvx+C+R w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853939" 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; 30 Mar 2023 18:44:35 +0800 IronPort-SDR: L18Mb7j74imc70GR+wGn19lo8H5DXd8R2dLAXqAQO5mPcogpM4mkaAvjMO6KemSIjf6nv8rmll /JnR1oq9CsVulVF9Y87YqW3jT6EbgCQRh1WbDZp1Of4SibuJsnN8mOdara0odEDpdPtFBVudZ0 OECXdmn1+EJmZSlSoDsJox+hK3IMc4Dx7TP2XWq0tpKyLvUSLkkgQmqkhkrmrmxZ+XWRL30A1h 5k1cwQHZZQnkJtqsGshri93ZSUSv31yjkVAYBr8A1kGiTZYwYXaNwyMGaNfJ3f5tMq0S0OxrHQ cmk= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:02 -0700 IronPort-SDR: 6WIc8day8NQBouRdTegvxYDP8rVucIjXCP3Xboyy2sbFZ8keAmQDsm9vsW7DO2uS+PyzZmmxhh KWnBTNrkDqHgMcs2uBQzwRKlG8tO/YWT1kyWWWUk13jmX+gnspuRhfKtnbJCyojYxI5SUBXIXL VN+gFqfEZ9ZD+g90ovrKSGS1DwHcbU8Nyz3Gb2ej0XKsCA5/rzxVTofn5VQAQFFvJRswQRcvYg BnU5nWDerGRuzg3XZHk8LHfbUEZFO9ewLWes05uTBeATlTFNUM+742btiJ6qAWVfdyqNm+r+ki dRc= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:33 -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 , Damien Le Moal Subject: [PATCH v2 10/19] jfs: logmgr: use __bio_add_page to add single page to bio Date: Thu, 30 Mar 2023 03:43:52 -0700 Message-Id: <820f11140138c2deb4a649014556aef27474c13b.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3191C40019 X-Rspam-User: X-Stat-Signature: qsqfdmdpqhxbi3pyy65by6wq64dikiim X-HE-Tag: 1680173076-566835 X-HE-Meta: U2FsdGVkX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jS0xOXvOLht416wq3i66ZUxc0ajJvDW7iG1nBBxrRNSk+KSiMA9pyHgn1iRIvKWNrpJNo3QPjvZBn8CKQ5+vXb4axEjARhMG1ykOHtxYCfaJzbWmf/sInQMEGo2tvmQ0mpOXcgX11ItQXJCO5gxQRUGvb4a08NBBg1NPynJsYc4ni++sgHi9nMK+xTpy36H3HU6aRz8q0m2usEGK9xaHeLb6v2OK9lvTEz3R2jet/Rj5+0/3QmO4KstiI9spj5i4gG+MUJqhKwNyMHtBAf6fszP5SW 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 JFS IO code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Dave Kleikamp --- fs/jfs/jfs_logmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 695415cbfe98..15c645827dec 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -1974,7 +1974,7 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp) bio = bio_alloc(log->bdev, 1, REQ_OP_READ, GFP_NOFS); bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone; @@ -2115,7 +2115,7 @@ static void lbmStartIO(struct lbuf * bp) bio = bio_alloc(log->bdev, 1, REQ_OP_WRITE | REQ_SYNC, GFP_NOFS); bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone; From patchwork Thu Mar 30 10:43:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193870 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 4B8A8C6FD1D for ; Thu, 30 Mar 2023 10:44:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDFDF280005; Thu, 30 Mar 2023 06:44:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D4030280001; Thu, 30 Mar 2023 06:44:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB95F280005; Thu, 30 Mar 2023 06:44:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id AAAD5280001 for ; Thu, 30 Mar 2023 06:44:41 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8467A1208FE for ; Thu, 30 Mar 2023 10:44:41 +0000 (UTC) X-FDA: 80625231162.19.25BC70F Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf27.hostedemail.com (Postfix) with ESMTP id 795A040007 for ; Thu, 30 Mar 2023 10:44:39 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=erLhAW7t; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173079; 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=4znaqGhuMUu6D8mA0pJ9FDuoICW/Ene3/EJOcrwZvvc=; b=4swNBt+AmhhFiDCN077XwzCcYHps4YszvaQbDY7+ISqRedqaXL+OEDonlTu43y6crALHv/ u00YVedbmembAIUhfZs0MXwtDaFUMX1gmzpSZj5egDP2s35+gXjF0Lw0iqjdbhmZ2s6mww VNDOq9MWwkxPM9mElbsZv39mnWHP4PU= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=erLhAW7t; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173079; a=rsa-sha256; cv=none; b=GrvDHzYq/9cHkge88jICIfp9KgVD9Dzy3vL5HUxsRQFtbPlGHG6+LGm84Wz4Rs4Yo5VV2N pDi110VWzqU10rh7NMoW2bu8jfnGf7Nr36qLZFH/0ZadBKg4yo74ry0icV+kzwkSGdkSHM cM/5JH9Y6YmpqlVbxbngQRMvST9uvfU= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173079; x=1711709079; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+EV0JXQ4xe5HTVfKptkUC3VI1nVjFYuHFxhKcqwjlik=; b=erLhAW7teB86a+4DYNjHkCTkXsxNq3uvXFK+uVLXnfQKZpiUcjGWhZev ar/5GawkC9OJseLwV+m5qjikxDZng6oS2N8Gl8ki3qPYYNdst3J0YfAZn Bv5XOY9O7ckmVXd01BHKPD+XXwE4pb9rQY6i5uZYFYXQe+6baPgpuMnbO nI1xGPeruEDGfRNspZWqxzKLzHoYYNNw+up4B5Ejch0wlmjlpQv9LhRr+ 5LAwj0SPebX0+1LDAtitFdxUVuL9F00aI1Bct2mQWeCBwPbx2dku052Ba 4xn7FHDVHllQzg+AFIa+ebOjoTTx1eRREk+2Y0ngPNg0RSxZ+6ZJLAz1D A==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853943" 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; 30 Mar 2023 18:44:38 +0800 IronPort-SDR: jF9JIXBdau2DU4khf5dtCC/LEB/RpnoGAjZWZL+m4W482ZcC6En2NCZ+mTOQlNY3goVPBNPA6n dndmhrOaPhGURYF9dIXYPrsP+DkrjjOtkLz7RMBesmJbxfn6aaxQtIF3ZKQivc8J5tMfoLI8st Da4kViCac7e3nOcNXNVGEQvnEiimaGBrpj5i7Y1iRpS6LXjGFNPZZRJiRNCOO0fpidT6op37SI x2c/ni3o95fE0JEXfG4eBO2sB8Rkq0pVMalOzmvAN/K0h/U79530eR8oz+1k3Ps4pToEzTxKYD Zag= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:05 -0700 IronPort-SDR: 0juN/UCrJrwrTW9FmNQ8IreQ3Z/kXco76QckMcW+qQoSIff9Nyhb6/OfK/wD1wpfYAg5ZX87cC hHTNwhN6I4j0PtZkl5gWf547ViC6MsjnMiBEri75CfYRnl72fKv/Ii3ZodjlNoW9efkmVbaTT1 Dz+z9w4GmptBfajSperiop6zUnGQTatXM6ubDhqu32VMSVzozkhANFY1FLEu8lZ5j3+I02RtEr AfbmNUU2OTcGt219K9VJZ5i/36ngrCQVIiGqlblt18Dsz9wpIPU3/3tF9Rx1KRr3aX1G/Fwzqk qgA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:36 -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 , Damien Le Moal Subject: [PATCH v2 11/19] gfs: use __bio_add_page for adding single page to bio Date: Thu, 30 Mar 2023 03:43:53 -0700 Message-Id: <2ede486fde05be1b97328579c5f84da48efe9156.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 795A040007 X-Rspam-User: X-Stat-Signature: iqxzifafyd5ty356ew9c691rckeh3u76 X-HE-Tag: 1680173079-67017 X-HE-Meta: U2FsdGVkX1+G4z+QfGoGJVXtYKJWsUYFZ0o6G/Ld68oocFUexVqU00P1mjGk3kTpzmsynd4NMjW+iOIXn/6PtNSpy7Jrt5xnnv1WkwaCduVwr0GCYAU+jR/n7wJH0ESP9RBW4Ip16VfspJf+8BLmIXhKJ/WviCAPak2yHUX3XpDoPiWru25/0AVz6QuL27CdO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HRitNhI7lC1kvjgccnANP4vr9B+/rLcPRYvesIxyrQe2Avz7AIRFVmKkVo23VdZ1LEpY21/d4YvB5Zxz1Jv2xzmJgdUSnRd+Bjla9hhpnCVPpWMODWUDyO3MOGyIWnOpZF 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 GFS superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 6de901c3b89b..e0cd0d43b12f 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -254,7 +254,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio = bio_alloc(sb->s_bdev, 1, REQ_OP_READ | REQ_META, GFP_NOFS); bio->bi_iter.bi_sector = sector * (sb->s_blocksize >> 9); - bio_add_page(bio, page, PAGE_SIZE, 0); + __bio_add_page(bio, page, PAGE_SIZE, 0); bio->bi_end_io = end_bio_io_page; bio->bi_private = page; From patchwork Thu Mar 30 10:43:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193871 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 A3E1EC6FD1D for ; Thu, 30 Mar 2023 10:44:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 46825900007; Thu, 30 Mar 2023 06:44:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 422FF900003; Thu, 30 Mar 2023 06:44:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B8BB900007; Thu, 30 Mar 2023 06:44:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1DC5A900003 for ; Thu, 30 Mar 2023 06:44:45 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E91021C6348 for ; Thu, 30 Mar 2023 10:44:44 +0000 (UTC) X-FDA: 80625231288.12.35C91CF Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf17.hostedemail.com (Postfix) with ESMTP id DBCA040018 for ; Thu, 30 Mar 2023 10:44:42 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=RgdmFY8p; spf=pass (imf17.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173083; 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=9N1nbrpzeskxzY8j0FOtrl+cQrtbVwT0+sKnvHUTqGU=; b=TYIzNKb1zai3YPIR+fhwmYqRkTUiHO49kinIQcslgjjAiYJ1qylxbANU8mQyebOEbKNalw ctoZJh1PcqbEEtmkCUywbmVik64TQrlKWC3YNZSUTyb+6i0rAL8/EMkRTlOFbtZrY0Sdyg gPXUjuBCAnkV29Po+GuISDAMEb0MmZo= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=RgdmFY8p; spf=pass (imf17.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173083; a=rsa-sha256; cv=none; b=S9ZVwaQpCuybBx2OkFX7HvkAskRxMMG2S/2IDNRgH862j7Up7pyXhReSx/TJe0NvB/p4t5 SPLfxuNrpVsIjhWumnHkid5XpqqN5Pew1KGrRY6CWq2Emh+vUf02bAxv6z1hd17Oo/EvtR KLG4Su4IOtofcrcd+uP26Js5s+2OK14= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173083; x=1711709083; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EUpgRxBtOLFJ91CyJDOvQQnrN1sWY+otarb8WY7sZkU=; b=RgdmFY8pGkWDrmhsWNfK+NIa4G69GM6rvC/VYbUbR6KmSHANW6RKFbjy 7thgKfzyGg3VWpibv+fTly1mwLHoQDw2mj7YKn8SrXjzDauAyhveno/Tl wR4QLFK0IrwTsBHuZ/DywGF+U9UmwKVvAeWK0jJG4emxpjsgArI9uSrzW DKdAfHX2OcGBVz+R/9rj4ASvTieVj3QWrDSPVMcr4b6f91mB9bUkaahcD eklwADSwG0kUqMijm1xXhLKhtFzXJLNpeIEUebi87Hr6UDnC5r3DumPA+ 7aAIeI7GnwqTvAjLsEpGfbzWvGHmeCTl/7o/nqdItlQLOQDCQ0i+ZmNdD Q==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853949" 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; 30 Mar 2023 18:44:41 +0800 IronPort-SDR: ExvrOWGxh+JKM/YJ3oY/ufx3CWU99En9pdJS2znYTik04SQQ7JzT/eWzU1pPjlgwfTDgINDDAc t1MXSfkjWhNHReAF5LwjqOlzsleuSZrmncIixfjCwHzJ1QCNEgEkCguD5CQ/Z6VemKF3PUKtFr fZskoIVdlAVHdBzr6ZxZ2NDkirvC2S3xOPdea8+5+uOkIuCvPrP7S6Eq1V7v/swxuI6XTaYYzG Ojm5vuYkONpmsZ/Dza+8ukvw9vTUnidqKJR5Y726ckBG4CHQ6GmNtz4Rk4I1BM29NpJQ1XjP21 +Vk= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:08 -0700 IronPort-SDR: VYA9BgUUDr4sRMMfeFHmoTvJAnU8njSRM2w2NjoxJH3Cs70Kv8EJ/NbwobjN2EMuJHAYNPSu+2 Nv24R+meZtBuzWBLMI2rGIlIum+FZJ3DzLLEATptDFEbE2+Hak6NpQWmS1jl66KjmWQRpANrQO SJDRkUryKsiMGPqt9zUBSBJ1Bi1cbUurM7jtK569mscScXqA2oFbNgVwXqIwxlQ2MR+O4fo2VQ EV+jUSVXErWdsRYtr4iObYolOTAsYF/RWA3lThvvL1VeJ33ahhyJvlra7p2jf2qsTPNoO6Xbj7 kMw= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:39 -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 , Damien Le Moal Subject: [PATCH v2 12/19] zonefs: use __bio_add_page for adding single page to bio Date: Thu, 30 Mar 2023 03:43:54 -0700 Message-Id: <1b1bdd842de5f699d76191565fb2b6659aa38922.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 9dti3ns4yf9pjfbbkwdsdqba1kc7thu4 X-Rspamd-Queue-Id: DBCA040018 X-HE-Tag: 1680173082-965985 X-HE-Meta: U2FsdGVkX18P06AUhjSahQMW949aqrBDKgq3kePMePrq675LJooe2kPxwXbpUDNWaJyXwYRudjtBaLB0wuyUer4Gqore1pFg5B0ScmxGOYX0S5bBGtHOKWXZrir+nNkY35kiq0hYaEOKlzAvFmQsyieZAiA6qcwDv8vTsrkb3qnroddWh8D7ZHduJCfYxb9ccIpFJS0elETM/lOyxYIvP3v3ynJNnDSoh2xdkCCHisQ7uQfCKQ+FunNl3b64LgE95zr7bJQGJO+QVXK0vPhhcLqVIi3pIJYzU4Vzl+1hpnID0YjNlBKWuz0VCJdPrzsW0gkfxmiAp+1KtJ97J9VTyOcGFuupUtFdIN8TPaHDjayd14QtQP9jpNhdq4D7iL0dBERdL13Fx87ymQrqzOnEkXH50ffXSEqAnYTEHJIwH09Rdrt2GlPsIRWEzUk0s4GjYP8iLD2T6MFdcZU9I8qm0Pr4P2GLD/DMVLlDqjToGAQnWZbMlLQzBJGh12u4YYhi3f/VjZ9MhtDbGoR04FnfsAqHXYr6/NS/5vCW8Kh4kaeGCCmCuKX07+CF/1bawBDw1CiGZmuwzzCblYsCPQQoRGI4+sielTOu01t1cvmjKARLULmvmcLn6j5VyCvrYhZiZX5kroEr7aNDe8WIQwtEoGGZc0A4XMUo6Y2CgvFEjWWA8L65RIPY1ThHzl6/2U8/rgQJuuWLCVV2ZSY1Vn99IuEEvdAqZBLAiWRmNZSIeK1a94HrFI42oROIeTe26TmlNPkz7nS3fgWHS/xvPRh3KkzvN7rJSq1VSgHyQjeUZRoBmD7uNWkge7pqHGhvP8k2YOT16pKQYlNnA6do99kj4gabnx4YIuo5UPgDAMaWhpyiKdU7/q/xwo48VpXZdQkC8uRsPmfcXaoebtaBGtfKXBQGodlA7nUjdtvExt+26XO/hNi6v7NeY1q2Ps5rkyGXRm5rodt366gIGqelWu5 ktK6r25Z zoFqkkcBv5Jemz328teJBxmkuGnSsHmxyMDgAowtU4uarfxhvW16I5kYs6hgnzfG4dFOW09LfdDqZzD8loF8QnBw9YeADdLR5cxZIp2fJh+AQhkxYIXjVFBPY/S2ieC+XPBzMvlbCynAydu6oNSSpeZkmVF0oQ5mrPgX3DvmwJaOrRbvFbsPYpMEYiHYcw3JAJntX+1C915OBWLMFrdbM681rDoX7woMhOAWjoYrl4gLhSQifBC76e/bLyR5ZUPopZHZS63j9SVKcQx8lemTBjYy8lDpCJRF6Qmy/G1VIA72mI+T5urxOumXbIKQtv994YowISqOV4UavYV5ce4J8JSukqHiWF5/1efbDOUWLuOJiVf0QkM/v8pDvlpZYbTcbBSvc/qV9Gm7nD5oNEmI9WneFxozZ1fIqVeqV 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 zonefs superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Acked-by: Damien Le Moal --- fs/zonefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 23b8b299c64e..9350221abfc5 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -1128,7 +1128,7 @@ static int zonefs_read_super(struct super_block *sb) bio_init(&bio, sb->s_bdev, &bio_vec, 1, REQ_OP_READ); bio.bi_iter.bi_sector = 0; - bio_add_page(&bio, page, PAGE_SIZE, 0); + __bio_add_page(&bio, page, PAGE_SIZE, 0); ret = submit_bio_wait(&bio); if (ret) From patchwork Thu Mar 30 10:43:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193872 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 DA21AC77B6E for ; Thu, 30 Mar 2023 10:44:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7EB8C900003; Thu, 30 Mar 2023 06:44:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 79A86280001; Thu, 30 Mar 2023 06:44:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 662B8900008; Thu, 30 Mar 2023 06:44:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 573B7900003 for ; Thu, 30 Mar 2023 06:44:47 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 324D21C6572 for ; Thu, 30 Mar 2023 10:44:47 +0000 (UTC) X-FDA: 80625231414.23.7C6916E Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf17.hostedemail.com (Postfix) with ESMTP id 20CBA40003 for ; Thu, 30 Mar 2023 10:44:44 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lsFnIr8C; spf=pass (imf17.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173085; 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=WXkJDJqTCv0Db2aR823cGfOZaDqrHbaHORfxS5dBSZw=; b=qUBIK4rm2jLqrzutoB1GaCOWDsSjaL0tauEbR5y5PHm3AYTR8tGlah9InkIwElMOO1ZDOw IhvOs80XiKpZWYXd8+YEeg3oAyqGZNQIG4YPV8/SSNdTnpJg2PbK6YYsLKjSnToIG3weZH 43bqKps6ZqsWBTeRrFGcL01PIiIIxXU= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lsFnIr8C; spf=pass (imf17.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173085; a=rsa-sha256; cv=none; b=h6OpUQ4Kz8GBPY/JqipymLLQ+nkTxbZAoWvzmbtusHyqlLW2/Ri42wY0BJ/+05cyS4j0vU GPgDDvbh5kNjJahY7g+B1YtN1TUpddhoH1WFTtyBEVzul5G04USvqf2EeTbWm170N5B/0/ H0ornY9pC7OIqvEPCYs8FlXof0IEdK0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173085; x=1711709085; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RHMrIgXLZtjmRd+5c9MBnc3q/BEGhtEER4XpeifNGfw=; b=lsFnIr8C7uu9Arieojcb2ZlNnsw6nrTS1RPUQpQ0g8qnGFWnAAqPup1I Z2xtKghpuCeod4cS7aFS6U5ue9w6lWwd+qkiSDXOoUb/V/d69eit7RxSV Y4TFCqFkXT1J/2sSYPHVoMUpD234ziKcc75iwCmtzA6Wmvk6nPhdpxfAK ceArj2GayOt24LCU+hTOCN1UtaH8MOtVxcwjqTA9xsNg1P6UVQaUK6XR5 9uk/gZbvSRhn4BUCqws/Q4ZUurKwni1wcOa8cyovBpTpdXZcrgjFmGjva hsPSdk5j5rV+MxWAmQjuqZae3yM6Cl1KHt/7RoHYqhXDrk92XTNhr9iaR A==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853956" 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; 30 Mar 2023 18:44:44 +0800 IronPort-SDR: nybUrECD97FvLUa+hJgrsDnFBDIyzXDYifrGniijxBo0+mh0ycKV/osknhTR+kk3QeXWRj2+ql HwDRA+pVC5aZpV/ZLQS/QeQhXin6ddF8V4+/YPuNq5FI/QfDpc43v9m/U3NWLTR+TUvzv5CwMT 0uOiaDIu+xs54PCDKKBlftpGpfPFBr/wG2frc3RXjEKLB67r2W/aByUkIaYtPY658qUrN5z6z8 hpA5qCVTllCVpiKPEXTbk4vLp5bKyXDq0pmznDat40p0MMAKQCSg84N/iPUV6W0nZLr7KdZSZj sB4= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:11 -0700 IronPort-SDR: skMtz4+keJr/cRyrN9pwkgS0ewLiSNPb2M9dHYXrhuJ4g5fW5pyblL2I46HGHIXXc8RzTaSiVQ vh/QodlyDksqLq7Dbn7EODH7rPaYpLyeTet6XndzDCHJq/UDe4ACMF5fuQcuF8b6PngN7P5WFm 6bbx8cI+1QGvEI3G+Itr17jIH6UA32wollKGVJ8Lv5OT101pzER2Ix5fj4DLVdWgljSJSJ+fAE pfT9r3OX9yQGbEd5JejAszDBVE5RDoC09pcH9t7rXTz2l8qBWAe6vvY/LavdGZzoCYiQnqJYAA 1/k= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:42 -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 , Damien Le Moal Subject: [PATCH v2 13/19] zram: use __bio_add_page for adding single page to bio Date: Thu, 30 Mar 2023 03:43:55 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: hj8d945ouahy15hymaduqs3jmopk68op X-Rspamd-Queue-Id: 20CBA40003 X-HE-Tag: 1680173084-439085 X-HE-Meta: U2FsdGVkX19oBKdF2v94NBgy/t8JXR9wvznHdyI4yl0oPRUlFlc0JT0LzbJY1DbziGEbnMwdAscCaB+aJ0Oe3tZj4zU+deoabjF3y9a6LiuqVVzHE3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6yMoqoFjezD3n+QLe0dt9vtSqQ4Az+VbFVMB+/Th7E/5iE26YSEs+eKvdehTj6iZcTNFvy12qra0n9yXWdq43WYGuRE1noY2VwwrAfeRjYahH/fic+II2kKuKcRoTpuaY2rEVQnhVA/T7vcPUExmj/mQAVzUeel+Wdsj0tAlIT1dq3pjlJ2pYT2UEdTSiYSnSAVSdW/6qiYKu3f/Q 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 zram writeback code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index aa490da3cef2..9179bd0f248c 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -760,7 +760,7 @@ static ssize_t writeback_store(struct device *dev, REQ_OP_WRITE | REQ_SYNC); bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); - bio_add_page(&bio, bvec.bv_page, bvec.bv_len, + __bio_add_page(&bio, bvec.bv_page, bvec.bv_len, bvec.bv_offset); /* * XXX: A single page IO would be inefficient for write From patchwork Thu Mar 30 10:43:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193873 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 BDF91C77B60 for ; Thu, 30 Mar 2023 10:44:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6162E6B0072; Thu, 30 Mar 2023 06:44:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C5986B0074; Thu, 30 Mar 2023 06:44:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 466996B0075; Thu, 30 Mar 2023 06:44:52 -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 3711D6B0072 for ; Thu, 30 Mar 2023 06:44:52 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 12C15806A0 for ; Thu, 30 Mar 2023 10:44:52 +0000 (UTC) X-FDA: 80625231624.16.BD42221 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf28.hostedemail.com (Postfix) with ESMTP id DABC5C001F for ; Thu, 30 Mar 2023 10:44:48 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=XqSkglRB; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf28.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173089; 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=fGRF54MLXE30iUocDfCg50WtLR0P+nrfwKigypL+nw8=; b=Kr1+7M4vzFHH+7RMyFvMXS3SLuRuqNOjI2sqRU5hGsgP7opAZ1ZorK2AX3chzyx5wqUbhb PMKrm0xm57eUj9wtbvKXIWz2wwKQHHywWxS6v+EcMEZRB1lslIOe4HN+dZfdthGlYOOE0/ 24i0Nvx+GJ3kntpSopHfzNuD1qceAyg= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=XqSkglRB; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf28.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173089; a=rsa-sha256; cv=none; b=hWOefG4W8Yc6BNBk3E8daILXWY8WF/08LvVruuIQyWOoMKKty/TWjol4JvYp2xBg/0aFOV /ifKYj4KltBF6faFvb8zJ8m0qd1kg4sbX3ao7veqlfH0zkPNhmJw1hk6Bnn+ZexnwTTpHz HsVXJSCLWrB6etnzFaHMedFkxzwE0yA= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173089; x=1711709089; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=b77AEY+fFVaCfrBI9YuTDKawey5CeI/SslH0xXZFoZw=; b=XqSkglRB4nL5dpccuace60OQ18kMjUdAoVJMz103r9HlTsIgjE8DtULz Xk13CMDf/I3SYiqPBseR/94au0p5wF/95EtszOtGC1ezs5pkb86e8mg9q qNrVTMjtlzbHoeojGhQmgjBOqipZoBDoMgU4aV4/3v2rRUWNp2WT0vcNV jPHTSxaJDouQbD9Kkg1P2Uy0yxHCqhKAnonnNb4SFGKKCgRw+GcarMOM/ c5pSlt5CZmhPb3cmRjQXMfd9kY0AS3JvHvTwZq4e9KViz8sNBi1FF3UWr sXryXBqltzpvdVgFwXyOalJbRocwHTgDrhGi5aL39P+TZ2NA0I/mYOdiw w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853958" 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; 30 Mar 2023 18:44:47 +0800 IronPort-SDR: opx777Z3iCqKeEfVbRVd/JVSO97D9xq/T/dHCEwHKjx4QcxfpycaUOEvcHyx0vJgmVTjmATjXb 5H0Y1wxWszLum/Db0cZuenTndhMAY1V/8y3TGvH+x5m2y+xcdb+cubh3o9sW3g2WMjuiBpGT3h ZY5xRcbN0BEEyBXRRxwvg50yuGXGYlKvUwAxFIMlgRFDmlW4UvO+2j/5+4A+x+5B6cjFUpxObT kuTtx9/KH16HmGBA9MgX0JBmqgzqyeo3g3FiZRYR5Xjftrm/KYyLOxEzI113vAEyQhQ7+1hWMo 2uA= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:14 -0700 IronPort-SDR: bPTbKVKtlEcHRrx/gshidhFG8cTmJ7BMiKZMBOrx7BvqKjv6JDBLA7DtLgnQ8cD5tBy5QB4Li8 EChWA24CGnvJ2Bor2+MClUrPy+r+I5aXuZR5uVZa+29PcBU56ON0tvsmmOLEdtLGgyfwshq8on uLUa5y4KbY1OsCGTLPOq9tHpy9dt3I1YsfvmNS3+L0GgTwHGeuOWfftTPpLJxuguO4KUD7Csdp y4baPtiMCCJStynBrqY2vXX+RwLmiiCo6Jnox1p4aCnNgMOXQOiTLaht7Zdw65/ETNfesjB+DJ BFM= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:45 -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 , Damien Le Moal Subject: [PATCH v2 14/19] floppy: use __bio_add_page for adding single page to bio Date: Thu, 30 Mar 2023 03:43:56 -0700 Message-Id: <35c82b6fbc054342cce6a2084707bf3866813f33.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: DABC5C001F X-Stat-Signature: skeb7e43kydf4nsn1j7qx8d48pxmutdp X-HE-Tag: 1680173088-258288 X-HE-Meta: U2FsdGVkX1/zM8LJ7swdi6Cgaf3pwzjhsklpMmKnm3Refpk01BhEj6Or9MH1VDY3ZUTBn70THU4lMWsOa0zUCcE7h5bVuEZniRzhBeD44QFeb4NKhPZdUgwgd4KVXIYOGd4fhITzZmxuX/PtJA9mxJcoRiviXJzGCT9m01yYLS6rnxGQDaW0u4IaR3SmI/MCKqm0LmqpTZV6aQcolXPbr4bxX9Zzm8YD3r19ZcpGgYzZvy2SsBgEF26KgpgpNnWkNz8Uizq1bIA73r7U66k4uuxZK66H713obIzth2bWsWOsfknzk3NZsQCaKjqHKpEGzymcCQ6uqNoB5bG56swt1+JvjpmLkL9U3GpaWZlkfIcpfDYAXt/G1dnbMUTO1Ggipv/a8Dbr/Is45WIQZTx41wKkP1mmrV31GLffYA1l+1WLsYymH26pKWwdQASbcAFu28RA7UiL1ZTIjr7ZisKZ4ve07XiRHyqEzKFbol9/kv/CBSh2xko+ETZyjkH1cTOIGE9DHSeBx6lxkDfqOSLEhCVxqF2Xm48X/fV+SidQl3BkiCcUSlfuESE5Dxm3z3bnPaZkinLlQJk9g55lwQscFwNmyT5tUcXUJNu+l30bYiu015MED6lYzkBqX2sBzpZlwhEOrWH9TVrFZQhaBVt7Zb9uot6lL7SmPZZLXKrpUCkWad7gSfwXfS36xj0wSkyikj+S7tyyuKOcqiwZNw8qrRbHen5pNb+OSLQHYCgcmD4p2k9QW1FarfC7jU8sPYxVJhK6Gr3YZmJDOpu4D+6liKboiocak1Mz27LkcEtL1DGAWVFbSG6rjWShAPiT+INZcXaS54q0qoNM4QivyGXiqTstQF+krIj0hqL/wWG/mG3CUHOvGxqGA3NsZ2a+aoAvEhxeUNXvVZdDOxa/k1jTbGDP1P34n7EWbYvtHEGwS9gzuPpzUog/uHdI58Ghe9orLR2c730xzT9s9ypi7zZ UIhB9ozR LNYP96fwFo4LJmnM7bka6m0NpG0fVXFeNFsRgJJJV1208q/j5XrxxzPWqnowfnuJasf/4JNXEFUQ5F7U/qCJk4hmUlvatszNMFfckDxTk94I+riApC7BoFGxA9UP6ZwNBUr+y6yrWkkbnIRgQZgkZtkd2JNQyXXlMbNEOfZdIMBNN6tz9iVOUYKDoczZnIjh1svkAK0v5jvJpEPKZV5f/U0/JewT4nHcQKbjmaswhlY3mSsFzQ2RsV755IozFG1eJ96tGvS7BC2BjzXp885o7Yl3/7ZwCdH2+saxBq2YW18ApWvXMcpKjxZBTO4AddIYaMCo2naoRh4nAhh6zftE5JVZzEz/dDWkaAJvpocatcR4PbbMu/eemT7ggpfNtDc66sUK64NvBxjF7NZkVUZ53h7hw0L/SJEmynhN1 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 floppy code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/floppy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 487840e3564d..6f46a30f7c36 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4147,7 +4147,7 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) cbdata.drive = drive; bio_init(&bio, bdev, &bio_vec, 1, REQ_OP_READ); - bio_add_page(&bio, page, block_size(bdev), 0); + __bio_add_page(&bio, page, block_size(bdev), 0); bio.bi_iter.bi_sector = 0; bio.bi_flags |= (1 << BIO_QUIET); From patchwork Thu Mar 30 10:43:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193874 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 01603C761AF for ; Thu, 30 Mar 2023 10:44:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9BE95900002; Thu, 30 Mar 2023 06:44:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 970186B0075; Thu, 30 Mar 2023 06:44:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 810E1900002; Thu, 30 Mar 2023 06:44:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 734626B0074 for ; Thu, 30 Mar 2023 06:44:53 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 34D141A0887 for ; Thu, 30 Mar 2023 10:44:53 +0000 (UTC) X-FDA: 80625231666.30.9182BC9 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf28.hostedemail.com (Postfix) with ESMTP id 1A5BFC0017 for ; Thu, 30 Mar 2023 10:44:50 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=WlOcPPg6; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf28.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173091; 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=8xturZmyswgVjBaYoCYw3BEHPK427U7V7Y+R3cQKPzc=; b=UeyC+puL3GncvpM/bmUlhzQLsWQ3uSQtC+fT6SYZ7TCzqb2z4GrHJcJfVuLxK8lNzkptQ0 wekx5/1t2Xz8s32yvKJJTTsxPwomnbUVYK1YAk1fOzcUpLfFzStQgnJBO+vNC5e0XNY2kD 79OnlnWNmcji80ac+1HccbeZrZKyMVQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=WlOcPPg6; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf28.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173091; a=rsa-sha256; cv=none; b=PTlUdVc11iPN13Ydb+tGkRxIyTrfdGmvXT9VBz4X3OixygP3WFDiuoPjoLEPq8fLYz3KZ5 SAAqTVQkQSDqEvSdyB3pTmuIUMsl1c7X8YrV81o726/tFZePrCWTpnnD24fz04Xzkp/Cz1 xh11ug9m1sXlFgd8W0pO2YMPfIBmU+U= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173091; x=1711709091; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WuVso3FIWpTS9t16blIu0lxfhGfBw7QOq0E/ZSZkofY=; b=WlOcPPg6+i+9B+/RYW4JrjSuMBn+t3tqi9J5yXIqk0Le0u2rNSbzDNDN 3ODDJdWaWe7WGdJmhwSDYsDY97urDh0fNhMZzPJP9yGYdva5eqsrho0NC m71F0Y1XL0/oFDMbJSYP0BF2nY/SgYtxEscDYAKRNaRV82IO/BTN71Wgu GLCxHnMUPQLPqCvruN/jF1s7DeI2UpbNG1rGBUULSbB/Aar5kYTrwEsrA d52jVanPxHjTBDNbk4VRpxyOAXHGVKG/bE8COCiP9gQyAjh3H4uC02XbN KlCPpcdYuCHM2fdSNwAnGA/Ol6ZRFm3z8eMYTkRFoDLbuh8eR0DJ/XxT4 Q==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853963" 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; 30 Mar 2023 18:44:50 +0800 IronPort-SDR: P7RyHr5Ng/cpjgbo+hYFIJ0BYTe42f/XYl0fDs5e6AYK1bLjlyxKKvUBzrYzSZKv4zkjy4XNqN pu+GQ80qkTDRAD1hxjvEv7B8OzMG9e0M3/pBoFP+0FYG4LoVkDqMHySagqS8dfwEhGUHOBBTLi yRXh91t8INPhZbHCjbwOIGYcZhGpSum2+DmE5a8YECNcW+1IQmShrkc/qFSLFs2ioeoNw9El2B 5ejjc2WJKUjLqGCGSRbVGBYCnlJ2hzyJ62t3dxKeU0MBXPI+YUGrkyTcMUwhoktE+2mAAU9oej U7g= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:17 -0700 IronPort-SDR: xbv9CWFcSC1Bzpr8BamikP+86dncbp6oACJBXmhmSmN1KLO1tjzjSUny6VIcaXoUQyq5sWcuL0 lQBuIK9Qs8v6PE4kuNsKWptmdAB94A57UA5HBiwUoF/UZUfY5X3vAWQoHSh0h+S/n670fLweqX xwW8OqqSonBv72abzryYNSV2io841vwnNZJ8IY+0p5wqBENYMfSLK+JpFOg4uVtqcWWbcuN9UN kEpt44p6/oIeo1ie9PLw+xd46a5i05H2OEhI1oKUgM+t3BiQfepTKLv5GkNzpVe2yAChE6w07e +JY= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:48 -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 , Damien Le Moal Subject: [PATCH v2 15/19] md: check for failure when adding pages in alloc_behind_master_bio Date: Thu, 30 Mar 2023 03:43:57 -0700 Message-Id: <07ae41b981f1b5f8de80a3f0a8ab2f34034077a6.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 1A5BFC0017 X-Stat-Signature: u9kwc1gi65z1eeum7zkb7s9i5wbgyau3 X-HE-Tag: 1680173090-469816 X-HE-Meta: U2F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bVJqUIRrmtCfJKepu9H1l9tTrTj3RLlQirGBTTd6hw7tAZPHkZR//v1Mhr1p7nNqDjKfMMbJsn9JP6zvEdJGJKoWGeg4zf5i63tdm8nd7xkbSDtWMSL1as1kdNYJbW29eaNenB5VdhcpUrW5dV6ec4o3bEo6fx0dD4agy95D8ZrDoxzb6ugoW0fWQU92Z+4aYINPndr4xOUtnTCOR2pHGFewksj6Pnc8mYXtqqxN4XOp2r8ieTV8I/njCRf0bXgzdGrSi87nGzFakA8fEUoii4aQb7VytADRWv1E+hPD2IX2CexP+LU5ryN66va9lAxEto35sZV4jNClkQ== 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: alloc_behind_master_bio() can possibly add multiple pages to a bio, but it is not checking for the return value of bio_add_page() if adding really succeeded. Check if the page adding succeeded and if not bail out. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/raid1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 68a9e2d9985b..bd7c339a84a1 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1147,7 +1147,8 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio, if (unlikely(!page)) goto free_pages; - bio_add_page(behind_bio, page, len, 0); + if (!bio_add_page(behind_bio, page, len, 0)) + goto free_pages; size -= len; i++; From patchwork Thu Mar 30 10:43:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193875 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 DE788C6FD1D for ; Thu, 30 Mar 2023 10:44:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7296D900004; Thu, 30 Mar 2023 06:44:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B0936B0075; Thu, 30 Mar 2023 06:44:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 550A8900004; Thu, 30 Mar 2023 06:44:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 47EDE6B0074 for ; Thu, 30 Mar 2023 06:44:57 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 24E391C6090 for ; Thu, 30 Mar 2023 10:44:57 +0000 (UTC) X-FDA: 80625231834.26.E3AB1FC Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf13.hostedemail.com (Postfix) with ESMTP id 20CA32000E for ; Thu, 30 Mar 2023 10:44:54 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=SBcf1dAP; spf=pass (imf13.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173095; 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=V0jPG80dy4YOQg256dCn8ko7STdlb+pxF3jtDwme0LU=; b=54kT/e13YoVE2vFDZnr1x5F05DcFx6FsNjcLmFpfXKN9sG0cncoCvHNjXP6tIvQc7kG5SB uJE6utQraGEipWJQwEFH/ZpFvvMTVu6V8TrnYWveS19n1xcF3IGSLde49NhB5xrlCZghT8 IUjarxf7dvkIg2OEyoPNeXBIqkA40TU= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=SBcf1dAP; spf=pass (imf13.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173095; a=rsa-sha256; cv=none; b=lqKWLA8fItOYcyCVMeBjH2zPtAVjtzXPV7hjvkCbc8NoPsNfrSkAlRSQiPeYOMeTkncmSO BpMxix8bMcq2Clj+K9IT5C7gmudiqactE0Si1Gwo0RM+GzZ85f3JLfNPLsUbtyJ7HMRqGt 29jquwO2iAZ/cInzlgtbSWXQaNznvMk= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173095; x=1711709095; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oL2U/g4EaJMTT3671h8rphk5MC+hx36IPn/aySLD9mI=; b=SBcf1dAP2uZA4LMsNUCn8bcFqdRUf69pqS8UqeiAZXmj69e6zwspuxaR tyV4+wQeZNe7L7U0ZUNKPNkcRBk0Vcrmx37PayLVLl1X805QWqTLA3cIt lK92jeKV9fB5PRF6T2aAWIlI1nG14OR9ttyOxvCnXXJxmO9jxhDuhD4/O OQjzVJd0MorrMvMAQS77ZB7NZpGBtGfL+EYikhTh5/8cgl9inOe0SVWhN bOkf3fEgnyZWU8zjGK+NnFj1yxRg+yWPI7eLCLItxxy/YfDYo5b1YEGvf QkhDknx09gqpAvNQI1nKKSrkaiLS9V26C6TR1eUjHNtI65Khuv3/roIsk w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853981" 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; 30 Mar 2023 18:44:53 +0800 IronPort-SDR: P9ygv59cpX2LEvW97Pe/Ogte5Y+pCgM9jbbElUwVF5O/Acqf55fvBITb2c0oIa3k696qU9G/QQ GwrI0ebETzCMp122SFsX4dv2a5MmqoyEA4P6fWxGip5pqMUHdr+7P3qLm9Ni+NrXejUCxuiF/m QQ2ktE0Y2gec/q11TsC6ZyM1TM16HF38x6lNf6zu5yYHgsxt6BRCNrzJq2+V7SJb3sE5amI25T lKC2RbO7oQME20gJCjrdvEziuQw4NGN6Q0iFgMq0ePavierGmELL1D91eIm9Vg4yO/6XctA2Um S6M= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:20 -0700 IronPort-SDR: CoMzsHiAS2JR6nHz7NkC2bnUoQ56O2VVvllRrO/O/vDND9erWG2x+0sd/n32CtrHJXq89I7Vpx 3yXADu4Qzn1egGoPoaR5LOqXgneY+WCGslMK0kk4RtBPu9UBwrphetuapusHacgSbZc/GjpP04 rOM2hwuQmwq0JHF9BBbZ161hAs47W3Bw7eBGyL1xrobBRYyZFBMncwXMAQ3J+2GPapCugFKR9F g47K64zulVURfvgH0krXU+jb73cw0ekyXDiawSnLCfzfBr1nZC/vguolrUE0Kyqh7/cxMzE5Dn xv4= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:51 -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 , Damien Le Moal Subject: [PATCH v2 16/19] md: raid1: use __bio_add_page for adding single page to bio Date: Thu, 30 Mar 2023 03:43:58 -0700 Message-Id: <4c9eaedd34f80d3477a5049f49610a8da8859744.1680172791.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: 20CA32000E X-Stat-Signature: 1qwmq3ttmbt63p6ksd88k39a383f9tio X-Rspam-User: X-HE-Tag: 1680173094-683233 X-HE-Meta: U2FsdGVkX19T4woLDxcM01/qb2Ly0+05uDGig/jUhQ9AoynZVuKKxPOl5SmzOqs9VA7w+WdWLM2ls+S4mYCz18G9JAykHpD/dCaDdThwhLun9oMOuUw3AgYdm/EgImPSK9U3ERivkkL22pf5dPTF8Qihx2hbTkb34Q5FJLQ7gbjQboDprRCRBFRmlVJj4KgypYgwIs34N+kI/BQUv7mAHfgjsiGnAGmKorrBcqg79hjGQ99MzbpkFdMZYfLaceGdcxelA7YEhhV2fb/I520+be9sGJJ3zi4YRN+j6rvxcAOo9ltI+894zD/Wj4gxFJaRAec2YjoByISBlqjdAzVten8x6qtk6Fexj+n4KB/0KmjusFyQ8Q9jvAVPSkj3mubtINg0EmieJoBXAI6k3CRVF/YcwGNrwEXpnCL3AaeRDpp8VJkGNhmgFk8458WnwJ8KQz3UdDig6URaawaNoJRB2uSdHz2Yxy+P2/I0x9hymNQwVEUeODh2gXMJI2QNWoVw0Yl1XRaiAw9MD9tRhuemL1OPqjXE5BGBuWuehGlIcOE1GzbKpre9GP4NNojCZN8sg0v2A8T6EKHMyACvGhEZx5+vrnUM5AvNIzXu7y8fIneHyvI4SiTKrYQgbrxRmjOl7rUrv95wJaqcB/uNPB4OZPQ9HwKt7s11w9RNtQ8UQfOG8wkjcFzA/INnK1n8o9lhda4/vscvUmldlf28J9KgXwQjfwRbAjHRIGis8fiKjCdFDs3VqSFYVq90+BJYuwO8RoLTDFGSHqrzduZlfeyurI1gm0yF+dLbMfI6Ody2E1wg1/X2ZlathzwTLCEi7a63wFcKJHDSUzdVv0dpDclZ5hvqPuWiecQjJBjtENqX8ujQZE1iFXWLWiP28PTye5d40kBc1MBW4LbLb5UenbK8LAhFMNy3ZKQNREuWhggotKi4tIWbWjD3uAk8X7yJ6HuLM5lYHrh1wG9X5/0Upbm XgMdMj84 MwlNkHU2AxW2hQHpGG4qACpRkWGxfLucSMyU4LT4bhYrSZCV4mw54HGRIvfGyY56rPQcS25o2cGMV2CTskiCWj/2T9eumcbmm+UZ0I/HLyh4Xmhbyi6gO6aQIxgGR7ZUJP9lpcgxS8g6IYE5ctxUwGFKME5s8QBS8DDES+fVRaiKTE+3Nc+oJbKlcTi12TqcFeuLi+zHSDd1bcqvakzBVYRhXQqc4U7QJwRGcmTLsnuxbH4FN+IgCyBryeMTonbbjGj0RC/K4qrKxcbCNdWcUXefLiT9c21+ae63Gn9+22RHNkvCDzNK8o2XnhhhnG55V2L+cTwUJGTnUdBmuhBI9U2LOQimV+T0q3sKv6A7eX1oSGSLkN28mfDmJAY6FAfyi5ue4oW2BNFa19A+nIxoKeN1cFJPplxCNqA/Ej51UZiW7aR008Uz4f2TTmg== 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 sync request code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/raid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index bd7c339a84a1..c226d293992f 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2915,7 +2915,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big * enough to hold all these pages */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); } } nr_sectors += len>>9; From patchwork Thu Mar 30 10:43:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193876 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 2D844C761AF for ; Thu, 30 Mar 2023 10:45:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C56F96B0075; Thu, 30 Mar 2023 06:44:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C0803280006; Thu, 30 Mar 2023 06:44:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A80CD280001; Thu, 30 Mar 2023 06:44:59 -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 93CF86B0075 for ; Thu, 30 Mar 2023 06:44:59 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 71E251604D3 for ; Thu, 30 Mar 2023 10:44:59 +0000 (UTC) X-FDA: 80625231918.05.AA439D1 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf13.hostedemail.com (Postfix) with ESMTP id 52BD52000E for ; Thu, 30 Mar 2023 10:44:57 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=pmb3YUMv; spf=pass (imf13.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173097; 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=kWMGAv61+yAd1z5ZTGvDj+c4NVDTPEzDg6G5r4GL3cw=; b=Yhx8RSdmurAeciUr9rHUiRIYHIlhFjfIGcMu6PCbxXvEp19VLMB3tSMhS1RZVM0sjLcHej By3KZUz82ma19Q7K25Ozt8hJIpqnl2ehbGYEbXgh3wGql1o6zsmniAaTVZzefisHed5lYb PKrhK1dg5RP2XTdsfEX11WFqh2xTg3w= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=pmb3YUMv; spf=pass (imf13.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173097; a=rsa-sha256; cv=none; b=dqaghlxtwsKtTy5wYRF/tSXKAbDEiLL3izD1Zn+UQnPpm5Ket4WADPO6W7UJH+Bpnq3q/O btfzRw3deKgSObXs3qZiObQRmOu0Xf9ZoCK+TNNYcJRPRDT6GGGoE7hTld0m0WNuAKVQ4c 3MqypJJmktr7wjHwxNPI2w5Oyqv0eHM= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173097; x=1711709097; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=x03Tj5t21oFBp5hacmwnIhr612M3UR5L9WbzmUXqvTI=; b=pmb3YUMvMzVaUGKESeDAaV9FWA+dCIXeEclmhPZb+61aHoVRy5H6157t +OdfQBNrE+zda8F6c4hg3lzQcj9tcuq+ldhGe9r2/DZs52d6LwjPt91If PSQwb9eS4hwFX1gcpTFMyY70dcm+WJR6GcooVbxEbW8pSE5y8nCHrJ+RK wdlfQrDlgduEmlZf++pytvh5LzntIo2Hsr+NuPgOOBnMbplStvI35ciC7 ftYooDN+dZN1sJ/Sj02RacnwDA9ZFqitylAmAc8xhG59mBi2U08P2lUff TuhufRY/7BEj0HTGEQJKKfUCdP5dU0jkpVfihQ6TuFfcRa44CBecKMdPM A==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231854000" 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; 30 Mar 2023 18:44:56 +0800 IronPort-SDR: ziZLZ7TSbyhxviyOv7W6PTvmP/SKkd/GdT7btaCW9ISAYQl/02oUa0RDguuD+ssqQI+MT13OxO b8SXEOBIYRjRp6YNhfFf3mvwoS4E7JakL+zAzFTVZC52Vxg+70iEUglHTwBV2PPJYRDiZFbwxz wkl+c1B9bhW1FeLoYP4tSe2i/knaMWAshmlKLLp/t97RzJSnq+0t+SwwYGiYYMXF0ChMF6bloZ I/IoPo6+vQd2zquQrIZIXeZwO5ZxrhC09miFEVvXxzp+BAD5V8j1y+eVAW77hrOVa/jkDgn+jJ zM8= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:23 -0700 IronPort-SDR: 8tspoTXpxzHmClJsQZ5bC1hIVYMWR7fxHmL7Ag12bGN2b1vX5dZznqIk1xwQtM6kCQBYt4ri9+ uDLHirIHJ+4DA1NFYYbUnI8BA/QPlErIYOwpzv98UE2BAm7hitWSquPo0TfsDDIyCATLOL07Nu HLS4fBI0QUHTKCNPkR12ymqUtn6Ain+2OW6y6kseY1SYoKAuFCRZt7zXjgTS1iH20DB1vpnG2p B++q/+YMWpsASXZesODVp5hf2KtcEe8sIoFQNuEb+V8X1xKBHnSJ33ZRqIMSCLLhRGlFncgf4R lH8= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:54 -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 , Damien Le Moal Subject: [PATCH v2 17/19] md: raid1: check if adding pages to resync bio fails Date: Thu, 30 Mar 2023 03:43:59 -0700 Message-Id: <8b8a3bb2db8c5183ef36c1810f2ac776ac526327.1680172791.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: 52BD52000E X-Stat-Signature: sfcj1zseyjb5gw6nc57x7g8c46ercfp3 X-Rspam-User: X-HE-Tag: 1680173097-102061 X-HE-Meta: U2FsdGVkX19D/rOMeFjI4DHfs7cI5xC5A6+3FgzCL2r4h3KMCbf1Nz84cm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XWhiXZholg+g+0IlQryMb1RmKxwSlFcfNVFqKjYb+o/YkhJJGtKzK0Fj2jpR7vziEo9yQ86IKlVkXJn3gKXWpyb3sbCcmwa59oFh4E6cIzHnBAN39s3FRWyA/TLTNRGk52u2cUJxYkITdQAI4jzJ6HukQ4Rh7+Egd3njzW/auu2F0kl5sAGSndVZGfnvdC7/VKxMCvs+q0IQXowSLSOzRPjs9pT8F0CBRJYQJtCiQ4fdJoFNP0nVndA== 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: Check if adding pages to resync bio fails and if bail out. As the comment above suggests this cannot happen, WARN if it actually happens. This way we can mark bio_add_pages as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/raid1-10.c | 7 ++++++- drivers/md/raid10.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index e61f6cad4e08..c21b6c168751 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -105,7 +105,12 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, * won't fail because the vec table is big * enough to hold all these pages */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return; + } + size -= len; } while (idx++ < RESYNC_PAGES && size > 0); } diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 6c66357f92f5..5682dba52fd3 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3808,7 +3808,11 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big enough * to hold all these pages */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + goto giveup; + } } nr_sectors += len>>9; sector_nr += len>>9; @@ -4989,7 +4993,11 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big enough * to hold all these pages */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return sectors_done; /* XXX: is this correct? */ + } } sector_nr += len >> 9; nr_sectors += len >> 9; From patchwork Thu Mar 30 10:44:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193877 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 81FB5C77B60 for ; Thu, 30 Mar 2023 10:45:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 244926B007B; Thu, 30 Mar 2023 06:45:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F596280006; Thu, 30 Mar 2023 06:45:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0BCFE280001; Thu, 30 Mar 2023 06:45:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id EFCF86B007B for ; Thu, 30 Mar 2023 06:45:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CCDDC4017F for ; Thu, 30 Mar 2023 10:45:02 +0000 (UTC) X-FDA: 80625232044.11.48C15B3 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf26.hostedemail.com (Postfix) with ESMTP id B7815140013 for ; Thu, 30 Mar 2023 10:45:00 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=oJogWosW; spf=pass (imf26.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173101; 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=2MNTZ8hIqQZr33tFK5vOCN2kPp+OQOLapHSQ9vn8FYg=; b=dPmeno7jlJpFomPgK1c8KxCdZNfj3CduQ0eXx44XK1du9tRaVbVB++cs9/p3D4rn9QEiBh wwoHaXxAG+xNJVSnXn0jIxS3U87D+M8Wz95NA8ysxRukD1vt3o3s2W9ogXDCmrJO8l6KJb PXhZQEF3wXFA3gaOJ2F951B0mIQQjXo= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=oJogWosW; spf=pass (imf26.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173101; a=rsa-sha256; cv=none; b=CDp5mLbbmyL9ov52AgzB+VnAR2DWHa7zFn/7yQsu2SRsogTWb0JIfCqTwTCm+f8+2FaNTH nZ5Nivw3OImRYa7X4OmI3mlbnqTDBA+hH7ytJubIGb8x63mI50BeMIyvcSeiVq9qp2sBjt nMAhKzudurF2dRT08VrC5kSUDYGhesk= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173100; x=1711709100; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AKPcab2XYTxKDTsHjq6NQ76PfpLzQxBfOz0TQbvI9A4=; b=oJogWosWEBa69zWArnhlDaUXfU9FQ9KwxzG1MDZZ1eSPefrvzsA18136 LBmsChvDIRZcuVqhY43A1ybXN4jCk6gvhZ6zPo+kEZD+xBkTsy76HHU9/ BoRz35AudN75aaZxmMKhol3QJVNj+puVjms23s3W/z03DvFawc5yYLbBR p1uqqilbsrbupJ8cnUWefqCWvUA3ES5Agoc36r1mG35tvmwyOIYQRygZ5 R8CnrBcYd6lO3rv+hUvxpPa7nNwxeaOF3L/Zi0nOiskvED+IjbWGVTh+r 72aVTL01tYlkX00M0gYALm/MQLTtqrTv7uXuariA/xCBUyLrIk4JiV6hs Q==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231854011" 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; 30 Mar 2023 18:44:59 +0800 IronPort-SDR: wp8s06sFAPxQScH88C+b4FfJEB5V6Ibs/Sd5WpRqj+f8fxzHmX86fDBBTt/wJYmWScXkWUr2mT /l0mwb6XiniRe+b8B10/qDls+QpErSHRZm5btwmkkG4RgAVPCspE3atVbRsWOWMxCExdUZTUDF Dt8YRcRgElXptTaNphNLo4rzB8KH2hsMYd5LyUL7nuLov43vhdynZXPA1nS1Jvw5108uiFKq79 lLB54W4M5vUkFX2uh76URHgPdTcbB1D1AfOucjviiPUW+7AwOQpTK6LRtX6eUL7St3HE7cbfLm xI0= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:26 -0700 IronPort-SDR: Uz7s+Dcx6yIQkvOUQB+fZBcewu2LBoSQ3pKR+yorfvauRCwyEfsemTaCli7NU9SOzvmIsB3Hts tNYBtX+nfuDEC5uXsXRcTKBMvdR7SGstEuCQUjhfSDF+BiYqMb/6WvHW+SrRgnWUnB48Q4E2C4 fbh8vMwc892YV531EYcZRUKNAzwNrgHgza3EAt8v4dtp8X3HEbGwrP9VyDAFzQUEaHs+TfI18c xIpJgsXVErH/79qMVG8Ygjlt4VP7eLqwzcPd+tJBQVyBPVtGsmWswAn0jdBYeDXDy1fyvy4CzS HRA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:57 -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 , Damien Le Moal Subject: [PATCH v2 18/19] dm-crypt: check if adding pages to clone bio fails Date: Thu, 30 Mar 2023 03:44:00 -0700 Message-Id: <84973c41d58473dd50324853fb88a7fcff55745b.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B7815140013 X-Stat-Signature: pjkoxzquaisdpxgt57jqnoexw1rm8u54 X-HE-Tag: 1680173100-18195 X-HE-Meta: U2FsdGVkX1/UslhkhsHley+lkCLmjHdM4D1LJR/NEppeE01EqZxapC0Ai95r6UCfudg8lq/h77QvrwnDMy54AQP8nYzmebR9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cBb762Sv+HGHvHYcSVZlpOIfZJx47E7xVMcF1pD6CM8efFLiJoD6EJ+pH4VSzPUAjqWa2YWnXzo3UQFOUXxQ0/JzlGOUuokYTLjEnbfjHC/wYD2GBrs04ngnKue67tjRZpeb9OfgoYlRJ3BCwf3gi9vuiRq8kcjD2GlR1ofe2b6u+4vJXZK/WZXoRuxMN0OssnyIoA== 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: Check if adding pages to clone bio fails and if it does retry with reclaim. This mirrors the behaviour of page allocation in crypt_alloc_buffer(). This way we can mark bio_add_pages as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/dm-crypt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 3ba53dc3cc3f..19f7e087c6df 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1693,7 +1693,14 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned int size) len = (remaining_size > PAGE_SIZE) ? PAGE_SIZE : remaining_size; - bio_add_page(clone, page, len, 0); + if (!bio_add_page(clone, page, len, 0)) { + mempool_free(page, &cc->page_pool); + crypt_free_buffer_pages(cc, clone); + bio_put(clone); + gfp_mask |= __GFP_DIRECT_RECLAIM; + goto retry; + + } remaining_size -= len; } From patchwork Thu Mar 30 10:44:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193878 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 BD83EC761A6 for ; Thu, 30 Mar 2023 10:45:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5EF806B007E; Thu, 30 Mar 2023 06:45:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48DBB280006; Thu, 30 Mar 2023 06:45:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2DFF2280001; Thu, 30 Mar 2023 06:45:05 -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 1AB376B007E for ; Thu, 30 Mar 2023 06:45:05 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id F207FA089F for ; Thu, 30 Mar 2023 10:45:04 +0000 (UTC) X-FDA: 80625232128.21.67E53DE Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf26.hostedemail.com (Postfix) with ESMTP id E259A140011 for ; Thu, 30 Mar 2023 10:45:02 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=QVPs8zR0; spf=pass (imf26.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=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=1680173103; 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=fmpnWNPMV+BqMLoDCsDPI2a19KpwiU9iA+gUwkLC9vI=; b=a15as4301HaptmpNjGwLmThfIr9AbWqPoBZOkBr8J91BZVr3yNiOOfMdH3UgQTHveo96ZD LKInp0GX3b7LbW3SlnCceaPNCkS10xFfAV1uQxrdseXhNw9Or7aOHyeKyJj6yfAAHzdYp4 SFV+DN5aRopVEVljXvpgs9cojzlb8tM= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=QVPs8zR0; spf=pass (imf26.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173103; a=rsa-sha256; cv=none; b=wCmstdN+QkBsvnhim+97Ea/o7lmSgYI2+gIFyBd4bUgM3QcHw6h/2ifztu/ecUxFdRmSa5 TIv1KdG1W9wUXSQbZnA+ILZ1RMgYzNPp3WVimBFyPWA0qj7J8xWfEgSU1eD3sOy+qRO82Q ttlKaes6TQPE+y+Uh8Q4dU4D9TQcOEY= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173103; x=1711709103; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9YnFTpWsIBbNef/OiYe0uKZ66yfnQqenOqdfFhTWuvw=; b=QVPs8zR0BRa2WNd7sJeSgXbf/Ub4AijvYOzeO3OIDdSlEeh8b9Cv0dNe JcSAh1DZcuzlIewcDv7euZxpJ/kQKMVVTbBaDsJ2PmSUhs6vFdR5pTJIX UETzXDN+s7VOI1HEjWLUjK+DuHhNgUrv3CTm9NaLstBb4Ao4tCn/jP93/ zdDAgkZuruFv9pp0e1zApAcdUxguDMfZwQuMrI8htN3gnh14MhyNqIADe 3+fvSLfkbSeNHYjfOE8PVz+o/ovNCus8pndpp2W0IN3tPm0v0UzkDNCmZ oKnD8iBba33e3AklwXP2EtZbi8W1FpV9okFmdu7S/8+n7hokUPewlsUPR g==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231854029" 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; 30 Mar 2023 18:45:02 +0800 IronPort-SDR: TE9T4NG0izGmDM+rQ4cQ4aq/wzpFhkLbXll3nkZu312MzdZlKmh9rDp5TZb7FBW/YFFxoqLzQg z8zVzEfOhgM0HumxgWwqUrakvnaef2h9mv13ZReyZQXnfvdWk14vv8QwpbzSde4TZMKfIytpSC 6uh8j+TVqMDrZvAZzlL2/PRUCw1/8MfKERAACjfNrf9Cf1IctDbA+xne0jf+71C3wuDlG4bskt jiww/aHGEi6f54La4baiuUVGXtiispRfCKKb9Ypzv7D5A6rbO6WhCVyYkZvwEBsWsOjwKuuALl Jg4= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:29 -0700 IronPort-SDR: 9/iVByN1BTBiF+2N/dyRq0R7dQSPqShiTdspahbVYlwZj+qd277O1HWwqfoLFDxzoWSe+cmGNO qkqMCZzgrdZnDhpQxYdEe8150myn5LsK8KEx5pL72+ObD0hqMaaHSizvdtrMKOqlTNP+VQELhc NlTnbrlHYwL6lfM55WWo+X+nqbpVvrNh8MXJJfN+oROGcrGXbtZ95QXnOLEHZI8U/WSie1EYFD ciM8A+htMWi8T8Q2A6kN9QQtMNJHy+EVASUqPt+O4sCYrrpZ40AnMpPDuYxlZJyUb2MJgf0HsW yDM= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:45:00 -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 , Damien Le Moal Subject: [PATCH v2 19/19] block: mark bio_add_page as __must_check Date: Thu, 30 Mar 2023 03:44:01 -0700 Message-Id: <981a2b8809dedbd6dd756d7af1df4251944f42b0.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E259A140011 X-Stat-Signature: nekka631gqoxgambrinfxc78as5u197e X-HE-Tag: 1680173102-708641 X-HE-Meta: U2FsdGVkX1/WLjm8z3JlmeUhSH/8MIjWwtn9eGfZl64uiOQHGQZiu+LVgNhQ3DWQUrdfAhdmaBfa6DB3n9dhTei0iIO95AMoYwwYQsG90uxcUW5nVMEZO6P9gGXWNjYhcqELxAuMj0bKgRo9n5fsEmD8sz7KYm/676dlncRPzF3J23JHzLkVqjtp5P45apGmXe8110ZJpss9O0MYSgvxcdb0laMspONXdrXMPuTPO5QnnlVFKgNazZWFrM19hVvBu76s6m4yUKvwg+Ksn23b0lEHamq8JiSnIuNCpyjanZz30iF1n5dUscCTcC0wi3wl/hpURxgGEKT0nz3jau3BmM6p9cHuTKiO956XHnVDlDoMP76yw4xbxCM7cbI7kuJrys6Xcb9gliQl9V355YYOtw/5mCEwlPL34LZiPap8uvDCZInYLbXEZgi29+pD7kW8l4vGwyIqu3T4BTTXcaTkIMlKb3Wzk2HpLCpMx7xMRpaOHtFnMiFQEtcX/XPs8dXrx5rTrDHephbssUnOTSUgcqZ+bFednh49JKDgTBlPBUZli1W3zkR4UCx9e4/iUsnV8wASdbIbULUYYJPgq3cE4a/In7grdms78G38QYMlLI87LatIFBgAJe4TFn5A/EK3tVrOocsuyo0iG3D4QA+x313v4MwzxFYKJLv6te19Xg5zOiG+M5QDBMTDu9LVfv+fFBfhYIHwFwXtI3YRs9i/Ffu/AlQyEvwVuzrjjYp+mG9ruXLJGPCn/i73gVMMhwy8syCe6zMAJN8qEBsJX2KGTiPAqptitI/XNVICVON6xkG7Kf8oH1VKL+xClqL6H2LsviHILxvtPbt6h9s4NPJpQrK9SprMptxXhx1mSM3Zot+iGGoDsnVOwt6ovh50De+/su2zEUjga2AgnbPmhniLfrMiqVapynPcmSWgP1ZpKbMZDbhX9dk4uVV7Mf2y2ciODdu/v295d4cCh7rbNzZ VfaXAb80 yZT+j6skuwECWJRQdRyQGfyZQZZPi9wPIGgcJXxn/caoQVd4HrXWEMF/Rlo2kJX/Oy/tJKwK/RSium4o3utw3CMH5pOpEDdDzoXh6ARqjfksROE2Zhl01rnp6LoaDB8+r6un9cFamJFkRAYsfj6Mz3sLvWQsmUI97YruiDvYBhBQdyKHs2ltWfFit82VKt0UR5hGvhyggwaNaUnikgm5oYfY7UUQJcQcwGgF7I6Bo93J+vpcz0cp/hbMz2RapxXo0BXu5+dGwyAgB/4O53Q/PEwtEn6sMLa03YCBI5WWE2mI1H8K/WLD0NpvzyqKQWlwtDdnMqCDcaZ5tY8vdYGevm9Hl8xTp1pedE6XprBpKSFkSJH3EWUH+lSkbfwSvdBlrnOR4vfA6HCYd81MWoTRQya+GEvgaqXEEOJjg 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: Now that all users of bio_add_page check for the return value, mark bio_add_page as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index d766be7152e1..0f8a8d7a6384 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -465,7 +465,7 @@ extern void bio_uninit(struct bio *); void bio_reset(struct bio *bio, struct block_device *bdev, blk_opf_t opf); void bio_chain(struct bio *, struct bio *); -int bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); +int __must_check bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); bool bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int);