From patchwork Tue May 30 15:49:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260548 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 7CCC2C7EE33 for ; Tue, 30 May 2023 15:49:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15605900004; Tue, 30 May 2023 11:49:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10656900002; Tue, 30 May 2023 11:49:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2641900004; Tue, 30 May 2023 11:49:38 -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 D600C900002 for ; Tue, 30 May 2023 11:49:38 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A823B4027E for ; Tue, 30 May 2023 15:49:38 +0000 (UTC) X-FDA: 80847356436.19.1FEEB2C Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf17.hostedemail.com (Postfix) with ESMTP id A1FC440016 for ; Tue, 30 May 2023 15:49:36 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=kC5Qj+vv; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461776; 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=JFwZOevzZPaYPPGYr1w21C+cJT0TV2LMpZApShUn0g8=; b=vq79hNE1iJC4R6VB4/sgFuMCLK8Y3KpjZ1Ujh3abjQCmsAXYs1WZDc1o/cLCzsQ9bEq+K1 elqDhtbb8FVO7snFczrkArRRw1SK2NGeu3IhXQgodAPZh10lwTJGMIGcsMLYB2i0i/Z3fO RDrbmAHk+nWBrBGTMJcnYfY9t7teQ+U= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=kC5Qj+vv; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461776; a=rsa-sha256; cv=none; b=lQKasypZUTsiKZxoNmNBDz4gfiTJ2+4m1jQDELerLbE5SbuqDMnnZy3Iykf1EiJmsUWu6B YpRmX6hnhGDK/ktGzJswv0/xe+m+nsC4EyRRuofZ6BoccIFrBWMhg4+oKprQqh2ufHCtlP xsAGV4urYRkW0JYYqZhNfuTlYOJi4m4= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461776; x=1716997776; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QmZzem9nS4IdX+YpMPH6/hkU8Q8851NfFydLySYg+TQ=; b=kC5Qj+vvOOtPFnroDRvpF9pfvsRmAWdKK2g4d1m9o2DuIeJoY6cytBJL 8xbCyxYD/AGYVtMJSWR5yMuGQqduQZByqMlnlNWkhZzBVQb89dMdNnSgO lZ4Ef1gn5xKvnWXBHywxmtBghmBwQwYFJFVMWDQxvbAlZY9wiR6FnXAOn PJqgle037yfOgPq36S1x63e87dd6FcHNqreWjHQpYtgMK4C6vYVyR7U9v CqIrDu5hRCnPd9b4DRrsHg0Tti2p/EGetANoTui1qnaDaXtJIMb52xSe8 MgbUunKFYP890MF0Tzv+IbnHug8KbYhCIffcHFt63QR6V6tRx5+JpeKrP A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129730" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:32 +0800 IronPort-SDR: x41onYIXkRbNBnXaZNvdGYvVoNji8y47r4WbgWL6UceiTO3TTyVZuPu2k43gjyjLa17uvT9XTO nMm70PzTPnFBOywCSg16QtywiH28M+naXwWyu9tYDbSarSQJDf9rSwzLTJNK0tWXBcA8Dq5KOB rJqXLS6gwYtGIgSlM18mCBv3Upg9sYYJZhRNeveuszv3uXdGMnLXBVHNbx4xYJhNpLbQ0103RU lgEBalgKXP049l7h6WbTSaIzSznfY53jnXbLnD0Yid29gUXR94lipn4N9GMJZ8TXZKR/dGkkpp b84= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:58:44 -0700 IronPort-SDR: MYtng4S7szwYjmaxW/lAI1po1aVI+hTjdUIVPGMboe1qhLkMmlIPBx55GCHPb7iFjshgwqgb14 taHOFDWoBB5QsexrzNlhVmGiIcOK+oldoY3/MpOlT3CcL5onketnanRTkYr6ZmC2FvhSM442mz 17UT2jJ9dXq/oFStL90HimJSMt2PrDkDWQR2G05pjD2qMu0xYmDRYB0m13nqKi5P34VcIS4KVl n0sZXsW5hHYHRvULOtbMH2PTcIdjRzQbfuLkG8GBoOKlbeAFN0jwHUkWg8F+PstTBRqzjOtvYO Qiw= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49:29 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 01/20] swap: use __bio_add_page to add page to bio Date: Tue, 30 May 2023 08:49:04 -0700 Message-Id: <64f8ac179cc54aa316c75aaadd71e107ba12917d.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: 56m9sig7jjwtb6pnop9z8k63yrrqm9ui X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A1FC440016 X-HE-Tag: 1685461776-518465 X-HE-Meta: U2FsdGVkX18nnmo4+Kxvtd9ON3DbYlF6I7gU3Lre82PM+NJAg6cb2bAb4TgcDfWwOdq/NKeocvG7v7dLyYk2euCNt25HyZGUG1oi1vgKENHofYZf7bSyw3sXc6W3N2QB41fM8U5lOrtPFjd1C/mzpE9BJUIjSvWWjiCEv7fNre/do9urMjS/Y5uYavrcd+0M2PhBG9AEj4dYy9M+7OP6dCrDcngSlLuj8uV/WclzIf7QjnEaartRkuwBlOD5NCO3vSBGDlhTHH6U5qYFhQOW4XXEuuwHMvAZW+arnEKyhRtwX30yFHFpI5HhQ0xujnSNwuSqWvfjHR9yZb9WbVG15iEXDK8ajJNyKYeOOqt0OTYZiI/0E9DHbd6ROUbWS4riAcMK9HInnDsvg1NjPKF1rmhLP+pAQJ2zPV89lmgKBuhY6rdlozhNjgDwib/NolOPr/F1I2GqZoCikDHcAi8zK8ViuQYC5x2/AmHyOFle2dp3BJty5JDLAlEC8Yp+oMHSccsKUQVh7YrJaNh6Y9MiiyZ3qY+6LoSHJ+3NHMXT6G7CBLjWu3Zk+9KZSlF9bEpb5ItumGl8Md4KEQKi/D1AGYV61VHIdj41WKrRorVdUCWkzELMKzHHOw9cUmlULp4IlFYs8/VKwdHx83dBXC5dTbPHZ895fP33Ntp3OI2kQJzQVz4BIyy1qJYqxU1cd48HlODp5LNyjDdVOEnABPs90kLZGNiJfzLTr5Cw8aBL+/a7BCY9vpxxH/qgI8AgrB85QunaJ4xjci2i4ClzJ9/deczyX5DRj9lwlSrjGCg2kddx/aXdXJ/Uw2aiqp52vG9trzuOElnSxVe+w5zEqqgSbn7eykjIWnUSp+UpqtsLOtZvTKVREK4XonPDXkkQrum+IFL/c861MLd0qtn4P0Rk8bCG3hlruNLHsWgTyW1L236qyJcidktVhSTMyDbwdXYc+ISwJNlBEmv66mMWf8i 8UfGNwli 1iHHS1zCZs2WgHqewgi2CgzD32R/Q16H+kQRlMh5z/ZB4iViHCMAkNSIUBJfT6ISvGSohM9RbC0TSluiZu40CJRXKFzTYt3IusH2diZQi9ARb+s8fs+yjs6rwzSLBJA1JmX7ZWtzXCILiGidHtILLQ6/lSWI9r7KazbsZW8JG60o3X5MxLPnjC1crr7Znrn56n8dB3vevEgsUbBj0gbK1C2kmEcZCOpKht2bFZGsUwbO1CwaOfQX9dL3hp9jczMjbsMBhP519FSIuha1xk+W6E13WZQf5rp+cxZc2r2ukFlpJExPsg+OFxIq+vNmXggFaXdJ9i6DNnktmzD8qnCPJ6egXjQF3mTKR3WtlZY0/14kofTmz2WTeDA2kaisU+dReae8qjZFY1XerqaQ= 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 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. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 Tue May 30 15:49:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1751C77B7A for ; Tue, 30 May 2023 15:49:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65EB1900002; Tue, 30 May 2023 11:49:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60EA9900005; Tue, 30 May 2023 11:49:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4879E900002; Tue, 30 May 2023 11:49:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2E2B8900005 for ; Tue, 30 May 2023 11:49:39 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E89441C6FA4 for ; Tue, 30 May 2023 15:49:38 +0000 (UTC) X-FDA: 80847356436.14.57B0304 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf02.hostedemail.com (Postfix) with ESMTP id CDC7F80020 for ; Tue, 30 May 2023 15:49:36 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aoHjwiFI; spf=pass (imf02.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461777; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AKDiQc5c5mMUE+M48Yw66vq1cPaHt+34Qu81mFVf1Zw=; b=RkxMMjbLFnLbZ9i6d8wkHgzwvwHI9JVX4skU36LxLeSnMtU3j5/Js1wPZmicXJo0lrJVzO kq4zUFaXAbzKi2zZSecM5A8J7Cj9Y5A5gnwfZ6k7L0Nif872MV2lDHt3x2Eo4iiCD7aAJR 5W5vHUuXLf4UPiroes35WKgIzF7gMwI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461777; a=rsa-sha256; cv=none; b=yvEMEKvy+DE5SupKNuB2PgQdND2OVNDwGMnsNMP0GAP+iHsRtmxa0VdNkjHZx30FKt4stU HHesUd9ow5n1H8iUKLBx72iId97pk3G1Pd6isjWn0uKM1cQYFPpaLiD/LcPByHmwM3aNQe W9YKEGeYr6KTNKQb+PTLAIQrfkEUQuA= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aoHjwiFI; spf=pass (imf02.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461776; x=1716997776; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UUIQkUbEvB2cbvY4f/6uCB2pRFVtewbvTxuQqfjccj0=; b=aoHjwiFIRU4Mna08NyP+F/h0U21q3vXJ54pqa1Hqqrdfim1qG0x7lseP 6mjnGhpPglqLvD3vdk26QwoyVj+armKic3wLGBDSe9kEdqoMsKKyYzSWV HQIj+/TGuhBlnDkw2oCVlr/kaeeAspx1MfR/Ozba1s7hziMFWJK049B9j 2TmJGCY8gwQyCRd7AJOVvN6LwB35jUHGt2c75V3Yv8moi+HF7KGOb2NLr 9XDIljkB3RTcGfJ9zGgCqzT/qNIw1M4fopRbJAOt/q1HET5tbIz/AgOBF dGG9lYduY+Vyu6feIPlkGtBLb2Lq2V1XZJHlDnnFTO9tp2x7Gsg2xBUGc w==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129734" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:35 +0800 IronPort-SDR: j+GZZncwHIw+Ff/0OpmkKsg+58/dR3l3Ebsc1YgIAtU6FOlgpDCWTQ9LM6HmZATEnNWxjj1ZsD N93IsCvon87u+74opJ7K0it2tMV1hX07CAZpu2Y9XuLBnUtxTWLzIsFanscjeHA+SeIe0mjgpa +MyBSL2MITAjoBlA4WNEV2DbfdJsv1gt6tz9OwwiEA+Teo2Sa3qhcWpSqaNb4wWLfGjgpvt0S5 HZhOAb8jzB5wcot7UUYzbQ/b/NhUSeNe9elrnUfIm5jCEA+qfGnfQEXH3nq/PqUVJ43uB5iqwL o54= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:58:47 -0700 IronPort-SDR: yyyyMz2TAyAtxiGu5+SWb7d/x9PogCVD4itlH+FOZL5M/obbujzn0nPyfJX5f76wmH56HSlR9F zkurIL57b/oE5ItIAM3mh+0TCxwpK0Osc0l70ZtbuGZDq2Rs1n51DtbbNViftHEWLZ73mey9zy 2cUmbpQh/Z5J5zOcjj/YTd3YK2PiCTKftG8A1EENSystxnnFIuMK7Oe+UZdJx94whGX4awAqm2 /U8JBrcdaMvSOP4HNMkLK5PxyRVKrvl3XxjQW8zcaD6MbGJ9RpKug8LVrI9FIoeuVVWNz6eSxF 8ic= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49:32 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 02/20] drbd: use __bio_add_page to add page to bio Date: Tue, 30 May 2023 08:49:05 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: CDC7F80020 X-Rspam-User: X-Stat-Signature: yek1xhepc8a16dqyfwg4tbnaoc895z44 X-Rspamd-Server: rspam03 X-HE-Tag: 1685461776-539655 X-HE-Meta: U2FsdGVkX1/eI8JQVuBehk/xKYLld+VQKxHqMpKv/L9NOZ2z2O/++yl3I+VkCD7fryoebs/7hajlPAsp/UfPQP4FU9pFVZvfPpEC51JAjZCvKvjF/iv7GbHvfvxDJE6KXY34yBpJNK0K96klCVa0r+nntrigseqthX42um5YPHdezWLz3TAVsr0z3Djbz01iM7dC6z5FqMjLGObrzJvqCHDe7z6maPyC4j71RCZq2u/6VxKNSKJenfBIXzkIOvvGxt1Umn5h9heDmrB60zVKfDPLy360o/pXsCcJu1K/f8Wff+xwC4c/DNktteaKFc7U1GNehW7O9GHszVYtXAMSHMpouYZTdvVrzn7NZ4hOUHJh5zhCqFh923zgXryja6Get4GRmiSeSixdea/Q2d5T4tMxxqp9mlaUcapNsbEGlEvXosjwZU/XNkdlvMEmuoFNcVIJJoAv7dwijDwyQ+IAqf+MfGL/vHmfZ+w9wJWYuYThH5gt1/dh5w6foGJbKrzIl5sfvvBThCBKdlxSzr8zYSLTlhH5Y3lTa89PRLR37oxtJKuKSwVjmhIZLtwHsEuTnxSDh0IOjNrN78FAQrzOlcCPdKjkMRjR7MWb3+QBYktMrj/TWP5v5BL/b5TLvUml9zRXv0uUpIo0Mb/3fSNej0aIU/bFLYOQXfbUfTVfZ110vMhg2HPI2UIXjf4cPZz0ctfP9NDHEz9GCbCiHSfqL0rQx6MP7CgxfeSrBfyGsDh8hJxUUZ5mjRUSRWMqmmWnc3nOnMiPObOerkzII/VS00K0UFxth350kS4ysSl3XL2AM3NT2VjDlaCCngv5JBh04+IHCrKSHOE4u5psyXzoA+vb8Q0jc496XNsQG85MTgwEgDXfIVvZJNXixwLG0CBbR1hGWSsWVqw/7MHqVL6EicwqIqWeEApqx0ndthIw/mU+GyKyKQ9W9hpu3kr/ML6t90AS50o7C0CWtqmew4q pO3TczB2 /W048r5+ni9lkvud/7oyYZ7nigxSSuoWc7yEsfF4zgS/fzjvqkQSGIPw3Va/clNAA1RlpdcA+FgodjIYv7GlqwACNfVe8GgnCLx4ROQTUYKivpEHZY4/bXlsFqEESwJB7eSRBT893eDX5hCYecMS2pgLrtiJVyxkDUQDTQJUVStnlLueMHAmQK8rPbrrgOKkJN7ibRDfbjSKmWdGIovWfstv3VtauC7Boldo/FQCKnhqQVr4gmfTPsO36QzflJkw9iu+/hePj2v1yfhUDsyUol0RO0MuMxIIM5/zcZpbwlzzos7TDyuvUMD8udaehpLT1E5k9TvDrSUhb64Fgbjv/Hna7qxpWNTV3SYTDtyI3Si3rFFxvFsg7stUP6GFaHRa6omwWdk+1Dji/nNBroflnjGDS1A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The drbd code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/block/drbd/drbd_bitmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 6ac8c54b44c7..85ca000a0564 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1043,9 +1043,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO, &drbd_md_io_bio_set); bio->bi_iter.bi_sector = on_disk_sector; - /* bio_add_page of a single page to an empty bio will always succeed, - * according to api. Do we want to assert that? */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); bio->bi_private = ctx; bio->bi_end_io = drbd_bm_endio; From patchwork Tue May 30 15:49:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260550 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 825D3C7EE2C for ; Tue, 30 May 2023 15:49:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7B21900006; Tue, 30 May 2023 11:49:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB75D900005; Tue, 30 May 2023 11:49:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B990900006; Tue, 30 May 2023 11:49:41 -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 8D775900005 for ; Tue, 30 May 2023 11:49:41 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F39CD16027F for ; Tue, 30 May 2023 15:49:40 +0000 (UTC) X-FDA: 80847356562.24.A774775 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf17.hostedemail.com (Postfix) with ESMTP id D9E9240016 for ; Tue, 30 May 2023 15:49:38 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aXniwa4S; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461779; 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=SsAjS6t4vxeJS3qx6Gp/BdZFxpipc6y58YVRUDPoMew=; b=O2BUL17c5/9cX1sLGNYoIQSIjZXpK9ZZvd3kmgdlfWcPcS2BAou/49TI6DJ9YPu7yRRwqR 3X/YCTK8KGQFQCOwE77FgJbTI9L4r5Fe/QMrvgDNbIBI5J83QkNpAdCz7vKGZbFGZb49ar /c2BylrVJDaxCY+mbsWAf/5nBqf/RmA= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aXniwa4S; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461779; a=rsa-sha256; cv=none; b=XIef3IUN+xtKCZlOdlDPwR5PzJskgTfJ1wO7eNR4qQI5+wGyyrt63w4eU9+k6EK66YXxQE 2dpP4lizEi+g5ZS+tohfblr6x5xEeC640SLM7LRWT0zcl2G1kKzZnrc+WJFV2ag7twOSzY mX6NuW0mooRzCdzGAVcctauwq9ACJD0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461778; x=1716997778; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yht1tkgwasi8HpY3YFcrQQ6s5n80qKmfhqnvFToXZgs=; b=aXniwa4SRhk72rrl65FAtgaFUabEpF2ZFr6BNHMhCH6ap+/OpFgNJIQm UuIOSWhWOz6BZn4bSd16LrIaeNS04JLTiZ7VhFYAcullW2WyTfRxBplR6 VmdGyy3SzQ2nXgQ/sUg28mkD0WgVsgd1pAtMlxK+Dy5Ln52fGHxbnhW8E waOVO1dK35awZOsMBvTcqe2tvotcHNLAQYKTzmNeRehh9/yZktSpXwmIQ g/lbyh1Y/b1305AAiFqgUajv8/K7gO7zizd4DIHj4y/6Hlbs71X24af4M LHYlUE4LOu0EzO/cqYVXetg3va+YO1c5gv4Ixz7e8F1bdVj4Sv5nymyjo A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129739" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:38 +0800 IronPort-SDR: ycxf0pFhML3dIU++qjUcc1sAo4+cS6sQNT/zFnxfWwPmBaib4JbAClocEcvejJPC4R+pk7pXTg Hg9y+MyzUaEKarM7oAJEkm18lbzqbnDtm2e/7pdx8DDtq7DtIN59pAjBrKgiXC7TgYTiM3nf9I lTBiyAqm90UocMpRyerqMqVy7jFLEYQDAq+AqV/yrCsP6Ti2UcrlSSF8mqI9hbZPpFykOaYvzI 18hSfA8/2V6xeXlg5bCg+dbwlpCTYvHRHg8fLEhL3lUah3dk5mbo2+PuGd81Fb2ZioEOObfKSF JmY= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:58:50 -0700 IronPort-SDR: rDb04cLPnHkw83pxdqtCHKsua7HM5tgjjmF6YXHJIVLNeG4c320WrXtss9t9FpJkHk8dSG8jrZ U37pjVXEoaNU8XYLzdmKXeGmEFd+1dDT4nL97b8EqiMmuRm14WWVuMYkCCNNBQqq0YdinOO5yq Lxf5U0o9U/edHt5LmR3MVSlhItwiTl+U8LIJ90qQ/E0eH322rprOjcHnRMPPJHrvTPHPHmMyw2 XmVBT7OeOZhz0Z77oO06/HoQL/Numzb2HGonQSheeFZI4laqGj05EvNx/k0pFoJFGK5U9EVg6i 1Sg= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49:35 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 03/20] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Tue, 30 May 2023 08:49:06 -0700 Message-Id: <442aec07a192f0b2fe918b66357bdf7d7c25ffdd.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: qyfkhzqca3sbsttbaw3ozxokadyohst5 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D9E9240016 X-HE-Tag: 1685461778-910381 X-HE-Meta: U2FsdGVkX18sgaVaCmj+j6jVxHBhiZ8CkuR0teg4crmP9pBS/bLbK2tCH128Igxh3y3Tx5zqu87k6jG0frTlA32lTi596qdBDO+PU6hM6nLtiNCw/wAqSBNl/AyZsBUkPqppVMqWksPpSc/wD94CPHAPp+vprbEbnVxv1Pl3WnoEN7oqV1prCjQeJJUuGxDLN7mK21qyMgb6/JgOR2JMe9Dd3rFIk86yMG6OOwBT0aLH1SYEHZiQ81HXYOhEYhiJgv/8EO5gJCjZdL5ULMERFWTFyQ3gDwWaNF/2RjP953eGXxfROIHcSw/KYkZGlij1QuFF2ufMM4aBOuvoTFj334SWhnrYctVif/unjyj4FlIyqo+9sTbF4f//X2uMoNAAzWppVOA+amNx/tbGrM3Y5UEu4PomtW/2JWQb1yeeA8nIvzBgH2zxaxRo1o1R5HK8+YxsmUIDOG+bUyS5jMnxbH6eu9fbq5p1HTmjtI96bbgEgunOIsmRW37D/81IF675Kt8dvjAiN+Z2LzkirWxypcx7z9xA0BjBwJ9ngkwezZpYWjlZdgFcO5ed28Qhgp5GwEhN9oDfycnsF8CNF3bt8rgiDeLJfXDhsaUtT2et5ugDpQUx1eNE0JPePJLexPjSvMfadrHoPK7UzwBVTw/yZdiklN/Qh83J/auIBRxFpqZJUKEZVbN9EhiinTQr/hxHd6eC8dy2hMAkge54RqoJvOmP5J2K/Xo3WKiRf3GiEO3CpGxd9hBtc2BRw5DZCzlSbgvzmDCDULtjyZDFhLhhSVQoM03RJlLl7Wb5IsUlNipbDjvJ9sfs6NSAn3PEFEMFfIIW7yrrIhiqZ3HSC6SQlHyRvqmTa5GpC5ur1gTj0cC8mp2bMCbmYbyRk7nrJesY/mcGiRK5yLvRDHoK+cPJtXTSizc8NsL2cbJFekw+XEZIDBTQ9KscC8EjHEqI2vfVRhr3b5pH8aB8mdZcI1c JUGHeWS0 IIaCNprUSY+zGnMbEcMnd2gjwyCIPF1zXkBGs5XEyETuusiogH7Mv9FBiEIBLfmI36bI9keLcHcRHngXuYwjX+8VXNZiKLOLQTTX97S8v+/XIWZko4UmFuXTxJ4A4w7D4fGMTKR73uQArpq53ZhUtuChXeEqQuHtBBwW1pvycw1F/FxgajH0PZSn6+Mv2i9koF/WrvQFsWu2iddkuYl67AR+zWB1ip/O0WtSHE41uAognjWbR1mPPH5IsGze/tcRqgbhZaNjbYO/VDdR95DldvdY3td1zVWOAONHoEqE6hbC3Dra5Uvl5lXiat+dzxB1gTGEpDbGxg+Gsxi7x27vB/JKnERl0pyl5+D0fkdSrI3aGCDk6sCeDEGc6IySt7oM3g+i2DUKx/AeL1incC6/y1m3wAg== 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 Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- 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 8f0896a6990b..9d3cca8e3dc9 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 Tue May 30 15:49:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260551 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 626D7C77B73 for ; Tue, 30 May 2023 15:49:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EC328900007; Tue, 30 May 2023 11:49:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E4C49900005; Tue, 30 May 2023 11:49:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEC3E900007; Tue, 30 May 2023 11:49: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 BC8FA900005 for ; Tue, 30 May 2023 11:49:45 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 46DFEA0274 for ; Tue, 30 May 2023 15:49:45 +0000 (UTC) X-FDA: 80847356730.13.0DF112F Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf08.hostedemail.com (Postfix) with ESMTP id D923C160018 for ; Tue, 30 May 2023 15:49:42 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=S9udaRYn; spf=pass (imf08.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461783; a=rsa-sha256; cv=none; b=oXb3cNSmH92pcdCVLcYjnYpcsQoOK4/FYfpTqNgUf+bBFWqDTeybRAMaoilQ/cYACouyva M5vTMb3UJxgPkbT15ApOapE5o2ZdLZLeUKU8WOOSoFuFWGfv1+Dz5A9rcvQlnR+2bIYZlV 6FITYyCswSXXjx0p3iJ+hmv6+sBaIL4= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=S9udaRYn; spf=pass (imf08.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461783; 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=eoF6iuNNlEmd2vTdAFbwRg91T5G4Yt4OJwZs2LN0KKg=; b=PDzz/gh9Dq1X7WcLW8iwtCgJ2TWk+SvC7Nej8mtenmvRQoE7ft2Ot1ml2W520YpoNvuwtv hyguaWPCA3G0AmL/XA9uyRxCZLEPbZsqFCZwqBFAxQw1owix8/UVjnl0O7WY66ZOp5cCgO 0/6GSupG3vAjwdh9+wCCQmjiRaXf0bk= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461782; x=1716997782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=asDmkxFBDABNDNnwDePSoyQARa0UoC2pBVbkyHt1eyc=; b=S9udaRYncrp56ozvBX/C6nYCqgh/jxrIsukVkVOlfEFOY0eGfUwQwG3N 2jbsrK8ZjArpyF9oz6krmxeHEjWHB/5XATKvM8Z3gmNX/qG5zAA0bpZHl lowffwyF/V1pG08obImxobY4K7k8n+t4txtxCumsj5IcGXz1+Azxi6SCM j45r8GVqGAPLiCory9y/xKNwVDCkqlK4oi/6Qo7dJ/baV2LkxZIASADHE UySLItJFvsxXpqrDQxt4KvhTTIa5vOAQvagFQtZZFlynMKezwrXxbx8c7 hpcNF61V0ymP74BaV8k4VHbgnryhuYI9Y6mpXg0H3ENFzfDx4o0APVe7/ Q==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129748" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:41 +0800 IronPort-SDR: ZF1y9CFSuZrIChRjApghk68LSrVJFx/gMdYtlVJUBBlYvyElLMLxBZtUHoQnFUET7jJBZCszU1 aDZHl1Ae645djnAvjzAewUgW0OPRm6xMkns0ehyWbXXtEY+KdhIG4ZYAnze4lcKVWuJykalEj6 KGbMyNw0SWk/am2eVTQ8MwbPpXhGY8aJ/IIXaoZYKrHGk0urYA5pUYwtw5jbEv1VbPhGNI4jtx CJbLnBHR7gSlql5ju7zZ6PHD+0MrwSXzI8u4oiP3f17PmMNxNJVsxUDL06rgYDjcvZ3OWca6AX drA= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:58:53 -0700 IronPort-SDR: flqRBN6t8oeSRa1BabMxnUCvrp7PztzsM6fP6YmtGqWahobry6jFcPjHqu76BmTmRg0k7xB+eW Xd41xDIbR1903c6oA+KNiyFakHUZmxnJUerK8kgF9kwCVwoChx0oBjxovMtZJ/BUIUTKUH9A2r 71Gjv2BTIfgq1jrGmK0RWrNe0WL9Ca0Hz/IorQC319U3yD+iig7YZY1mUOiG90XjQrt9L7sEd2 guJGoE6VxoZaYn17klSHxaUFROzgECTIVBStNd3SnsVgan18w3VkwfB17pJewsQNiwzdzvk0B0 ZGE= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49:38 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 04/20] fs: buffer: use __bio_add_page to add single page to bio Date: Tue, 30 May 2023 08:49:07 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: D923C160018 X-Stat-Signature: gizfhrbyyirdqdgt54qr39oqkfi9cke1 X-Rspam-User: X-HE-Tag: 1685461782-776563 X-HE-Meta: U2FsdGVkX1+IB8YagiWArvZI+5vB8QkyvBADcMT2xvSLoqzBO9Iagl1VRbarCv8gciJ043zmVWFb4fd2a8hBMzdQKPW1H2Evzua2Na8wa0msMGKENiDorq/uEPJHL7NpH+eCqEf7XSc7DCdhBjE36GgNLylo4nnlPYELwI1kEU4qIX+C+CQEQmDAHJLFmm4l6YiQZ/91fVPz4JsgJrXvtrR+kf9LUK4kXRUu/w6hP7kmkLOfcKZ1uDU6pc1Lb83lqxa8ME5psqVJtfprDfNPTIFVkFFWqL279NbY3OzkdWIb5G/XfolwRg033MDEuoo2eY8DdWVL3NW7C73cXl2TN4nPX09tllL4ezw0WwlG8hDtm2475Ji9B5o3yKJLPkXE00fnp61kzAlfHWXe9dBGfQ+xtEXnRbqsMgmlcNOBqP8jeZRhFeDizUWn6pOV/K2QchaB8ZTNlAd5av0eUsgzPvZ1vp57VSYXHiiPENzJo5GDkAqhEkmxcwppPb59D8uABaLYvAq1NG4z/xJ5PY6tjRmOTwwrrnIQH/8lxdTbeiGREBybfOlddZ2MNkpiC639yz8NVbze+MtYCXLp2XeVRKRdomBw1V34XyczdpVvEQwh+YWUFitNGcAv0XIzcHhQQJZTkDG1KfL/9oHYA2xJNgOGMYuJjmG23ybD1ciD1UKURkvkTrRlDz3ydTo2l/atqcezjQcKadF7U6fPCM8J58W8IfONcpnV3M/ahlQwI14PoSpt1B/kTS4UkeZN4a0Xg66XDXhkRlQ1XzrHPHdzI3ndSgG6eM268vOYJj9BO4nkmNnB1r4N91uNs6ggW5LZ582TsvyPWyAqa9vb6tXJq1aZcTXjtAdElURv6oHQ8Uzm4PpB0ANcfcsTTwOiQ2TYefVwpqhNaWLhzjj97cvUTo1kSWoPD1hlf0Zfe6SWXdJYONCsvetXHjYORUSK1IKAs//JmizEZowjcMGvp2k 9PLj98Bz uH6b415RCvmR69RPlTAY9HWcS+OEJJmVYTfAat5StIrZjg0Xxx49DqAy3DxcI2OAR9tsB9UifU3GYESKoqtKpTVoWik131jmmH/uml6nSa59LoXT08Nr4J9fdPx/ReajhYi++IpgzxyVwCRrVo/8Wwigms238kvxtxTf0flGdPIA5BYPuEdhBJv8VZ6XwrQ2GNixqMuYbWEiZx4zgfpt4Ys6sk+GqftDBlcg3a/PVRyrjLvh9XDY8gntRyadrGw0ifs6PQAxAgl+EVdJbAUyn3Rc+7vvcKJ4eOz3ZfBSvVIjv4f6Xu/sgQ0/uwPf/Zksg8n7IFBhKfwwaCVY5kDx5qC5OX8C94lveqK70uonJcgUIm3HQ2h9aDAa4ONYHNsmOQ7ytnFSqamHKc9A= 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. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Gou Hao Reviewed-by: Christoph Hellwig --- fs/buffer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index a7fc561758b1..63da30ce946a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2760,8 +2760,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)); - BUG_ON(bio->bi_iter.bi_size != bh->b_size); + __bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); bio->bi_end_io = end_bio_bh_io_sync; bio->bi_private = bh; From patchwork Tue May 30 15:49:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260552 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 F2C63C77B7A for ; Tue, 30 May 2023 15:49:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A8D3900008; Tue, 30 May 2023 11:49:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 859E5900005; Tue, 30 May 2023 11:49:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FA53900008; Tue, 30 May 2023 11:49:48 -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 5FEC4900005 for ; Tue, 30 May 2023 11:49:48 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0FE03C02A4 for ; Tue, 30 May 2023 15:49:48 +0000 (UTC) X-FDA: 80847356856.10.9A766E6 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf08.hostedemail.com (Postfix) with ESMTP id 45C26160025 for ; Tue, 30 May 2023 15:49:45 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lY1S7Xac; spf=pass (imf08.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461785; a=rsa-sha256; cv=none; b=l5iHSmiFcZCem39UR/h1kOUGzswvhajml6hHMRrH9YYCco9Wz1xcRWCQCQtmA7F+J0L+nt kzmC8EXQ3CEfL2590kUrL3upFox0XBV3mUcAVwFElYBhSAFwZ3XpU4oGbr0Qu0gs6HLlhm an3zYoDiWxrgmvPFxSwlfdTg22ysSvM= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lY1S7Xac; spf=pass (imf08.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461785; 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=JaOdRASqHT7xzwXc2NQuDZOUhvsv6oArp6EMJMX683Y=; b=pQcquImczOwnQ18cslIIHgI3ZSR6Yih/dRJmzMXyAVUVraw8aFyYJAjEYKPNdmhTDVMu4x 0Cs6G+0VJ1T6QXcZat63MpU84apixNaVD9TgLZMn0nwnC9kGGIpfy/qREKTZRD0gXZSOKJ oVsdGSa01d5C+t3n1BEy9MEwmY148Ro= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461785; x=1716997785; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I1+TGenMrGdtSWKYS446AepXRO4LZgePrjmNY71VmmU=; b=lY1S7XacT7XbJFt10xYyXmY5A8w7A6LoQLrr2ZkynFv+FypNtyH8VyTf kgm5nQIO/uuGuyJkfIUnpVl3hRhPzO2Ie0N7QIfj7YOT0sZq4+OSC4Xnl q8jJZ3coQ9tpeY6xa1MbXKP+/FU7pK2+jv2KanlRKoDx9PfiXYPjChzTB TKG64ufx6nfldfGLahYsq1EDiF2awDSLp/WillKuFOq9ewRGgylICvkim ecvQJ1mE2FgwL4Cn0FlJFd2bk4GM8KCPpZ8bq/6kWBc2gokKGZSX4Je7M QDt6yv8XMd0q4kKJLKZ0+5dNyZXy2x/J+plWcUlbiu0APixeEBWeBy4rm Q==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129757" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:44 +0800 IronPort-SDR: SodrCq/b4x4mZbK5u0GR3LYvsAMkbsAX4HxLRdW7NDFOFFInIgeUXyrcDUwy9Jy/BiN5FwMpHD lAM7hHAeF25xXxTBCDr8VEJI7RoH2XWQopidvYmYqVWIm0BhCehDhKDq3ZWCo2UkOxa5T9zsSq RvQYi/zwiTB+j13ptnom2n8OtZl6WRHpLBAPSt/xic/4YGvvoZCw8iw/DQkoMbQz8Utfn1dGFR aaEwIugMJSSSHNhoibjWFGfrHHRAJAcLjajfuF7zZHPGx06VCT8vCNYOwRDr+qQq/iVIjAPL0N I/s= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:58:57 -0700 IronPort-SDR: KJrqulCfq2cqwjkpQuj6PyVKpC28Y9PRziJGpvtZLpCh0rnCFASYlRta5kVMItHLPqq5rbqivp lMPfQqlHbxJojiNO1f2byMk3lcSCsyJM5076LR2t1Uk8MU+mMSei3mzF7GpXMo0mg3+kEecLxf OyMUtTmjzDB92M0Oo1Hytx+Eufwx2D2FdxOYnT1IorOXPeITVFL5E8NvDvefbboj9O9qo/Gmak p1SuxcEHaJrwbUasxNHzxhTj/f1bmxtqyWfrTpTKU/3g7I5gd2SasjsbToJ4cuAKPzx8T5MMe9 2F0= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49:41 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 05/20] md: use __bio_add_page to add single page Date: Tue, 30 May 2023 08:49:08 -0700 Message-Id: <8b046033b3b073d1ea91c45cd278b7aadd0b7e1e.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 45C26160025 X-Stat-Signature: rctxpmau8mt6wf4ijnsi79ty9sucz9nd X-Rspam-User: X-HE-Tag: 1685461785-349574 X-HE-Meta: U2FsdGVkX18AU00WatD7F53SlVuE+HCUGDowoKHIunQQwCh6fdIKKFs1bzmrTBoky0JSEtZ3lek9IfHJ8J/lHW9KIUC5aNs/KXzuzlcWW/CHVX9+z382woYo8ezj6HTKbqXr/MFvIDRM6+hzpdav9RymC3BhKAO89oHLJ3OuIcpvG9Zxl6KtODHUe2BZcxKlZvLJYFNJUAUf3ohdPpFi8EHVnEIE3+vxtE+0Uu514/g1HEF3+xIvskEhikcwvAEAlnaFoAUu2wDBKmy6OYLbTkiybY0OTcITYwBrI7qvGMEigXq0e/RBFm9iHfMefAyw3XPmycR+yS7M+4lST3qt1kdM/q4062TXbeYjgh9xJXZbsXRN7TjK9pyCvosQ83KxZGQiOrf+fmz7b+oeSGp90PLgt7Qppc3A4/ACtTn1VlCpyhU+WOtmu+nxUFRMZ0uzXnDrFy+2MtN/pTJb0lHMApvrGTZUcojHap31+7BGlHVEng+DnEeuYi5kjVdDKm5CxH1EVX7FSYgBSLkBnmOThKSckJ/Maf/3gVLDWHWX+6IQ7zFG3H2weIwGkybhnO/3Ppl1hoc+8sijk2soZgue9/85CxxDY4DHYbUXwpg7uck9EGNoy6RY//unyia/RFfKWuRGJUDdn9iukTOhttNOEDowcmi7KZtQu+19NiccDfTklaQV73jJv8y7cAhLwazfdB9ellat+eTffFIn5V3dJPu08eeskfA5Rup2ybAs23ZZk4Dx0r/WfgTQlC34HRhR+U0eY1ochj5oR0I326+pr9im+ork9huZF83818EJ+8HRvWrxeaSNbkHaeLgoO2kB4I4WivUJ9tdGATfQNzG5mNzP46Q/1k23TOk9D2hoODNVMLclAybQSo19dV1no9pXm/hQJjRnzNPOpqBgT5vh2PkZjKaYR+p/NfL+Wsnvz2deeCQ1+L26IIv1Fi+XACecDVBLElWFNRFycVKLJ4S z/o5dDoS zDM2e2aIwtL5kjq2PSmL2horv+zsqnReycNJQWPEaA+MqoXhE4sMETmaFa0/7+t8+CayL9gg00pYTF/K+i3x3yVsVKh3UXD+auWqhw5feMFyqSt3kKY8yBXu39bpm5JCy0ieEtOR1M/yrBv+G8Bx/CyJYUl0xqyK2x1rt3PCvf81ApCQy9Gk7z/yX+zU1Ma92bChXVK+u0ZP3F0F7kpl+RD9ZNInhqxm+2DBe/3Wol1aORHuJxoFAyL2bLsYe4/SpkD4ckLRFj8EK2+hVdxeyY99N/1yRCKB2UwpSSPdRWXqKTU2qKxPWLYcvd58NUOtjLyrrWw9aJ7yD6wjI+bNXjziEhvK5vA2SmNjbjqg9AePQfPYcXuwsa8d9H8oJs7ObT7+3bAtC6NF+qaNGyHGzzM1GxWyZQJ5MVEB/AuMh7rBrqWRfwKgV6TigI59FL2ITQjcYEDUq3nkcsuo= 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 Reviewed-by: Christoph Hellwig --- 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 8e344b4b3444..6a559a7e89c0 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -938,7 +938,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; @@ -979,7 +979,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 Tue May 30 15:49:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260553 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 42451C7EE2C for ; Tue, 30 May 2023 15:49:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C9F75900009; Tue, 30 May 2023 11:49:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2B50900005; Tue, 30 May 2023 11:49:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7BA7900009; Tue, 30 May 2023 11:49:50 -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 93EA2900005 for ; Tue, 30 May 2023 11:49:50 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6BADCC0284 for ; Tue, 30 May 2023 15:49:50 +0000 (UTC) X-FDA: 80847356940.12.FD5E14D Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf08.hostedemail.com (Postfix) with ESMTP id 483E3160006 for ; Tue, 30 May 2023 15:49:48 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="QEajw/Sg"; spf=pass (imf08.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461788; a=rsa-sha256; cv=none; b=QTwlANJd2RFhGVfaw6PmIng0ByWLQ3d1Df/iJR0AJ8KLWXpXqTd1k0T1KGfL8MClIVwHXD d2lSkvt0IkUbLmzHd4dTwZWwzbI8KWVl7/2p+lzAk7hmhInKRU/PVILqGd10TjeWhQIyNt B5FyQGGWDSi18SnJ8U6QD6L2DyCcbac= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="QEajw/Sg"; spf=pass (imf08.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461788; 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=lesC7ZHzHc7ah/ToJ8yOzNcL34jZPc+O7TdhQ2cqcu8=; b=LRGeuyfJ56oxN07FPg8OqN+mAlHXnWjGXTbupy8RKq8gjcbGRkdLHD6LxV8p5FNiin32ai HBLBj8cGcgZT/qKFPiy+HxHSjnVaTFX1XQXF7E7y8CRA7PNJG5p7Q2CQzlHIg3DgvaKzo+ zAJygE7Vdm2Fmr7HYrslRcr4GMCnY/k= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461788; x=1716997788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mEDf+2bPYBdApkRtQGcrKQLhlyK4U4yv8ooj5C9H9Fo=; b=QEajw/SgSrnCZhkVVnpDuYttoAs7WaN/WzMaiWw5CqFTfW0GDo/9Chji GfVc+pZIJZRLXFmrR2fSgO1yXGkZEMfPXvV1mZ2G5+uDQpSKUcY65YT4+ MixRclyeyOUcI5q265uZ4etPVnYOnm9kmG7tB7IschOmRYvHcSlNkrH1W 5RVoLiOts8dqQwFK9tDyymKYtIjHhZBuVSka90aKs7W9uC15VUuLAZRWb r4+LP+HCMby9GjdDDy3COSbe7y5aUIFul54yNugvirWEYE039oFv4VDn6 nUgDvGlqwYPmuOCzOqOQRdMtuAc1vmQaYQ5uQ6alMkP7wm5XllFuWcj8/ Q==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129764" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:47 +0800 IronPort-SDR: DFxP9MCfvntfy36YxVLUS7+dUvr5rFo2Mh/9jl9Zw/j1w1K2pWBovifW3vVhn3f0WMSi8wGYTh PW6UGOgN7+rSQf0UsG2DHb+l91LOWYFekH2b1zFyZPQqQw8Qgzn1RGcSQJMBpDov47v9NVGWzz pzcpYNiHCOVkTXssYeouNaTDqxmWBaMNg1+u+XRcRQU34IBWp6WUCtrXj5VpElnoExvR4k8yu9 1GHeZpZpYQL29dfiMXWdtMkdUNfJy+J0qrFrx1OrvAhBc+b/o+I0cQWmnmH7peitWwwGuntx9z T4Q= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:00 -0700 IronPort-SDR: MKlOX/uF8wNEct5950xnnV315MLl9jdeWlyzj552Na9mJDZsmp05yot7aD76Oi4Xbupl3BrWor CH08la1ldQbZ9LbsD2PbKhD1eEz/Wv7IO4J88KwTSohJz4Tcq8kYJ5TJv5OIor4ThvImZ+P9EU dnuo5e3IdJkZtM6PymLdROP06o8OObtizuI8cob1Ebk7RJhUIOuDEY5ObLtCjGKqVpe5/yRxRA o0I5mrkdFpgizKWYnBAUJNxt+kr6dHKCyqjCW1az0geORLLKn3tAB7Qv9196t3xurORVn7mWMo rkk= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 06/20] md: raid5-log: use __bio_add_page to add single page Date: Tue, 30 May 2023 08:49:09 -0700 Message-Id: <1ee0465c7b2634a4435e65a4d0b06019a73d8389.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 483E3160006 X-Stat-Signature: mxrpeb8bebdhoogwrjxcuuarjztzej7r X-Rspam-User: X-HE-Tag: 1685461788-906136 X-HE-Meta: U2FsdGVkX18ktukWQAHwwpcJLMLQDRo6odB7w8ydwhSzOTDOTReQ9L2DCgY8xC1+wLrCLGvCb6xMX5RE2SokmRXiaRvafBr86IHOlZZKLbIld4pUvpzMUTXdSkikKCPZT0CtKdG3n5koHJhsOidsjPjZ0Ljwg3OGCuATRWBpy6vF++bJ5gnq4bGCR2DPPWojY/1rjrTAhWkIAJNlTj/oqLlMTYf/XaGoWY9TXAlL9h+cQyonttlskM1UqQwz/RkwBMmNbBMBjeYcUNTyXMSwCR91l1roSjdIIKtwi1AFqUHXq4jE2jyjckx/wytzOpcMkBaE9NxMWxxPKbYd76qRXseGQFvEnnPBWkdD16Qoq67oCdS2WDk9QDRMOipF8pYlft9LbZKtlXL5UMUYKUkmhoZ0z9aiEBO4J8yJdadun8zS+0bZY3R5I/XmXprdrlE1KC6BZQgs5AFZOVYsv7+jFu9HaWReRcGeyOecO6itSaBXNGfy0BsgkKDD/rFRnA45DzXG2oHo9C2k+5gr5lGCqXlNiCW5CRvNVrpqNhMk4e5riALKwhtCINQgupTHvt+CKmPlom1JysjLmusFukr/fAGaQAFMgVMwOjz5lMz9OvQ2n8IvX2m07NiB9h8/9iqw+iQmABz/+hRknUqDnRqTHlI00D7jATf83iMGihIw5+tfLDpxuXuMoh1/VaycAi0azovryWI+vzNDKoqXkrEnh2pyBYVCFuNxDFAoNA9fUuYSvHc6ZsENSEJfwg1NprR3CUmdeCc8KaZVDGN7NXO+cdYL5YQScwWG21Trk7fvTZVpQR84Ywp2AG1tQ390v3bFtyfyzYOiutM/pBU+5h7befOHIKu0uWNS7jTSZZJH67/073DwibNyexVaL5EmuYDX+Qjf99TAmKReq0wFJXpGXWzeMfa7vSp+QZJX/6QwAIUue8+hMP3rt0d6bewZ/yNnaLE7dMQ8R9Xk18/UCZ3 y3xJHDFX HOZpyWpQd7DnwpmGsteyVQ9Pz11txMUKUIzp0/cYZCiYw9KGHAgk4S+VyRmc48LwGBmdKm5nPDsn5wNoyLKAJ26YP/3g5ZSmpYDQWM+v3M1os+XKIag4yxHJ5SCC6wZOu/lPiCfGk50R4LWTPrnETAoIJWTQS/E9ENqgx/LrCUzPbGQkmvy5mmbtzG2x1KDhm0lvGifGVVsjczucGb2NfXAHK62sKATng7a4VMBec1AbSfVnWBq0laMbrgsEMSqlXlD9zxo84TFQcwo1SGA5mXDZwlDnrQgBffUDrDYhevuyocqZexr+i5APkhZ2G06yRwvUOE0x5tiKNDU4XkXalaxpbwf2Z7PrAXjMKGuRmHi/TS0x/HGN8DxoB/ymIuVq7I7DkMGXNvyPsXFyQ2tjnSXePHrf0GQ2fJlblBgjGMlH7TUa7288ADpPZGpfmEgcmzeMNK58mlnpTxNg= 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 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. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 Tue May 30 15:49:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260554 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 5CA21C77B73 for ; Tue, 30 May 2023 15:49:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E269D90000A; Tue, 30 May 2023 11:49:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD784900005; Tue, 30 May 2023 11:49:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C773690000A; Tue, 30 May 2023 11:49:56 -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 B8DBA900005 for ; Tue, 30 May 2023 11:49:56 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5CDE21A027D for ; Tue, 30 May 2023 15:49:56 +0000 (UTC) X-FDA: 80847357192.20.570ACBF Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 43C0C1A0026 for ; Tue, 30 May 2023 15:49:53 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=feItHmtb; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf19.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461794; 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=1S2DSWAZA9qgvAvQBzAiSeR/Df+u9UWYi0qKutiToQ8=; b=6HcBPsmDL8XzhMWAG8D9akg5qz79WOLXFzIp9BBceqrcqDo6Byq5teQkoVh6ZCn9lz4OzJ qOTk5OBAA8qKQ7W1J3W84cXvvo3bClqzlAZRziiTfZbvrCFHn+YeOqaUfCsb6oIfCzIH9n h59DBi8oPHCrT1joN3pyXlj8ud6OPm8= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=feItHmtb; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf19.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461794; a=rsa-sha256; cv=none; b=iqFPzoDFaym6lb3cGcUtaIzW6oepLs9wUgopbRRRAfwJkMiUAy7B87Hm8eEIImc2u1gi0O fcK4LsT7BN9i3ENDETlX5q+8ce7MCHjcpOTDunULBMoiBokYHqNNSfigwu4rBccfrXdRdr ce5ZD5WPMnzX/7ql3Vo18yomqTd8oq8= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461794; x=1716997794; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3krWE0DP9xJWhQSqe7JjRJmAUx3KR1tDfQYkyCcToNw=; b=feItHmtbihtlr3h7+dOyrVe8+TpvxQaxjTJclmI+RYEaFJ81mJ7GWps+ hQY5CrpsV/t2z9okiS9anc05kNXY6E/7YqNrBqD5Q5D4SeY9ojkVQumO4 v0jTMCyG4Sr8VpjrDHQKLOaVvmx/wnoMJF9MlnvwrnpwEnCgLFLrRbW4f fy1zPYpvRqJ5R+GDk0GUzzMNdv07PfSKOl+6PtG1yahzyT28r5b/Xnewt pj7/AeFGhPHuIgvAixvM9ml7AFIl3s1DZEa0cvtDcVApMlEtp+OFhUxcp vbTn8dpcK7gulJdG8cHRRCkEuuIhmqKLgFeM6ssfVA2qIaHrACvpgKyPH w==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="336465958" 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 May 2023 23:49:52 +0800 IronPort-SDR: zBcC/azQruG3jy/y53zIegFCkbihUPHmlvRnDPPmJ31JBUhbrmQRiq/I0sll71K8vXMU5FxLTo dh9Aiv45H4w3ccYgqaQWAoGLzG3fwYks3bln9MDtpO3chFsCMmrd/ExKMIEiVOWTOSCtDB57pf frkGV1wjNi/FAXi1FMuVmSYaqUOGCeJjj+ZkIOstUt0aGEYlhRpgPAHS7LvLLnT1DL9aAk5SEo 6YfwTQ+hQJl8697MH20UIBmyasZaFI1CqyhHT38ttWvS5ybY4mRZM3YfMkYrIMpkg27XL/c+Ob 1uc= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:05 -0700 IronPort-SDR: u+PASvmVFMOeoxAfCOzPTJVxs9w/SxKXdV+WL45zR5MhQmBtIcKpxPC+suAbA8R40WSAoABsDU Savu3CckUXivbi6WToWKdQUwLLmbPrlu+t0D2w2adCHgpIa07VBP9yc9YZfQWP/W4p3Ho8L2TP qdpGq1vryZADT62MQ7QL5o4LjYTKjHlalTuDTjetxk+HbtcWGU7QYi1lbKcIylnIUUvlIOyZMf GU4oqaEupybuJkpumSK7vLspE4ZBbcyj/b78AtZhDrf17exWHWQM4qistlncc13/I/U8bGzbTt Qx0= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 07/20] md: raid5: use __bio_add_page to add single page to new bio Date: Tue, 30 May 2023 08:49:10 -0700 Message-Id: <6cdf62501852fa43493ba866a49dfc9e859aa5ee.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 43C0C1A0026 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: k9tqqakr7a93ebjs5a87s8wjf5znmyf5 X-HE-Tag: 1685461793-273202 X-HE-Meta: U2FsdGVkX1/Pm9LJPvRqHdCdN5b6gYDtin1mS1n3s89cM3gKYGsJPgNkWl3JX3NVeg4kFgFA1uMtk83zV0BZX1l36tPbg+zDUhmEUcK3o7tMa2XJDq6uvl9f2T/BEo5ypo1SX0HC4op/vP5rm+8Qvwmm5AWC4hw7AG5CK2XnH63ycKS5H2Lsz9o1VXzi2ET9nnYbPVLOx5kpWdPzpUMo/yJfWYC++d+/9FviZcVDgT21wDkDliX4BztJcppRpSRPzRL7xQ7JBpbR79Rv42wj9V6sIZXfSqMyJw6K+RtEcPoVUpr7xiTZkwldIy3AYpmD1Fucfljzno2OVlFzpGVsO22j7KBsceRWvQbFuyzs2bmkMlIwSIZPBBOI2u99CkobOpqBddWxABF2IiNTJs2B16RmjiGoHuV56F1sssEJF42kAFsM9CKhQ4SZfoNvakiIGlEut5nHkLMSq8eVfrWAkCKYVlSLSAxIL2Fwi/fuhvobfFMj5BiBb7xJTkkacvdoq1bN6sQI5ad7pX6RL5IXg48CAxGYuf0Msby/dvQ5IILdeNE69UiLM5AjSySi7X8J32QxTcOF9xfhcbTWx+phl1p/FSXNPk8LcUb6Dhm8+UTcG/hvODJIc6tSXfGDNWDPGOhGpJZ1REvA/aSjZBdYROl6RdF7hJcqwCCKvNOQrsYSe59VbKPvO2CDmOaNe1Eu/NGQ8uSVtGHJ2euUD+241rXnbtbywMxtwGuBfq9Km8t+CVxdMb/niD7UjRmHoIHMB7C+PJFReAVi2NLu6oBaR4JDfzEXKK/HAgPnE61GamHmreG6z6nQO0N4jwN3Fmy/Pfj6kWN8wzYlVQK8+AbziSFUX+bsPLk5LTvndrZh4yqgsmN9brnXCjSXqkQMWAql3W9Hbl6h3/pR2NcgbgdIrgf9Ho14zYre8J5KWSH/VCIlvjOEhWg+F1dblDjDlTkXvTfHgohHeOlgzCKP0u1 w9gx/6xp +4traRN4SpEOw1OpSr90WE9c/vFJKjRotGaK7E242Yn4Qq0ORrLXCy+jiZufdDVHEyIfs3YWVovleab79I0QYChUoIiDXkSse4fvmFb2hTGqPJxc74ryuZJnvb8ClmAh0TjNXMRsXSMjcTTw4qzsrV3MoAK4/ggcr9dexG97XGsqkZGjG5OACD5JLaS/YZcGFFRVVJPleg6pg03dpmYBFF40uBwQ+j361e2vnXtnqnCSa2AF/Bq3CWmRyebe96XzgFt9cEf9dFuuhGftIhDXZxBqZ4sIn8S6aoXmA+koyBEYxnRlIt2Zu5kHYrQHhthiWTgDQTPyk20a0WON+doTstBJqm/WUn0siDK9PhhvUCQgaLye1V1eKt/FNvoIOCp69W+qc89uxfMk3Zmja60WT9QWySas0HvcPBCX5ddB8EHItzZkLlXrB8eLxbPWUbhpnmIigUCEHQ51acRc= 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. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 Tue May 30 15:49:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260555 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 2923DC77B73 for ; Tue, 30 May 2023 15:50:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1313D90000C; Tue, 30 May 2023 11:49:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E02B900005; Tue, 30 May 2023 11:49:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE99F90000C; Tue, 30 May 2023 11:49:58 -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 DAEDF900005 for ; Tue, 30 May 2023 11:49:58 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B76E2A01D4 for ; Tue, 30 May 2023 15:49:58 +0000 (UTC) X-FDA: 80847357276.25.5EDA280 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 6BA2E1A0021 for ; Tue, 30 May 2023 15:49:56 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=Yf4L+HYM; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf19.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461796; 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=v0H6G01iGbarR6jkv3pBNWGf0keH7ufLZQ+rs2S4Px4=; b=0RWDyrzgZIn0t+WlZCzoBJTKoHw/1ypKkIJFRhfbEljwhIjbziZYvaLZtKHj/ROxR/wV7t 6U/mrvHc9Hs6d2ZdyWq58FCeaH4VKimpu0t7seQMCSsOV1Z0L8kkDQqlGuYHAMwfi87Ck1 sIx17Opu4M/KLbMvxR15JytPKu8kr9o= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=Yf4L+HYM; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf19.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461796; a=rsa-sha256; cv=none; b=mneWXRX52w+DDU8h6TpaXU6LbWa0tgObB5vRTWBVtuLusRIfmFqFA4iCXMDyKk+Nkmk0P+ h+7EFMEpk+ha8DKMZxUl4WkpGcsdOAYv5ZGzVc1mqTt3SW6ZmkIWwP+6QAuKoQnbvOP0rd MODFAR/8Gf21H4OALY8n6FFo5jJXwz8= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461796; x=1716997796; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gSS6s+Y+KR0NN3bBjgfAzE61ZLWZg7T5kKisYNE42s8=; b=Yf4L+HYMaulRyMNExQqBIcbuZq6iNX8WbpjLzcr1AHYdjMJ/K6p7zfmX 94mGO5Y6q+nzwgLbeQZZV7X4Nbrqwyk2wjIU9ZwJxyx9kQD/oZB8iqfgN vl7r+gpeKYjR70qSCuOWCUkmM/LVd2YbHI2jBeHU6jREuQdE7BqWZ3ea/ XcHkaQuqV8O36KpYzJI8ROw7T3G3OPJj46bVRKIaNKUUx/HFzvn/mQ9t3 Jg/0uLNdryDNoAn0vuWo+O4kTyhZvrctwGiGgiTJWaLTMeWTDDdJLUFay kIbcvwFrEGwCMdsrwwIH37gXF1II90Ls3L+H+imL6oJ1+IgU5Sb9uLhWh A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="336465965" 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 May 2023 23:49:53 +0800 IronPort-SDR: birqGSQPJBJ/0GuLzKEC9JxZ3WVaJC4es+lBKilC7fULp/GTWqQ0aQz9p8aPGTbmN7vp7Qi0rS JJyN6q0Lh5sYUhXgqfOchIdupjpfDMezk2CBzPF2MmkUzuLh7bVWNvOF36yCSro6ktaxa+80kC tAnEhJOU21e4m1R2pjhmY3BxlLPL9eqsFNxNDhdC7YhnXdhWaKCk6h/9LmzYQ2fA1wzvjBGyzi WYqrQdK/cO4iOXPYRFwlJEwjuqmHcSjIJ1ATwoRPxyJNjJEqdlDnkH3PJOrCFU6nOdjiY1KTqx 8Ec= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:06 -0700 IronPort-SDR: zGTfFG0qpO3ekSs1jkbGf4NhCicS6v3Qh5GV0UwEUz6d58kwkQKUnQDffRvOn1PEv9wQNQpTvS L1oZuq/z0RSqONooE5ZtKTVt8hxkZujCOVwJhVMeym4kHlGOkhBiwzfmYNOjlDQQVkrsyxQ4tH p80L+3HwbQfc7Jh5sAenLjk04IkjBZOWxj0Hrxyd4f/4OoEOyS4v4abehlJeUA1wJ/hSkRbMfX MOJa9T2/0JxEuYE5ao9I9xF38mYJMK2+8AiT0scG/a3lHdVDEa8s97Vq0v8rwx5fkZZoJMlOnW T3A= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal , Dave Kleikamp Subject: [PATCH v6 08/20] jfs: logmgr: use __bio_add_page to add single page to bio Date: Tue, 30 May 2023 08:49:11 -0700 Message-Id: <328ebcc2da2307aeb03ce17957a73547c1222e34.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 6BA2E1A0021 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: jjma4nu8s9ix6stw6o8z9s9uqxxicotx X-HE-Tag: 1685461796-261516 X-HE-Meta: U2FsdGVkX1+TyAU4D32T/GTga9f5DqQXwsz2dB/glcC96WJ6a+K5ivCQ/cIHTNM02gxYHQhDOE6WdGoxPT57EUgjMfkrwx5mrMerz+r6bxJouJ5antO+DaxrboXgew8Tr0pO9ulPHihT3Y0WS3n8l5XwEvY/Wostoch0dNwPiiy4ZkQZfTGcOhLGtMGrzwThxRrC59d8lcwj2NJtJcw5sAPBmUD3kOGwNRrJcc0nZbpz9qwzjcyBmNlhZ3fq2hSWIsCEoCXdS5ptIQPwcGKizcxND6TDa1RdQSg7+/HXSdwOdwwGNAJ/qk5xidA/6dcUYFJcYsdNXM1Pb+RiMS1Bfm1f4nGY26hgmKN3WHAxEp4S2ZF8qmcKyLcKRty3238ym9BTYPQH/6CcvjRW7YOWftrDkZc6wh6XeUEBkwlGj0xfgyxWO5auigi0nw5gUoKTBaLI/xigPVVfC5cw0kJdDxunm1gOh5GCfKwKZkflFFgAr3BZ1KGG5mvvAXsH9HDhfzap7R+cK5CclB1RSAJm4L6EioHoz/vMoLe40u1fvRb6E75ogN+oho2KrKOPisAQSWHJZ3boVP8SuWBCyE3Hu8UMefxJdtg7gNnpCPMe1eDqyUs3O3Ue55LeLEje5nmT2UM0C4YQ7/PcJ87SEfYq+uQ/be6txHPfSr2X6qnDEWyCFg0RtAov+epoqPWt5Qq/87XVSVBqavmHjo78KdpXVbDF+Ar3p+4OADxjVM2aKUIFwAZckQ8eAoFt8v2tEHo7JNE2Rw3X9IybwHhz7JD3ajUyZ+qGH3/ysj/TbgPcNeOy80T43Uu1I0HUhrxrTIKBhQm0iE11Nuyh5/6nxc5Ubsiqmq9D6yZtVYq1vyXHxYBLprSf0zGCyWI8HUhdVsfFZQwaAz9Xsp8QpIySm4bPLVLW71r8qQ4mqvi2hIC0vC7Z/1wBqhMIdmRJNnSDt9r/YF9ZP1y4EKiWYVqJNFl kPLLE0Mk 4tg7krEl0n1CM9NapHaLUqsqA/g9UxYRn4wJp2wi+3r1fMtiAIF8H236ReO5ihK7Bw6Vk0DyoFhHwennF1kIjWkgsEE80LUBL9pN0m7ngZAZNoToHhkgICyRh5nBEzcoTCCgwGkTBUkSn0enxKsVYvax+8NfoUB4UxuvzPtVk60Fw+Vyf56QGybie84328dBOd/bHAa4D7YvMqlVOXcA6GGmJt/HBczS5NyG/dnRhjrRbesshvEWFkXU0j8IuBCwx2mRUu1XJhO6lGiLnHmaTkraswUUMjl3wrDuVotSRS4WXniWVhBUn2ns+aJoVtFv/kLwLWxFFJYXm7LOv2pOG0W1teJDlPTLdUmoC3W0FtysstPfv17cfubfYtMUqjJtl6k2UJxoAi3xi1XrwtcE8MmdZajsp/rVOoyWcmlCGcS8xDkM= 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. Reviewed-by: Damien Le Moal Acked-by: Dave Kleikamp Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 Tue May 30 15:49:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260556 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 BB749C7EE32 for ; Tue, 30 May 2023 15:50:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC72A90000D; Tue, 30 May 2023 11:50:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C78CE900005; Tue, 30 May 2023 11:50:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ACA1390000D; Tue, 30 May 2023 11:50:00 -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 8B074900005 for ; Tue, 30 May 2023 11:50:00 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4E57A402B7 for ; Tue, 30 May 2023 15:50:00 +0000 (UTC) X-FDA: 80847357360.06.1CE8E9E Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 3358C12001F for ; Tue, 30 May 2023 15:49:57 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=hD2UaNDg; spf=pass (imf29.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461798; 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=Gby16rdkQKJc35hmFAlcZKrX7L3pd6WhaSEu0owJcMM=; b=KYoqolaVbQiQIW47piMBRQfyaGTD1ElbxlUG3iDc4o4HAHPth4ZyoEidECGhf0fl3YzYu7 NBq3EkD9QpyV4byrAHEm6THfd6YxC0yc7AnXwngIGm65D3BDRUA/d+jLvDxvCop00u2l3I lHY3fazNJQtM+6Okpfe+tGePKzRDAg0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461798; a=rsa-sha256; cv=none; b=UiKG8eXy2qUlpM4VjxENjovE8tvPHShWrFASN0ZWTAliNZSdvEbIXqbqcb+EQDnPgl++dQ zRbo3nkbBlds/MKQ0xPHJIbgDcks89VrAPL6cJpjley/GssP3q33+gPodWMBDVlpzRXxzj Slm+EOUf1S0+TZfSCD0WzjuL7q8tzHw= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=hD2UaNDg; spf=pass (imf29.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461798; x=1716997798; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=k4Zj5ateI81PgQX8IcVmz/ho3EHE64HEcz5aupY7/XQ=; b=hD2UaNDgC9YzkvDWStaT0Z7F8cfWtUX8Q+KnOIFwNU6LUeqtezNnqA7i inCUstOWKq6hBIz1qqAgVQvV+kb83FuQFihSSrJvSFIjL7vaQmUnpCDzv OJddAAdoC70zlNP467K95hyUrn5110VhVCbpudcFNR2mz6/UVBrBU7aQI JWhNds67MSR65/9OJ+pSUw6bF8waZv4WtYfLmNVXyzFDYLBLaVxLSIN/8 VVMgGE2pUBkEji+3u7evE87N9P/iKllZooQtPR2uhJRbwsrtUCR93NpUW WOBsltfeKIOrp+o1fsjznt1Tyoo3D/4moftbgzlCUrWI1KXiZdOX0YoIO A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="336465972" 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 May 2023 23:49:56 +0800 IronPort-SDR: prvcw1+hgFYgEux+axWF+8pby6ZhprxGH+eA0MlCeW7MOhsydJ29dJxpElVUL3i/6lz33JNYIH JVEAvW5xxBsli/aYBfI6Ujmw75ooOtIpLJ8GTglfB/F/jwBm2WdFcy/9zoU8B82Hlx3W1qApUA 9FkyxC2tINkTxEKjYHKq2PLdI7i/vE9JBIHvQobW4dhQw8dz3PYG1vIEq2MP7bltOjKImar8mC 7n0QDGzpsrjXACv4gHc8dKWoGt97WpRvmRmM4wXaslh0vtJ37O6fg4kIEUs8bNIlDIyjQ1hG/S S7E= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:09 -0700 IronPort-SDR: syhtlBwgzrZqo2FxlZ+3+3UNQOSy9KOrXWDC7tRnbhEDdQ7M+iJ8X9kfYPjunQnyzAJ/BUunY7 TJFCtDpOg2F5DZ15LsnpaT3Bwo2hrn6uLSc+fNqG13pjWmrx9wooa6bynhnNQMlDHsy2Hk38NM QrDHnT8XkrjMZUyM4mGcFvGUGlEisF2RVaO8OEk9Qwnu8PpGMQpoWoaS1QquWy7J7yXqddyE5U EJEo3uszMCInYfCLIryejOvT01pFM14+/21EyuCsYg0N/wZvR8GfT4QE1m8ln383WoalorxH4j QYQ= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 09/20] gfs2: use __bio_add_page for adding single page to bio Date: Tue, 30 May 2023 08:49:12 -0700 Message-Id: <15cfecbbac931aa18bfd89cede85bcde1d6edd77.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 3358C12001F X-Rspam-User: X-Stat-Signature: p1d59ss4og3kqmxqc7f3xmgqf41yubyd X-Rspamd-Server: rspam03 X-HE-Tag: 1685461797-533532 X-HE-Meta: U2FsdGVkX19uEYOyqHUbT3u1pcvW+Qct7KY/BS2mKCLLMgFc3E7uuuqmNVxJw14/XCMc4YLrBR3v87bpoZRXJKjJJgkwzOfjUqzP4Fbt+B/qAYWHoh0LMrvvhXN4ws3l6g37NBiJT8SL0u+mPC8tfdF2zmx7nZNovvZIw80T8eVmoNkgExrpIwgZEf+whAL+ZKjQgMXLmSxWULUFCLShLly54nj4MBRY7aRlwuCH5gLur02UEYrGUNPjTWaA2tJqHO4KmdV/EdSpty1spzMK1wIRBahOKCZlyv8kTE3UYgzvbW24YFbi02jvj3fkabtJ1tQAZymltfol+iiDLMPSCuaGfaMoaNVZK+kmVvnTjixbdHr0KQ/OrPAHl99xF8+Ln5EiFlpSLBd47A2o0A9lwe11XZlyFefn8b+IZ5iUgow+VEDz8mLbp1W/wY9My1zXsQkr3rh9K6N8Ms4BU9oWnm29WmV5PPTjgwLHzeLSUR8WJTN+rOdANkA0BYnZ/ARxbKNfGddfSIr8k332jaxfllwFXIqka7k4MYO5pIw8k0n6vyCIEiBv/zf5CInVE+pfpfIqHYYHADRs4kePd2aEC2UTbxLdx2KCgeQ3YGQhS0U/GZeShkpZAgCOrSM0hOx1JAMxe5K6Aze5d6U0vmpSSvEI0YST3FsSKSiDGuQen29ZdfaNq3mF/0N6g33Pb/AyMazeuZ2P6H0LXFz4nGkeX387NQrAuE2rrV4FM3L1nlEe6hDPE8H9mjhbJ2zSiGg4aLHSLIC7C8mayrjTojrz+i+LR4u0ldnXCVOh3qi/ch6/4vf5KN0dDctW0f/8CbEm/cPEO67UEftiB1F86tA9yCpoALwKtWRAC51E7kFWCVo8cNHSAsOixhhZJxF/zcKxnmzbEMonU3ygb8XtCvIwElRDzkMNr30hqIX02H6Ow0N7yVcIdUGSRaI0fj4140oIemFNCXtYjwhSMzocRja b24MFxfw 3ycVL1aTW+hzEBRnaK+K+p0KRfjTbIFLGEwtH60LP9eq3BtIzzbTH7kDqQLUV5psOMLBsycnViiB2UpDvWM/rp/9jSIfZ7c40RNIStL3MBazeIoQvZKKSAPSvBnfjChyBp9xaXall8izGZS73FjYUZCPuaNP0DM68dywp3lt7hLJCTmllra7RCGpRgaw3nU0YWmTq7Qejm1T78VLOLjhLGB1hAtJv4GJd67lwY7MQ9CVQBqyuvTrXRik9e2dHUU76LR13ObwW2k+i4H0rdi4n0H1ULPRQSxY8NPeZ8Sij7efxDhvTPOFteXLw9HPgdczqsqabmprbMJjhtm8D8Wj6/Z0c45VMK45IcLeNe7rL2rXsJvMeC8ku6XqkLGhllhna8hTWa5TD0LyUYb0HEOSAaWM7+qGL/nUaSpzpmkATS333LdE= 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 GFS2 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. Reviewed-by: Damien Le Moal Reviewed-by: Andreas Gruenbacher Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 9af9ddb61ca0..cd962985b058 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 Tue May 30 15:49:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260557 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 7CDB1C7EE33 for ; Tue, 30 May 2023 15:50:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1591C90000E; Tue, 30 May 2023 11:50:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DE3F900005; Tue, 30 May 2023 11:50:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC22C90000E; Tue, 30 May 2023 11:50:03 -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 D9FF5900005 for ; Tue, 30 May 2023 11:50:03 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6E381AE11F for ; Tue, 30 May 2023 15:50:03 +0000 (UTC) X-FDA: 80847357486.09.80AB1AC Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 5DD841C0016 for ; Tue, 30 May 2023 15:50:01 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="dEBucN/0"; spf=pass (imf18.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461801; 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=nmPbEXS+MlTpk7DPeTJmCFg9pOUjJFv/4XmohKW+HK0=; b=JAXm93hzFrv4iIbqUDwx1OdYW1q0tWwiesStVXeX//kiR3ekJnt8rHHMM6e2FJVBZ7lYCK NnJAA/GQwLlIrotBQBmRtF9nhuZQ/2NvpU69e20Kpsm2fPQY3+nhtBnah7n6I3KxucJSeH 8/9Z26Ule/Otq/N5XCSzhW0cdm2sKSw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461801; a=rsa-sha256; cv=none; b=WoiSX5xmVg2XuQuiSa1ZMem+TKd7BGKAMMOxHOBLJq8oDLk5hOTMMUQsqjVChOUiVTMJxO CLx/ybToIdWueSHhooNDUSWSM/8J0ZtQNWPUjW0CfZXEnIDtk32eb9wR7ZDsSmHJDtUnW5 9m7ubRR4nZZGShGm4xVNgNatgbXeyvc= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="dEBucN/0"; spf=pass (imf18.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461801; x=1716997801; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=l3onFYf+ZZCsjR7ISuwDOJFQGwH0Ly8JQt0dIZLYRR0=; b=dEBucN/0cctb6Mq25HyEgDFYnvQwLOF10S+hItWENORA/sFrdzGsgopS B7KGuanQmyoIcaXyb8fRRu5zLbD0MR5wSPNwjCtbjARO5ighib4NPHoaX E58y9RNwK9d3tzaOduCyiLy/4qVr7NPMXi82l4PtlCff9dpy+agdJoqCw UAwvaIRZ0wN/jiCfHWIIJ7aBHW/Zne5IvETQgx/jDqrBA0JbCMigit03m VOLUKTbAZZEQFfOza8jU1e05QaR/X/oYCG3K4GGscYnCF9bACSgyYpH31 QvwbZktqrX3u5jKQ75qsT6CNEZJWENnEM/OK38kPINiTjhF3pOSdqzEZp w==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="336465975" 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 May 2023 23:49:59 +0800 IronPort-SDR: WEOagx9RSqFVv5qweGTCav4rWiN5nJ2VkNu35LvZXqgqLAKqt7vo7vUcLZMPvRsgv4aZ/P4c9X wd0npFvPVmuZUOulYNtaJWkqV8ouymtW3ncUhZKld2UidRyAI5V5pmAmOtmHAn/7wNZumOGcqv l30YypnVmzgUpxp1gob4z60zq0C29tNfCpd22lNclIwuoldUDcyJkqEDFo9r1T+tRAytQu8Sxp /SrLUHf0kjMb3LOH8HmhsXTHHo0rn8xhiqsJ1UFg+cPUcXnMOG89lpuJMdALd9uUfohUhh5t9W VkU= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:12 -0700 IronPort-SDR: ZMHPyde+x3oZg2TtUSRL/5p5WqVr/ZfKqvYwCZxUYP2qYQ91FJJt40KpHRQdugU8uEYsX/I3K/ I9FEFvtZk6Bs4sVviWPES8u2Sy6mkQSXkjcdYwONAcCuJSehDyyyLlFwpmPv+ibIXsEmu0GWG4 2Y8ns+RdUjXQlTNei1wm9AL/aSe4WsIWt+fbIYohfizzZXwI2DiTr8AG9+VlPVIh3eTqf/W2/A sFbZ+/LPFzOwaTFd1WGs1qMqHoly+Y7z8CXi9+Jw0hugo7ke60l0xnB9VSjPDyKn0GdZOBduyf BL8= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 10/20] zonefs: use __bio_add_page for adding single page to bio Date: Tue, 30 May 2023 08:49:13 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 5DD841C0016 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: xfte3uzmgak8bwc9qr3bw13f676o5qq7 X-HE-Tag: 1685461801-103684 X-HE-Meta: U2FsdGVkX1+ILX726uWMlAHIyX0PXS9zPkifDJhU5Eont/2Yw8LWJA7OHT4l5A8DnSEilLh5yNU7SmLPg4NONHi1lcsPJRlCcTy6IEpwrFklgqJnWRAy8EwnbEMWpE0sUXzM7Mg6HJg/XbIGA6UDvkF51X1+1owsGEOWXKzT2YkvUSp0LssV0FqylJZPWzzOO0Gptq0EwG4r1W9gHQOOOaZwqt1f4F7kxt6mmngUFzAlp2DsL52TONYV882BBLMNGgTUhncCy72rBWoeEgp+zne08zCPbG9N2lYv/X6Ved+HdD7kgiGK3QiqWNBJ6qzUshzqxvt5Eitr9FGg5q6OUKZH1XAlwatw5mGj3rjgNsar6Yp/X88YkLMPkAd2a0/Wc57xP0JR0pN0Ee0TPsywaNumRMgWNCVy2ZcF5n/MvuFbhYbfK6dzeOgoEL26Z/W3syBccEpQphnxn935992MZCSlt8t23C8Q0xSb3YLNfbVXhFoGY3cFDokAjkeVG/BJoW4eGnVc4xglI6Jt45SMqegJPo0KFuZUCvzGlKf/ezyOlav4rOaVcBZENe9Kw95Qk1ymf9DIGHp8B+njX7kgH0yl3tGZnWu4XruPgivpHHLR3yzquGC3BQk6WOlXheznj2BJ5BEPK5Bhpr9dvFXqjtneKQXKhVKiz5DTdP8GpLefmdPXKu/41xpv/NTsS+AibzOYH4wun2mXviibiFPMh83z3NHKbg8zGew+mq/23ywzMMBRRJka0S3xsQ+c9gj1gbYLEb4va2ya6HBWLiVHNSwrlS47LNADAlb4Yxe5E09Nl39lSPyqdvsDzIuB5giDavU53g+OLeXt5Zf5qYHYVT8nAkbmhUSuW95qoQRUJn9vi5Cc4QhCcQcWxPFODvUw8u5jeG1EdwcMIqhfi+MAdVENWlRPlEd/MdqoTL8oUSvj9kryG8qGtCn0wMHTUaBF/r7ZVMU5vHWoWAXWTRt 5HdP8DxH fxCLFQwPIbms+96nAq+D2w0ZZs+FUp3PZrqDds3n6OL16Y/lfuLY5cugZOGSCm9x0akUZTZ7SM2DHaDNZ5z5gLb7Ys3Lhi5ichMMHC5m6KimKLYKjJ37XLKE0z8q1BkWPN28gsLzjY5ZxsL5HU8cz7spPL7qKHCwd40D1fusotSW0x9/6dBsZu7p74IYx66YQx9I8yA6fSdTiNM2pgNzcg9GpK4dWLygTQlBX/S3rrysNS6M/9SMGCMvTc2abSDv/RCLbf6A56gDvvtEiVXj4ie2IW4hvRQtl+DPat/cRnpq1EKaZG/4xYn+CPY9QYi1w0/SFM+OsxojZwxWo7GF3x2l6yoOuM56sY8DMnBy7ulub5ZTyxWlQjhFN+W5ipZKgve/MuFrXqHFSkF+jPqAfjXzD4g== 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. Acked-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 Tue May 30 15:49:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260558 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 05190C7EE32 for ; Tue, 30 May 2023 15:50:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9440D90000F; Tue, 30 May 2023 11:50:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F5E6900005; Tue, 30 May 2023 11:50:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BC4690000F; Tue, 30 May 2023 11:50:09 -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 6C7E9900005 for ; Tue, 30 May 2023 11:50:09 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 264F31A025A for ; Tue, 30 May 2023 15:50:09 +0000 (UTC) X-FDA: 80847357738.05.95E9E27 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf13.hostedemail.com (Postfix) with ESMTP id E29D42001B for ; Tue, 30 May 2023 15:50:05 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ebFMpGy8; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf13.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461806; 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=VFstOFR9dzYVb1+kw7n2RDQsCPpdALjz5MVzELWluVI=; b=LwYStEpM1qFT1FxW4eeO85aXAfa/R9RwQ+vclOxUub3uYEkSoCtVz/wREFwoegl+Xv69zq sL/vy+qjfzm/cLrlOhnp161+oa6RPCx7XHeHxIHhsU8Uvv9ar0BJsVNQwpqgxwMHwf/ckE Um/sttHXQeDsWRllRIQ872/8Wck9whM= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ebFMpGy8; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf13.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461806; a=rsa-sha256; cv=none; b=EWiz9HVI1L3SEVoFgOhTdEkM5zBwqcSwh5xKtDvOuMAOwivOlGt+1R+XBwi40KZ5NcJmhW sVP1g1aANwao4qdLLqh7adJ+tRzRX0FLOja0fnBbfhJ3DOe9XAMcxX19oEnKJPRTm1IfkB 030sNRpS0EWCMfPBHto7Vjgxb46kcWM= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461805; x=1716997805; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eFPese9aJpJiKXeG5e/nRQTUpeUtTBckLQcuuv9Sgrs=; b=ebFMpGy8UhO28I/xmPysd8JUeDXKU5jIy9o+2MnLy09+pttt8s+ZPXq0 maksThxU8JoRS7wty8hOZam6sZjZSOanzdVacpJHLia57/SW7bXkJSqDo QjFm1a9H6siM6az66txRfWhDN91/+igU8DRLcMnVDQlcSHUNCrdGsh004 VenZojkIR68oqeEeMm5puoRoWbm6IyrS+Qtkktp6iuDJd4qtFQuRHQJYV aGwf82hTUv5JLkGTPHJpnBZkaYIFqK0Sa1cAT8B9tPZOzAl/KtWdK4MRu CK9APldtmYOsWYmMOFG8gAcGT/3NK0Q69nqeC7Vcefv9FyYJRgSpj48HD w==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="336465984" 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 May 2023 23:50:04 +0800 IronPort-SDR: b6PXpwBSJTQ51aD1mjVdXt5X4aJB9Qv8veJBY8SKoalvk/tk0mtHr+gajWhAJ+Qe6Jh6tlTCvU 3dqt1Mm3nskqa/Bii3+lGXA72fwzFwmRgO6VbziUvccrltDXBOHVLWXphkUSZmSkKYI5XbnGC2 2ERyO6onZv6rGZXnLpWr/eRyZ+n/oedJv0V3jLI64uGgG60Mxj6Moxd1W7Yppxym9VYGq1pgiN mRFnwJFl5S7hO1H3FW7ia4BMrgENy1sj1VY8N36d1NOfaxO8UODq1SWcMv/DDgoOLtPp7Ofbcx 8/Q= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:16 -0700 IronPort-SDR: uoO7OAb8Rbai8cKgJymQK7W4XKI+NlAnG6HDCi8QqM7mtI6E9SBztbMSPVAHHXkyD5wS0TiagB zwsZz4Lc/J2aZzF+Mlm2SSoQODj2TQmcJ97GwYMdyo0esUPwJRVyQz9paaoxA4nohmqRdWmmxO S250ZL7bmPo0YQ7S943KQRNaXs/Lw2JPLCCx68yUQpjAN3ERvara5+yzICrxbaCvHvUKuOeFn5 WQ2BgTAjgwj+oUkxmFhmgnUej8e/Wo6551HAGEv9hdjrJsbcc4zdEck0heYyMZJ0oinBH2yZjQ tl0= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal , Sergey Senozhatsky Subject: [PATCH v6 11/20] zram: use __bio_add_page for adding single page to bio Date: Tue, 30 May 2023 08:49:14 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: E29D42001B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ragt1sciqi6raga1zqbe3t69fr1cqm6d X-HE-Tag: 1685461805-427426 X-HE-Meta: U2FsdGVkX1/Ut4lEt4NCUUvNOd9KdNn7l28jPO8IRf6URjoW/+eCVQFFcl0Iw5ZmyP8oGgfchhQfiZdZ1bKYHr5Gi3mj3VKW/BrvIKj0E4F51UeKcdaCQQDrIO+KT5TyX5ocs48yu4We50jGRbe8htt6ldQDID22d7hqUJLeEyRF3856RDAv2Pgh4dyKuGN6vv8tI7mobxbY9l9LtSHWcJzHBWtRwH14jdAUDZg2iWhJIPnFcTxU/pH25y1Pe+b+khP8+4ddnzAin2nXzyN32bJFZSFkmZo/VI5ojcg7vENb7H3BpYVNtBhJasQWbRj9sF65M6bUoeLtDDCgtzlchEp+hljslzNTNbil+NpDchx/UuEiY/9hRTlsY0sB4w7AZ4yKzPyJIaykGpiKzVLKy8WkF+fCUsJGXRAFz43rgp6pxB3UhMQ7LK9H7Oi9QGPIMXvGIIv/igooW4UfFXf78vydghoQlQIntVFDRUNX3omT1TCTaccPPIqrGMC55DWPikglGP+JYxqv6v2CW5hy1gUx+DJOkDBZZ3yECGc7Qtu+qIgWTUhpYUXCImMXEsWiiHOrZJc5k33viyaA2Cn1yZs73GheaA4qrqaeE+4La4jVN+G71YqEdXnCh1WSpAfEn79lnfvqcHeVd2MPM6bbkJg8LwBAqABQMMYalEE/MXTZpbsDXQJhpxa77cfyIAXxlsW5YAWa5PwjSXaBwJCHHHXnYua9xuAY7vNvD5NPdM0gXVt1CbZcx+OfSwbXMfN65ta+JEH3GJjYbvcZrozpPjI6Bqwr7nrSzJuAXrxGQjv1MWMj2sLF9WElgYJbSmMR2ndvgOg8so2TLMKSZdVhA+2PDA0fZHjtKTGsbtqHRzmyiCmz3TrJK5ZoYDcwU9mgxw3zZoCDEhh/UALzxw09yQTqLLlVUluoc2RjdcqqlqjGX2hXQcUzPLOkNWHQoEfb4dmn2zUodTOWtMH1aFU FB/2XlK4 +N6pIowSZMTSfR7Q1oaqXtFitlsvJpBqSP7HJrsEQztIszEk6+C5ZdmUVDKcNahhbdwX6qbx7vJtQ39DsNPiFgUUD5OuF9/pgFzBekcGv2cJAX4pZSc7QyTEY6LxDCCTIVVVIEl+d7zHPGB7mx11/gJWjK+3qfr7t+NTYX4m2OUJR1Uuy+uoW7X2VQgSGsbNxJY2MRTOZTrGlPBzw/wsW8yJTHHWt2SK8KfmCQNdoxDstKkfh9gXpC2uQgBKxDFb29Vw11jcxEL5hXNvm8uMBINJFPnSZKma+t9IhaeH8jnYsc8fvOHhZZf9YoVknNocuDj16rpg8EgMDsysqa19VUTuPxGZBQAZccTOh81cIIxNC4+op0RpPmqPeBLji9BH6kDsQy1aCtPueA6L48uPIbe/ns1AfvgomQ2vwAU0RDz5QeKSeuXn5irLhQTs2ICS9mOTIlNzF+85G6uE= 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. Reviewed-by: Damien Le Moal Reviewed-by: Sergey Senozhatsky Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 f6d90f1ba5cf..b86691d2133e 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -700,7 +700,7 @@ static ssize_t writeback_store(struct device *dev, bio_init(&bio, zram->bdev, &bio_vec, 1, REQ_OP_WRITE | REQ_SYNC); bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); - bio_add_page(&bio, page, PAGE_SIZE, 0); + __bio_add_page(&bio, page, PAGE_SIZE, 0); /* * XXX: A single page IO would be inefficient for write From patchwork Tue May 30 15:49:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260559 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 0EDBFC7EE33 for ; Tue, 30 May 2023 15:50:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CEED5900010; Tue, 30 May 2023 11:50:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C85C0900005; Tue, 30 May 2023 11:50:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEE4E900011; Tue, 30 May 2023 11:50:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 95410900010 for ; Tue, 30 May 2023 11:50:09 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6528C120270 for ; Tue, 30 May 2023 15:50:09 +0000 (UTC) X-FDA: 80847357738.04.B3F482D Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 3C26040005 for ; Tue, 30 May 2023 15:50:07 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=UEHU0tji; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf12.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461807; 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=FSfLaZ0uUnz+itbfEoh9diG/Fo3AxNs8ZFZ3+lYsS3I=; b=msLuoW/QP0ZVkSZPUa5ZTG4LkGtWq63q3ph0LyjWADwzCfQySdnfhU2AfKWGZZGCkLDjok 09fBZ06Z+8QUlPA+Eq/DpwlmTpdtdWqA1HPu85srywPgxOn+SfZC9ZrREcrH9Ou/7yXtJ4 XxRjsxSyerPkKKDvr0gCerO2ZA5Jj98= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=UEHU0tji; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf12.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461807; a=rsa-sha256; cv=none; b=Bkj6cu/tdAULA3r0nPwikeRKaSyFzh46vRUv4Yl4r+t8DAf49AmEPBnU35/8QOp5T8bt/b aBwnmwAeoB87+Q8ax/aIoVPhR7Q69PtwYKm5qvyzYZwYLCG3XwbgK1ynUuUhTXD5GAkWDj N08RFnEfZiQqy2FYn7LoHaLxe3+p65s= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461807; x=1716997807; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=feBhECdTKAjH9l6zrs2xmhiYw9k0zkjzEVMqz5jiOVc=; b=UEHU0tjiOYe6N1u1nx+GHmiZVXsBiR46AQhfcyuuokZ2hzd2Hr7Tg9F4 JQek+1qpFwiYGScUfPDt+EA33C7MuiCvvb91pkdr0eXbGHNXTIV61wK8M 8SMKGSzoRE8QGIPWhRBd1YhPCBhCdtGXoFLFu04NxCkSqcaoXFywMMvWe CBizvtIKVzoHxjXUOmaqmiOKQP/qBhW+wvSP2tri4ZoD9UBCbkYs8jnqA YYCWQNzB2AFJp5tHddh0go+EcjvpuaNPJx7ixlHk7/9cn1X/mP+GJfVjG P6uw7Jabwm8BlILxNX+Jjp5W5K7W+EDLO1C1ZDaVsBa8S50c9GBLGD7B+ w==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="336465992" 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 May 2023 23:50:06 +0800 IronPort-SDR: fnqMBZCW5eclS0g3Q+YpID3dd6sZzBEbKVCKZHqomFHMI9UklNbI4KvJ+4pDTYPZK1Wsj4VRAm TBTdWE1dudNchPB8sHbYLf0Wb3a54yCXH5LfgXgKfkaLkR7vaE/Ni/79MRmZiy4OwOkzKtLLz9 jHXSyUeOnZXA5FaW/izHaFrBLQvo/rl9k2ntF4m78xUQA0aHkupwd2CIcIEQAjFnCtrGmXCWSP Ly8dNR76D2vnHEZ9c+umOcqfApxlYOtb+opCW79PQARIjIY37i9ckKBudIydhlSybJHNxSeRPM Zlo= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:18 -0700 IronPort-SDR: EhH4NXigyhjdlA+o9IGwq9toIdfLXKwjqpigNPLms4HX2ZY0xdq+HGjMqjM/LXPE0H0lh+M4yV XOUH1WqeeUTQLRM43o4YQyLZh/QIjvwzVGZbVmNMXHvT5n2wQIzYOdHngHeSW32GE9fp8AeZ38 O7IBIim14OZkdwKoUagjTCGpbHBhvSrPULKGTbznjjKuwsGFp7K4CnPG+U/LPiXHGWkqFNNUNH jUB2k76eBdmfrU2hEjhb4tbcKZs+3fgO9fPe2xuInJzHIOQ0mXkmAO0bd7p4K36l0YuHQ9uRO9 U7A= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50:03 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 12/20] floppy: use __bio_add_page for adding single page to bio Date: Tue, 30 May 2023 08:49:15 -0700 Message-Id: <7e817bf13ca47fd863385997c0a9794221df7781.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: y3um5mwp1o97dy8c1d51bysocra4nmac X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3C26040005 X-HE-Tag: 1685461807-895488 X-HE-Meta: U2FsdGVkX1+ePZxG3+17Rj48JMear3XOrSDdLVSWAtPux9yedzV3JpX/HZN+w/9gwwkscJursRD8THSVhV+wQY7iTm5pjPhQ0Zsuzo9vSsVP0pzo58nvVEfjFmI6DjVuX/cNIdjLqxCTaMS2qq0+cYWceNMv8VEvxXzkUhdXrD4IF5BHdY+PQJKCXtRTD1wHLy7s/yhz7VIyPGLCQHYQhsvuMM5NCjNwmZiBnTvyCGdS8qR7EODwuvbTrBu7ZpvPATQRS5g2VLhx2/kRcspmGtDX7cRcuJTRG7VVrrIY3o0kYAqudPxmtwZI8bn1OJs4XIt02J8PK2nn/ePMk0WT5XTdKLaqxp77DJiZmiZ1C9gVO8UPMozTD0xYmFaUxg/vAciM1P3gEjPnemm0pw77t7B69vVyhIX3DcCEWJxPYnCnna8O79RSoEVEq6gLjrdDKqsCvDjllgBz2cHEZdFUmfPZxGSwg9EAuAprk0bHdmQrwNk9iJ2TaPE7Jj96iPOvfU+xm3CCz/RdpWEjUlLKbiRmr2iH0aQw23uP+HR7dHHo2pAEchDUsFHuPIdpukb5lt3kf8mSMndOdOKexBnGHo6NkRv8fSjS2Ob1YFhJRkFV7wDr03ANlkpx7XEM95o/eBZ2TISgt/8t0YfAD65azy88KFwfu4uKs9Z4N89vn6pTzZXr1v409u5+wD01sqPBMLDed3A+U5kWDt2IH7ZP0ArPPZKu3bQS0XSLj2YbSpNP2hLv7+OO9rYqduAaNG/eJli0ZMcvpmUtayTBVCW9AAsduOUyqWzvp4ieWpsrALNXAnEtFMtS5fX7g7dt8Qp2p2qPUFdLkMFB0sVTxXXU9it//rLI19ao1qmuaeyRatC83byHe35kvu3sotSDsO3V19snZp2qSLlWmrLRAIY56YRJ7tINNM04m/PbMaTTGWWqbXPZykhslcAGRt/TB3D8VUfyyKIxo4+HB9NHUqN hh+41FYF 0mmeKp/28TuJUIDVfTbQJoTIMjg84INOZ5rZvg9W4ocKsjUIu8DEvOPuD0X0LwdAI5mI9yMkxrcZoSk1UfnG+/+DqI09TAEZnz2tjMroH1R0UKWM+0cg4rKgFtWoHGKheHkpBcfoCQGCNBitDUJ3vDv2ak7ioEo88Bn4eVErfzzEFyAYPQdhnXBdDLt4/LjjU3mVDxcDZPxseLm//LcvQMy+rTh+34GsrUAbdcslT3EpzCFHlaa8FSzAlbOshggLDkqmEVUcmL2Yxzw/RU7xwvbZ/+ZmMBNzVPMUnQW9iRL2gb2KzdnEdInf1F7yeQOJZicEgDkWmqqOVJE/x7ce55TzRr1c9c93lzrGglntdK/T7M5j+NWONUFRodQ5UujtLrddxGsT1ui5yU3AA059CI1/v9Q== 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. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 cec2c20f5e59..28ec6b442e9c 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 Tue May 30 15:49:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260560 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 E2D3AC7EE2F for ; Tue, 30 May 2023 15:50:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 83292900011; Tue, 30 May 2023 11:50:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E2BF900005; Tue, 30 May 2023 11:50:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6AA80900011; Tue, 30 May 2023 11:50:17 -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 5C764900005 for ; Tue, 30 May 2023 11:50:17 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D2053A0252 for ; Tue, 30 May 2023 15:50:16 +0000 (UTC) X-FDA: 80847358032.09.E9B8980 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf10.hostedemail.com (Postfix) with ESMTP id A8E57C0025 for ; Tue, 30 May 2023 15:50:13 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lQcti6TN; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461814; 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=kfbXVXnOIfMtfpOW0KwQK8XZeszf1+haBQT/gEejogo=; b=N4bSrthEzIsP83AEamz9Onmilx5ONtwoH7/Z5rRdgOc89BuC7J3NiN6qAyZN+GfxS6I9+Y LtaQdARvf+TE2lHewL0uySuVSxfApjpZSjvlCUvCmpawoTq+H4vcfwT3y+TtiVU+DIBJDV Wt4cBHss92lAccrLJQsBoY4BJUDQkdw= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lQcti6TN; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461814; a=rsa-sha256; cv=none; b=yviw2h1sR4PnWDFB1B/GsB+V8suH5crGIQPV5cLA7p8aCyhmef0S9RmPNlqviQ4Bgl4i75 orb/Ggxtv8ic2Mx/5B8JxDGkRa11vByS1byBD0Sxo1WMNepFaUyssnCFVnbnOCgEl5PA+S d1l5FUEi2JQJTHcUXSyH04Jfsasxem4= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461814; x=1716997814; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VBiHAYrZ5iVLErIRk58IVnEcVkubX6MqVTAomfOuNwY=; b=lQcti6TNhi0HCVUjGBjdCoykBkN8Ccf9+xsrK2rU5pdmYctQflR9eoH7 05YripkVW2SpzJhhscKT6Zc3ko1d6DMOj/BMOlmMZlTdWN/A/Wf3zA/Ff xbkufl3dotQ5QR4S5CZH7mtyw/svMXhtW1fy1/En6iZHSFAzWgrQhq7Cv g+iOAQV14Kxrx7mhAGzUybt1q+9hFTV52c+0y46M6RdfEvCnP8RX1qree uqDteo4riDyqsXimpuuHgpdSnNI4agySVPNv9OqJG43lYUOJ+AoOnOo/N tLU4c3fsY1Q/NSyN+Ll1JeHmkWyy4oBuqjLUgj4JrTTZjoe2qqz/4D74m w==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905748" 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 May 2023 23:50:12 +0800 IronPort-SDR: o55uNe0K/XM7tTZStlrdORG2MjVtzg82kaEObBbVGrdqlYfHLU2cqk8t0NBk0dtXxLfKQq20uw M+H5uoPSAD5y/dIFCqvYF8IccCol25mzT2uXZScOx/91yZIqM1F2nW5tmliRRS6Ph/RNtdssYu B6xwsMBu9/ywvJs+xgUDLFgkKeGEsu1yzgGqa8ZE12RlhADjBYCoU0CbCzZbJFIzhndVy5Molx j7ykFf9NKgyJgNfyj19WLwBC2I4zJag2bnJihBURE563xIloCEQC4MweMZLbALcCVxBvxxe7Rx 86g= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:24 -0700 IronPort-SDR: P8Y6Jd83vQweumNav4silCK78F18+npfP53U6otRJi27bXYVZjQeG19QgfdDPNWr1dSjMk/mR0 TdQwe1yI9lQT8scICxHJ6QWWNvtw6CpvMEfGKX0/h2/HRnwwlFzCTEOhpHvRwXqArmvKCIqw33 ppmdUhNH/kHH580hO75tFT3x/8Uyc3S+cBMv20/BBkhaZLKkAVgh0pxoEQ8eaQU2CR7VRKPGtI xQvmwMzb+rhKJ4KrnyzbkU6q4fYwpSUwIQMfpbXadsUNzjaagJ7+TEz8B0KEm1VNYW+RFH1x1t ltA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 13/20] md: check for failure when adding pages in alloc_behind_master_bio Date: Tue, 30 May 2023 08:49:16 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: A8E57C0025 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 66ryt5wj9exizsxa6gaeanno4wj1sd4t X-HE-Tag: 1685461813-133429 X-HE-Meta: U2FsdGVkX1+5n/TcIt6SD8G+CdSngidYszpvelZIJzgw2utu6KFzRdzfmyytdhiPeZus4Qdj5hzNuLrzsYN7u+WlAlxOxDx4S4zzjADRokINivWcpDQVxyUUzr+Gd2t96l+MA732KOZ+793YJUSmNbEBP9APA/xKc0snuJjGIo5hWb3oJ0fmAqEQXK8B5Pf9v1VREsh1Uz6c35sMExLywcXa8jsr/ykZlXhu6HoBof5pnJ1TM9qMM5UIBDeBzLA+jWkZRv28g/FRvjQQ2cXInzoCXEyt6r2jni8LZZEqfHIPTUN/oWWsDa6Mh4EgqS/tZZQOjzLfU+lrTkI905CGbFpjd1xNVmP7cuLg5841bpzx2gGmVpCmbo2TNnuZ261Mjp7cDmYFIcsYmVfhEHrMFgB8IxaSBLWOzOZX/kAMlGomW/qxmhpQoOvESAG23XDQalSyt9LE67MV5h4MnU43UKxXVEMPZlY+M/gFG+uxJWkW4OaVTsFXOhOm1Gzu2AOUHshGaTmzEn5zMG3VxkHlzzSrp3jKTRLOYk8LOv82tJpLD9BYPRN9P1nRYTRiu21mQjuJ8/9cXIUeI1I7cHbLsRN8zkkglWWvLZtV0TSM5R95ORl1cnugWY3p+xbYLr1Plv7zsrq4vDHt8YBfO8V2QeMMeA6GPKNM0tizoRj/226HlEaAwtPb/dLffICs4fDUbACGn1Yem7FTzbhP4sgb+anJIvWvTQgj0CWK/ErWkkXMn0s1HxGJE9J9Oibts+LNZ9R1PlS/dOlu+mJuR3T8rEDseHIjOCaZl2jEiAkVzZTwB0AeOgs371Cj7Ek/XYjzSD/bX7uQJeGv2HEnhGr3r3gwZbwKEJEUFkZWa4ECdHXdWHd/AmPl9KrXDt/XieV+fLPlRtb/Yi6gHMmr8bzwjbxuEA8ybl1v3lryi2yQXfYI7uyzwg0Wn14/HAtuasfmwC5aR9ki6360jFpVMom 5R2O85ou Q7mq1EAPUvFaE1U8yeTNNZ6kTL0Qe9bXq3hiEHHR/djfrv07dpdGeWH/qUTHy0Yh6+vcHVJoxQrNiTv5akEZ+frFk8GztD2bHViVCJQ498YE/JcDb12M0mB04ANWYS9O8YNFRdIE3JdPCD1yiGWnLfwdPMOsQns2JsJcvsM2sO/pLBQJK5R5MWnY1ErroeoroIHqAyS8Jsp7yCNxTTd697eWAxtrBrx8Su6fNij8acnHDbMLCDJUeG9YYmc/PXn/1IYB785LZZTnYe/6gpATHWYTEkB3CSQQMM6AkbQKv9QCXd3EjDnrull/nwcCesZ7gjkG7pWYRmKH0YxxcyzbfvUgyYnASkCCoHkAf3AKXjrRtuLMZ9RcWGYFWdkXazaqacIRcYa92nAALXg970qFpyQXi6h4K/31ZOeyefc7PzDAtKLY= 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. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Acked-by: Song Liu Reviewed-by: Christoph Hellwig --- drivers/md/raid1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 68a9e2d9985b..8283ef177f6c 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1147,7 +1147,10 @@ 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)) { + free_page(page); + goto free_pages; + } size -= len; i++; From patchwork Tue May 30 15:49:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260561 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 D7294C77B7A for ; Tue, 30 May 2023 15:50:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72118900012; Tue, 30 May 2023 11:50:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 683A2900005; Tue, 30 May 2023 11:50:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 524CD900012; Tue, 30 May 2023 11:50:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 363A6900005 for ; Tue, 30 May 2023 11:50:19 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0C094A0264 for ; Tue, 30 May 2023 15:50:19 +0000 (UTC) X-FDA: 80847358158.19.3527FC1 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf17.hostedemail.com (Postfix) with ESMTP id D058B40024 for ; Tue, 30 May 2023 15:50:16 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=HVik6zvR; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461817; a=rsa-sha256; cv=none; b=KnmrIhH52LdnYVAG0E39d+jwPQnj/iDMoSJR0tGUQbP5nmoSX6yuiSUY/xyCPtcgUG7+MI CDE1cT2vfhS2EFbschwEYXWldH7WgoEZktZDYBFCbFsQ7xIE+U2Y+zOE4yXFJsAbYqH2PU 0+cJ0Nf4z3PeXSUpE0f/kWCpOxO7lOE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=HVik6zvR; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461817; 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=Ep4Og3EKp8jaRB8BhVIgxkzNMdqeXnONg8MmnRMChMs=; b=I0r6Bogp7AGOMiWQjsc3lGpjUEsFjWa9gttdEryPFqRPiS3gwB67zsUqJ2DVqr799orEiH t35L2vUlT1cvmjToe3I7LlyygMt7WKfz8yf/nCf8pK2jkdD4okwou+5Mok3XZb3K/v3u/B ocwsq2Ppyz21EkrLfICoMjU4x9ctDUo= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461817; x=1716997817; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gLNFQ6oFKOXzjx1/s8qharxbtLHt5SQOkfsl+Pqo6CU=; b=HVik6zvRjvaPTGAp0zKn1hSolZ5VQ0+UmtIwpEuuSLMmOQQJAC3xPZEd zhpWvWmxkiP5FMWRi54/V8uQFaa3vkgBt3VeK6hiGuN/Vl6nxCcLujidd Cdq7TVri+jCIjcyPaS6YgTVh6BVPFMTZMhuXKE54cmKVYKM4O2DUMPsDR sZevQAmkBKIkudVUdqUl+Cf020rHnqoUXVpBeNHN18WjHBaYIq27ZBn03 gsC+cnGtElUpCEw7MFbFvlMfAsq7howPJp7M0peMvZxSf3x55jjOvvEmc Be0Icsd4aB8+iWemw5Ga91hcpb/yYYMPrJH/dlsNgZWQ0Cgu7r07n3Lgc Q==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905749" 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 May 2023 23:50:12 +0800 IronPort-SDR: z73r4Zq5vBhf4R9IcX3iJnTtw1DwCtWHAnuHrMfGzQC7fn4cvGYOqDD5l4BotzJiWJ74BQ0o9+ PEH2H7QpdFeHUAvok9iSVJExPQbOnzeCsZ5/ttqFvmiSN6L3QTmfE47XeJ8xniY63OoYrlWDNT 1aaGXOUn19Lp6ZdrdKjyL8zk9BiUhhbzJcil5cjcTf8wQ6lpm2UO+c5dMs0SoQxyiq7PIbvEL6 MNNQQZFhekLjC/TmAZAe95/z+fTAC6QdUK2pcvsU0xffGDjnmx80/iWET99tCCWeJWh92w/Wlo rqA= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:24 -0700 IronPort-SDR: snoYL5vkwQY2fHovd8/bCtXAqv6z6MFk87CGOha3y1t4nQ3bzraGCrnIzedV0/LXm49W2WzhWH OUgIPuepqt5ylCZ0SV/DMCPXbIyw1ZMmkUrTUJnzVN/uHZbS+HyYQMQ7p9zgdDgEpDAO0bKSNQ b9sBV2ZsNYFfhtNaL7pMTYRcvQHa2AW5lh3lf8gZABJoQuBL9ohV1zESC6t075E2qXQDGdMKNU jeEnItThG3PlPxvvohrB/SNHt+pgq8Cps3WQ5E3BrPDTb9RtzCLgejg2k7fg+5N4Buz0u9oIhz Zbw= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 14/20] md: raid1: use __bio_add_page for adding single page to bio Date: Tue, 30 May 2023 08:49:17 -0700 Message-Id: <05f4a70914885813a2ccdbb8aa7eb7d75f79329a.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: D058B40024 X-Stat-Signature: sja13xpy5s3eou3fwopep3qiztk1z4jx X-Rspam-User: X-HE-Tag: 1685461816-324482 X-HE-Meta: U2FsdGVkX19HG7Ta0N3qw2b3YCcY5fPSjrZ9aHxVRO5OXQHbC4mx4C4k/IO9/R1noY68N54fZyLYALTwADNVqPVopokIrV0ziltPJOQiW82bXc+yjOhQmC1EeZNrhO5diKdDSlaaArDZYA7PA43O4QsLXTXkVXt5W0YaB0nc/CQvaZ2X0PcolzUSUre4mo2n+8MBJ+LLKvFE+xT+9ANLX8T4+UWPy+56mk+rJuepb9HngWyAcOxoV8pmYE4uV0EPBVP+pyaz7gwcpNkx36DuWiBgseZ/yKRqkoMMzwHX57+nbpjXQoyn2z+OGqahPmXIBHb93iIQ6RYZBhl6Zvgj1MAL1Ak4UHXrloojIDL9QWB8/xhCiXSgKEMXV9NOKfLIo7gU4eqsfzXMGQIzfOtpvj2ek4PI2D91l6GWRhoUTX5R08RwueyRhvg1uDlqA+TqURy0t2hwhIcSHtlAj+TYcNah+pVCOsddUwObT81l/f009C6LFIuztuKijyfFNMze7tQ4muQNSAzuI1x6ErjFH/Inr4og0ipHwZk4mbY4fIpD5a1uKYF8rmFPdsu7raHYozMHDsSvx6WW8nRNF/NBjy9FKwnTpOPd/DrG8Me+M+H+lwfZZPGtF+U7XKUFMMa9pdAhFWTgbGwfVDKwqUSOlrSXXNmY4NYqWT35p1KD72sI1Q5HmE4Q85m+ZxkLXOuH/evgW8X82rJFrCblibSE14gPBT9jG3kN7VKCLBX1mjijjtFWjBwpgGhYSrHk6L0DfoG7Xzfzn/N3wgeNRj355WyGZeSgRZJiqTYFzRD6E8P85OnMWPXyBWQ+TOUzW7m+8FpyfEY7qMJDWMlSieIiOjC95BrHaUKRyEeZ730gy5GqCgR1FZtnm1T+bNUOvuImGnlczNe8sWAOAbSqg85iP8U5LdfscRrdTS5t069FDbEFaZuWXlP4pAj+boKKLFDr4vn8S+Xne66M2/oeBcS Msxa3Tcp DrHUrsDkTN/yoyl16oKGp3SYXNiTB7ivkiUHJIRqD9Y45PjxD21ASbu/pPGwQ6Y4d0CQ6N77tJwbKfG8fqqCGrEx0pH0t7qi7C2D1unjQXjm0xT1evZAlnd3IjSrTSNe7lju2hpzS1ouX2ochUJx9Jnsm+RmP25SpUCmZkdXhSEF6vRxzo8foGH1LoRXBOJUcqFrj2UUYr/cg+103MshLTC07XEa8rnUte+88hwoAkKbGdVxGg31gBIHV/fUzFJa+rFkBJHjeBIx9hBRyss34daBfsjChpYyyt6ovvajXdEAjcoO/I3WBM2Vyw7xrEfYlg6+ppYauq+Sr/8Kn9kc5qTuDnSr6hji+XCR+aHC7rvNAAs63ZHqUXP/LuCKqMJ6msH+uRz6yBDLWEAJbhuUA43A0CoOVo2YUnlaCUOuXlmkaUbLyTdGeU8yl+PS51+eztX1z2FXZ5uz+kdYoaKt0nANY8A== 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. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- 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 8283ef177f6c..ff89839455ec 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2917,7 +2917,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 Tue May 30 15:49:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260562 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 1F2C9C77B73 for ; Tue, 30 May 2023 15:50:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D16C6900015; Tue, 30 May 2023 11:50:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC434900005; Tue, 30 May 2023 11:50:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3DC7900015; Tue, 30 May 2023 11:50:19 -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 9C539900005 for ; Tue, 30 May 2023 11:50:19 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 66BD01A0294 for ; Tue, 30 May 2023 15:50:19 +0000 (UTC) X-FDA: 80847358158.12.31BFA25 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf10.hostedemail.com (Postfix) with ESMTP id F0540C0023 for ; Tue, 30 May 2023 15:50:16 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=qyQ2od5k; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461817; 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=coh5CBUvVZIC7R6lhSdYV3LoxqSD+fY+F1rkUy818H4=; b=8op8nZMi64qzYWCfe1rqiZD/RcEYCKvoTiTHQHBlB+JKQ8kzvqt5/FaGIsWk4noeixr4H4 uaD8+1M/7JNf7WSEaaH4oH9up9uW9ZhmLcbOZHqafMj61Qwr++slBsbIpAI/ltta3MJ8Oy Y7sUqvTm5mVflmykL7S+jO1eb90jpaY= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=qyQ2od5k; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461817; a=rsa-sha256; cv=none; b=BSN9PgDWPaw7KgdsBOWDgFEMIJO6og2fz+vbfN7lRXcuw5SKDOwreScqK4w2pALH0LomA+ IDcKZyIBIMxPsZ7D14NOKIrXRP3v2+nHwws7oXXWP0f6OhvAmoa2iyLN9wjisAVRAqFCIX BqQzY/79gMylIg+PP6nBLjYh9ZNnWJo= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461817; x=1716997817; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KgD+R+FU9CwRmwQAVm8lMGGwTIZNIyKz56pAeZ5nm90=; b=qyQ2od5kBNEp88da12RB3b3yQgaEjqEkUo2MMsupMv94MeXaTFuaG3Dn 0WeaEkd8wlKFS7e5KduWhy0xy/mUVivukpixN0nHgG9Pi6toMolM9TcBt 2Mw8zlTf2gU2xUecd26i+Ke0CaeiD7FWxJfmWRDcXTrq/3+d80H9cOGkD jMogxOzjjfdAK+8AMkCrumWfOFwbKBMosOW9nqx6+anHRmaOihGgN3MYV qAlQRGPq26vHhgRbMG5IdsbGUI65KJct9sp4OIpiHylO2TDhzpSzzGQN7 EvgtYtW4Q5bf4ZsBwdn0f8ucVe+BFSIdd15viHgt5o1h8hqfoITDjBNJD A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905756" 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 May 2023 23:50:15 +0800 IronPort-SDR: ttbEKiv4NBl+fJxNR2lfC49YfbJpgCMu0XqY9oFJz0/ZAEH9BJxcxyJnwL5Lq1KzLbO27QqQWV JLRKtGu08KbncKbHys3hViGjnaodDPH7VYfcD04o163JXzMd3SnjtCkidO6sOATyZNtJiozevq r21z5MWsunVds1Izk3KCXK7EJ7SQSlNiPB9tizZvle3Ldr3TTgr9OXu6KiRccJrZZWJ6G0G1On uiiojfl5FMH1eaKgUAuOEwPjKeBDcV0ddPaLrI6o5nueoC35kXsdmto621LE3maTxsS8XMCtMc 9jM= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:27 -0700 IronPort-SDR: 7c9W4va7M7i7mOYdzqZM8x7PuIzd8bUXS81kk72ffccwZ6ZkU4gnwE7FR84LvLjYB86fEAuYwt cXn5GwLOtz5LieaQs84gdIlp6RO2hZOK/Ic6UwD4MNGrVkqvJ5LsygmJvgCDU0mJKU4+2g9Rib NOa0IbGiRr60yWN5pk4jtqYmp4DsQOvrRO9O0wvUsb0lo8oWhw/bmV6Xf7GGSKfY/bdv8SGb7j X21UMdAublIFCrvsHnUfL3ViWaZJVFO/anGXJGxTYW7s2jPCdwz49/iJqACLwkL9I9X1q4xZdH KrA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 15/20] md: raid1: check if adding pages to resync bio fails Date: Tue, 30 May 2023 08:49:18 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: F0540C0023 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ig319rwn63uh4h38pjtu4w38wd7p3ncf X-HE-Tag: 1685461816-538730 X-HE-Meta: U2FsdGVkX1/iV/9QsJASXNt2pRywzvgIXVVnXbq+5MVfUCZe6m07sdbVSwWwaQ1DEc+jgJwt2SCXI1Lfpr60AwwkvgFQFUD1CyZfgAO9PCsaS3w5ARGkn2hcqnxGv5uVjYkiWHjOJsNwk6u6E2GN7+tN3e9tR31nn5PyUYUmcadowXNRXCrEpdTgJWYQEj6kn5cP5Aed4CT5VTjKzpXuWO6XElSiZ89j1kJvRZ8Ulr/m5lvarHP75mI7iIDFPkAkQd0ROIrwe1ITtIiMu9/md4RXZ1HYjz3rL2Yp+cDPGXnoxUUVie7Civd9Q0oBYQTrN9fMiysc0fOYoTl4yci2lHezr78x5xPp/bff1YfBwSQGize6kwgMvpPKden53I/ERFAWYwStn08Wd0PeuuIbw47PKXboycYarNut27+eojL1aAYiUoYoQvPLUj98uiedsH4wjwJgu0zwMx7P7z63M9NQaLnRzrFe2JfB5cD4+gzKgT2T4GWK3zznvQAK4A08MTB0rJUKMGaAkbrQ/0pedmkIhaUXL3kkBGgD5jHKNDXkClLFcFqVG3Vb9YynfNI94tvqmYTDizxi+r0tpgmcJ0Qvp00htF/G51pARWY+oDH+FLVYucs1bGAGPuKaxDEhKv41ePZU2IxWc9a+uH6OLZl3O64h81qWq7yWg08ipjX53Kz6yS5euY8t5gDN9YkyKvcWtXNN76pJSXSL7hELdW7hLqtx7X2BUyOewEF7PlJ/UxMKUjFj4EKneUvR2L+rXdSbkf2IKAbpVoLEOBB3Z76bIVss1eqLpXESMzk+yrY+evfIPRSPta0xqZX7UlaPXBNreuEiTOm2to80+I7t3OsqaXBXsPPdZtve6Wlc8zYMJ3fiFoFXjxbjBsk7kp3XT6/IakVDp72yoK9D3DsgmB4Vm3qtefYLPhcTGLcA29ru90Q9llOIN0wwvb6tLHQC2/2F8WMZW6j95gvaLlS s5wCHwIJ ItC0JAs2uUXQeuhprB2a8zYhC2SuRNG0JbSNO12wvhMqhBO6wXW8lWGr3L/kzJadSwg75G4DkYgB8BsO56A/JN02tNeDUbZqvI9cWQvsviapI2fPDsZXLHMF+4Lj5qO9T0Jdihjnia+IVEYByBbHBmtslSRAw3eywg9W9E5BwbCPvsVGE9WQ0jk+yCCumO6ru5nRp5Xk9JdMzNnUxbTBPhnl7TCR4cU1Oa9JqrgnnYsmPaI1YsCFyncf2JPpEgHShtUCB9mcCG7CvTKGYAWzwikVxv9geIbXLLycjhUc2gtqs95vwWx0N6DOAJA3xDId0w4CzNASS5ZGT9KM1UmGXodYeYUqozae7e2MniYCNMc0J5Vb6oXRIUbcXeAfQaQXCFFMisQnalw00hh5chH33HfYK+5dccle1jvO0 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. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn --- drivers/md/raid1-10.c | 11 ++++++----- drivers/md/raid10.c | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index e61f6cad4e08..cd349e69ed77 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -101,11 +101,12 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, struct page *page = resync_fetch_page(rp, idx); int len = min_t(int, size, PAGE_SIZE); - /* - * 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 4fcfcb350d2b..381c21f7fb06 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3819,11 +3819,11 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, for (bio= biolist ; bio ; bio=bio->bi_next) { struct resync_pages *rp = get_resync_pages(bio); page = resync_fetch_page(rp, page_idx); - /* - * 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; @@ -4997,11 +4997,11 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, if (len > PAGE_SIZE) len = PAGE_SIZE; for (bio = blist; bio ; bio = bio->bi_next) { - /* - * 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; + } } sector_nr += len >> 9; nr_sectors += len >> 9; From patchwork Tue May 30 15:49:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260563 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 1223CC77B7A for ; Tue, 30 May 2023 15:50:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B8F71900016; Tue, 30 May 2023 11:50:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B3E71900005; Tue, 30 May 2023 11:50:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A076C900016; Tue, 30 May 2023 11:50:21 -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 7E84A900005 for ; Tue, 30 May 2023 11:50:21 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 2AD9E1A0252 for ; Tue, 30 May 2023 15:50:21 +0000 (UTC) X-FDA: 80847358242.25.2379752 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf17.hostedemail.com (Postfix) with ESMTP id 19E8D40016 for ; Tue, 30 May 2023 15:50:18 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=hSIo2sbc; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461819; a=rsa-sha256; cv=none; b=cQfTMQ3e89ZtQE+EMKQ7Flttf8oVxWpONPdRyN6VvSxGoDaXrV6XHuoLEdXLcCEastZNsY kaK3g54HFfwEkTlm/QaYQv+bfQu+DiBr+nO20B3bg/hHtKus7/JIt9WI4Kg9pJSEO3uAVH 0n38uxVJQ5rTUu8HtzpZ3hytN/N7pfg= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=hSIo2sbc; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461819; 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=vIj6KpJJXGI4GjCHBbNFJm1+SIz5iVkLzC/I2Fd0ozs=; b=31iR6BwWmQOb6PucjfUGT++mPbj0lXTcEFA/JaaI95G30YCdTYzR2BvVxKNWIQbGFEdTfc uLVzHbYIsS1J1AZyq5Da5DFcW+Cg++EUMyeairsfwdKFXpN6fXSTw4kgw0B7dtMe4ruKiH zAiGp2cpayYZiI67HfC4A2yWVMHz+FM= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461819; x=1716997819; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=C+NYxtWZcIKLiQW8aZvWShDgl/gtDFIUIUOTPRiObYM=; b=hSIo2sbcpYOrUNQzqel25PTYTKAmi4gAzLVjO1nQ3ZLfuYhfYcwOIQzn gdJc+c5mtY5hUxwC6A7K1gqL/UHT5DlYKPdgCC8xhBnvbTwP/3evUNslU UtXEmcSFEvsWcH4FOCGS6Zabz/HQJzlh1CXhciHb5qIHf++frU41zPvrD M2q+e27AFIcjoukUVYNhURUiUV5UP055410skWpuOb3Tv+rI4JhXokVKu AA4TvDgv1bO6S1YHsbrjpPSyHB7CjJXHdPkrI/lNHWS44ZlQmVllTU8Vg DWZAoJI2Lj9frV92Tk9ThPqkfcu6uoyc00VO5BAWCiMz8f4lU8L2HyePD w==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905769" 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 May 2023 23:50:18 +0800 IronPort-SDR: f4s5+Rv6NqbD4Lo+bf7LrBlu3vtGMViLxeBROHa+pLDoeChFmDWvGCR5sCsYTBtcPyD56Lw7x0 dOGlfh4HVV0Oal4rnkqQ6NuW/y87a2SGlS5eTQEhZS/uqMa5ms7JiCU+hapetE7j2cuHyA3Dn3 MfXenBKinnY+DLdLi/ijic68PPA4BUOOu+F4Kq+PFGbn4hAR2HfpN/QDcoSmCbHr98jMQLIDUE u4MEj4j33bVnhiMPcmHu6nF3UI8rzN2ICGPFhQhs6KcjGNu2NHSl14sNi7INj9aGTIudy3E4AE 3J0= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:30 -0700 IronPort-SDR: nWMXgYPXj9My0dJwx11mPIKRe2pSzWz6O3nUVEtHmwd7YXnITNPMVp+01mOZjGN5zhcXbH+IdK m4NVW5MyTKxZspeJpQdq/5lcWtTCTrtHWknfnsfGCvolyx2j0ZqjEnJPHzs6IqRD93mSDPBKaJ W3wnvvvnGzwMhFNe3tC3vpLamIMSeTnweXnIJe6DaIylSDsi76tjZmEcCIggRMz2kCpsmYogzT umSo039ixODhCfl7GjDCN2dVBtWEhKpEVTPbeeTLYiBLVoeQNEC7m5EzM08Q+jnw67MjY23eAu xTo= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 16/20] dm-crypt: check if adding pages to clone bio fails Date: Tue, 30 May 2023 08:49:19 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 19E8D40016 X-Stat-Signature: j4bbuiyf3ajnqrch37trm8tsnbr1hcns X-Rspam-User: X-HE-Tag: 1685461818-42181 X-HE-Meta: U2FsdGVkX19wJ0dAUYsmZFEm8RS4mzuNqM7g2/JwenpjgmYSCrktXApmdA3RBJQiuSharE4ewCH4i9eO3pyEfjiT1gNv9tmQIW2TkkRsE239UJyQzGpEZ3AsqU9km1XPtRAIlWk46e/+ONhsTgiyelw9DjpVt8AlUqmGct47OY1m8S2VlhArUnMV4GstENNVrJumTT7jgUvTHS79+5q1XceDPc+n0nd6VWbHb/bHjLFjlYnft+bQr62+inXyaVrnltAleIhOwkHbnX7ekMQEO6e4PiiPeI7RDUPN+DnfBIRGogVy9rtnXifDMJhlmY3Y1rR8IzfSR7ekb5EmQ7YBDJGadT8Wjf2mgRSuTLsHf8kRx/tWLEq/BT6uwNdOqTOjoC/z5CItqHvozqT1yIl9ShyzEV6U+XXpgYEynSECfcnzMlXVvSJadwxZKo92gTPy2XC2Twy375Clbd/jmaHVSoWW7Ix9XE5E+l7HYEcRYy8ybvBNCD10DNLEsyv2sEAMb+I6dLOhREfWWofFAlfn933gqNFDaJ8qzlbCQovz/Q0ddqaHTVVEegC1td8DaZfmG+ZYBkcuGPskpdcpqybxFihdD9mvx7mlBSVYjVSCS+GQdfwv6Bcy+UeM3SLW5vk+oUDHhQkGTtLlQRkCnfwr/aFfYLgNvjfgVZHkgyDgsHKAOsbyUk0R+QZ6qHMfmFUe5ofwnUHQ0NZGD7JvFiH4nyivybVQOIknr5uLKy1hNQN8ZeNSmHJpgvWhZDdgJI8qa0m67f3df8qUEH9g06vZF8A3BxM2kw/iKqrkqVqjMGCEOvBLh2FrzpMdd69LF8r+/e5dsfD5q0w5bLDIa9O/638sz1+XWPkIZOatxax5AYbN4l3+l2Tb6SNcOHr/r09LerWjcNsoUmYAwpTJhJzSw/WJXqBt8bZUEUgeZhepwk6dh8js4fUFQPqg7AENbKq50JhPm7jEe3do4om3SB7 ncMYskaJ 6xI6hBDCWzuGehkwuOdSXdg/SOVcPb/IqGEiBbEMlrtlaP8ZhsjgrY1n1SDoYLKrQm9KkQPEamMd/vSuXBe8jIzU7CJVxPjSDciTNiyRdjKLTOQRh5OWfxWf/4YJMmG82fMg85D8xf1lL1ub/aqokr2z135eFxJwGKdQ85Q1EnD5RxsQhK4YOYaw4eGXenMKBN3W3bj6GmpbofF0EYRfzN58R9o00Valt5Byl03OySVeCuadvHsl0q03AgHeTlSl5KYp8I1lqYwZid7b5aJNHDmMvzw94BjPW91Y8KggcMEJDf2mvi6XyxHwQDPEeRkc+eL6g9BbOUPWfQtjfy4ubV5GJfSVTtVvImG5l 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. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/md/dm-crypt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 8b47b913ee83..0dd231e61757 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1693,7 +1693,10 @@ 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)) { + WARN_ONCE(1, "Adding page to bio failed\n"); + return NULL; + } remaining_size -= len; } From patchwork Tue May 30 15:49:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260564 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 C876EC77B73 for ; Tue, 30 May 2023 15:50:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 63725900007; Tue, 30 May 2023 11:50:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E7AA900005; Tue, 30 May 2023 11:50:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4882D900017; Tue, 30 May 2023 11:50:25 -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 3A36F900005 for ; Tue, 30 May 2023 11:50:25 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1A081C0284 for ; Tue, 30 May 2023 15:50:25 +0000 (UTC) X-FDA: 80847358410.19.347C0A0 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf27.hostedemail.com (Postfix) with ESMTP id B23C140010 for ; Tue, 30 May 2023 15:50:22 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=KBTUT0PA; spf=pass (imf27.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461822; 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=qfskpwS0Ujqesmx9nawoFccYGFRFHr2duV/SZprdJTg=; b=7kwUgSxh0NqeCcpxEP6aRQBMGysamGvh/9KT+/98HNxopO1jioV8Yzo5agEBnjltiMuqJt 1WAfM5F9mRzgq1NnVkOB+5v/p/H41NsEo1Ga/bXIJf8YReOa+szIcbko5WNrwwXKdux8+j v6cLYXTgTlaleTOv9t6m9wevrWuMxYc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461822; a=rsa-sha256; cv=none; b=eym6xXQ40UqP8sU5/akjNHmTD9CVCHYhmVV7SowdajV4Yj+2FqwZPC5fyokrJEHSr6Jd5S gKCcDkowVRsUX7Q8aK88vWfdAatQ3ydEERwv6LKTe8XBRD4vmzmZ4pkR8VQ4DGg4knyIYU Tt8eXS1HwM6xwim1AhST9pZ8VVqt9eI= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=KBTUT0PA; spf=pass (imf27.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461822; x=1716997822; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8KwDx4F6OBY0YkNe6TbB7WM/40haMFuwXNEas5IG6CQ=; b=KBTUT0PANq+YrqjoDqUZC95OIzP8CRi3cnoctS7GlafUzXOVKDFudvvN X23XUpWrSslJs8LK6FiZC70L8FO1eHy76zy2qIdkquBrFPzC2GmELCExb h1GHo8Ytbxsdps1kFitUb+glsYcdbM0jRGp+9xw8kE4SnQTUB7oE9XDfN 0HDyvb2qltjOxcRRqT9e9u4ALaNZop/RqXEH38JbMZg9q3pypsAA7SMyL Pb97eoq6Q1+ftnPI1EDO4T4C1gS8KIpYEHvmcSCO39amblxOfD0fgzWqP i7tHU6oCXtBERy2OyOBo6Dehhnqyyr7l+9y3C19PuE25Yx5qQYyFZQ8Y6 A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905777" 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 May 2023 23:50:21 +0800 IronPort-SDR: ZAWisUWDLaoNreY2x6CjdBjgma7yVTB8vH7LHPv5vbV44ch7rxvcOM8YYQfr5TjPTV0isI2xiL Kk+Q/uTgW8JUjYn6NRGltCr7qnP01uYAdP0Twxdd/FsOHTX2Nb1k36GUG4klpltFyDwszq+9VB NtZiGiMGhgRUp4O7Zum9YE8a2yepZN/oSzs8XVLvytU6WIU8zIVnXVS4c8d/Xjk3ietbK6IvLQ 5HB5wRj+C2zojTWfOTe13wAuETombiRxr3RubHH+mp5rGgTkxnYUUy+NZEnw44TjcszGFiIz1O Fyc= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:33 -0700 IronPort-SDR: eRxexFOpgVAiI/6qc3M2HlLMqG5hyprbnE2P5xkzi3wCU7bzC6rmbI3U41KClPzQrimk3nomV8 vOG7AELmgo3HFPJEeyzLWnnwIz34HEVY8liiQQjfWPND8wASjp6PauRIZ4LoQjvCc69Za4Fbl6 m+vZp4/ReRXC7hP9oNIBNf52TfQ/tdnag2K72W9yus3jFs/hvE58IgRrdFN52PYehAVf60iVrp tQueGHSyM+3hE4aPseYmzkNOHWMUssVoGCGrDEwV68pXp9pAvW+foUD6P2gQQwUQv2prEnyRo8 O5Y= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 17/20] block: mark bio_add_page as __must_check Date: Tue, 30 May 2023 08:49:20 -0700 Message-Id: <7b1df30b0db4cd34a3c9d66c9c126dccaf2eb52f.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: B23C140010 X-Rspam-User: X-Stat-Signature: ax3ngy3swo871b59ry6kgo534f5uq8sx X-Rspamd-Server: rspam03 X-HE-Tag: 1685461822-3962 X-HE-Meta: U2FsdGVkX1+Pc1+8vfBkAAnpR1rjmjil/AJO9ot8ReOUKVrznuBYyLfuUUrnCLI7aSEub99Q3mqLrONEqryr0uUfdJTfYSSlQfUYMMt+BROIL0rbH0wvshDNkcR07FyJxXEChbKoIDREUteUvEHJz5jR1ws6t55tb4KSNNQaEDrW4VHzZ002t4MukYH49IWtOERWSekwFLw23jswzOnXTx5THgmPnGtc/DO9n95cWhxBtziWUT9s5NQnLVyNrFpAGCE0tAD8pxZnV108B66SXq4JnhzTFDbgvJdSr0PiH1jvmuhOdTNPEeqmutnG/QlfZ8GGESPovfgq7jjb8pxs7ndPlXhexBQGllRAoF5qio8MYiaQktxWhPI+zKFFxV5PNUOGcae+4BO31fDCHApr4bc+UfVA/BoD4N6qoZAfBjWa3CqNr/DjSCtiPIaZHH/DBe5TyH1csIIyq21bJmWVJjaMiAXaMDQeYe13JqcuzW+YB19GbPRuCu7DQ1CuXkmDGPmLzf81JKzbm3OOMkhf6hyX8AG35bv9kEaAQmwtYKXum19Vs6GAn9m2DzHCr5XokiCi1oe7wK2yXV8wneZXaqK8SlFIKsuXhkI4AlDoo0JUwE1aumUxlpaUCeUMVdBLRNofeR+xqYIy99MZKIYIR+qP9z3SwUWoFhyFXXhorvZhAqyW5noseGnLYEm97sFddFBpThpt8+RkdQeuh7I3a/YHHo93mbu2J99GoyA4Fd5OA6Cx0UE3P9H6DR8A/5S6jBKNqkpogEAxkVgEmBSHGHPgPWVtCPDQH0xgMDIhB4xGTjutyp8EA4igf0pxt6o3wXk2CgT/dBiqx4VtEOdHY/a0zpSMvdxAU0gPVDKBwoXBPMrb9CavdAe7nob2j4aoztyiUr6YOoWFWE5lEZXrNquUnLHat27+PEuW7GTo8F1u8rfl/RTWfym9nR1osSgOiiZCiQoB6HbvLSz/LtM YbLcelef vBflTV7Qld2rMA+tLO/jVot2Qenk7IRNvu9wQnq5v1llBl0FCVRTaFhdl2NFiCaxceWMbJo/YgJmXDI2r853RU8umqXeAWrqvbVEbygcPklSsTwDOF6cVMDQaXVYboQUWkV3eqW6GMRTUb6Uda6krvESmGj+dMd9MHs5kNIZAwXgUsUqFm10lyvcnFCymc1bgie4BU4F972Y/ol4ljxJN5DUFMKfpgBRQ2jf5dt0d1EfbpxR85B5ZtaQDdnFrwIIGp5ky2aMhXH9LfSTOYaTQ9GK4Di3iDWzcmQCjgaQENlgwX4GI6vkRKKr4bT+Uqnz6iaOgjqNoG22p3KiEk68U5qVTBGmpULEhuLkeP2/YLA5ViUuyrfTDRO5AOaVr9BhbAb3OOlzdsWJMFx5wSGWAmnRiHA== 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. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- 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 b3e7529ff55e..5d5b081ee062 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); From patchwork Tue May 30 15:49:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260565 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 23FCCC77B7A for ; Tue, 30 May 2023 15:50:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF1D8900005; Tue, 30 May 2023 11:50:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA214900003; Tue, 30 May 2023 11:50:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 943AF900005; Tue, 30 May 2023 11:50:28 -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 83F92900003 for ; Tue, 30 May 2023 11:50:28 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BBFFC120294 for ; Tue, 30 May 2023 15:50:27 +0000 (UTC) X-FDA: 80847358494.26.A5222B4 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf27.hostedemail.com (Postfix) with ESMTP id 924E94000E for ; Tue, 30 May 2023 15:50:25 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=QSJMo5Xp; spf=pass (imf27.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461825; 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=XqmW/pWhr1cgDEAd3F/aGuYlTwkOFNTZjCl2H81a0pc=; b=xsxyUEVe6ohsucTkXuJddeSIt/AwoOA6iqj5PPNsy5HoMXLCNY5JTQvZw+YIejzrNcahY3 CiId9yIX+FsYi73qX3fLqtPJkUVqElt8OMv+3cc867pogScwvpmIxUQzbbspRciBlsA/Ym Uv9uPrE7AfXAcAa1fo6mNVd3Frt0uVI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461825; a=rsa-sha256; cv=none; b=cdOireoioyX2k89NEC0NBKabgPZ9MhdpP9GZGQJtJ3XQFWWFnWJwPFVC4I3O6kMql+h30Y /Uy/zLmEfgT3Zz07enZvDaaWuzlknFpFRoDZMFGbSwucG+E+iIREucQI0csv5nvXk+IN19 t157w4toyQ09kQXjyBS38Rpkvi4+aWw= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=QSJMo5Xp; spf=pass (imf27.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461825; x=1716997825; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Wr+M2zDQXb1A/M8JUY7t1USwG0IIo/LDQXKOrkxoR08=; b=QSJMo5XpoNnAQGoDNxkamwqVQnMHQfdJ0TDjpmDpdpYq/lcKcnbeFnK0 T2Q4vv/i3xInZiIRUOBz51PZfB0NnqgugF6EX0de/BKG+iaI+gwfS/OW5 7r3sswKCItAw5Wmqbpqf509cLsdjXiIWF5OHKkTN4234bzZtaEsYnMaaM IQTEMoOKjE/ShH3GXxw17r4WpqBxzUmfpBbTYuLSnVSWlNxt9QI5ImGVO f2OcggSd2AdZTh0TOmtdwVj3eRVMjm0JloQ79NbZaJm/HiI0MuBhSQBac +2xthwvVtHieyUVvKD6Fw2Lk6Wy+mnV5tEp/pX2r+wHvxb9L1bc8qdQle Q==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905791" 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 May 2023 23:50:25 +0800 IronPort-SDR: SVpu8M76fNaLqpIt+Z9YHawBKN2XC/YwtkwqZNqPqrg3cjACI9Xb51O3F8VW7d8xoYKtiVHRuk gXoB7tYo2v5im18kJld0Y/eD5maH+9Y72/HXTk3Mk/GUZMC2djYYuYKtJuu1uvgpWE+U7k4tl3 KOrtgroN6+pmckNB6dZKnaQKBeL2tl1obx9vMM2swhuTTIAe1ZF5zyOtHTEn9eTeYcQ11NFlTp M8xC6Dg+SLW4elWWkA3Dvet0n+SPfMHQB1xn5/3txD9BA8Vkt/v4OCq3y9YXEprm0xQ8MaL8hm 7Zs= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:37 -0700 IronPort-SDR: ZseWV5fWdzcZGsBvaK1MnzJbe6LJ/RDHXZo6rvQuZIvPrGhH7sOBfNMut82zppqTmYnoXKTB7z QrMk0hDekgJdL7i7w/cfcGZBQUO8WxGw7qvwaCfyj9g9v8vpCBL79fSHs9c7ocbmkyi+tKeTnl 5yWwIot/krgGKEZrPU2K+W7DW94upy4aq9B0nKyn95xRamrF3GJ6KUciaCyMyK5wqC2s2vs9RF va9UVub6OltLs9qszN3A4HrAJxFVHZVWU6ZfU0MHB8DAntksi1VUcnPRTCZpwc76EDliVEcshA NQc= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn Subject: [PATCH v6 18/20] block: add __bio_add_folio Date: Tue, 30 May 2023 08:49:21 -0700 Message-Id: <5a142a7663a4beb2966d82f25708a9f22316117c.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 924E94000E X-Rspam-User: X-Stat-Signature: wjz6tyey4e55smtprntxzjegwg6k4zwp X-Rspamd-Server: rspam03 X-HE-Tag: 1685461825-877352 X-HE-Meta: U2FsdGVkX184HQ+Q/miC47aI+6c40/kkmUH22oa/bHCFi6lIf7HBgjWQ3a/ZcK/Q8oz0QGnUuh8Azs/k8SiB5DOunCJrXiweJF1I3cHY/v8CoX7jqZx6VwmhDtItg/YYPZmuFNaBquV4puMTh6vJT71OEJtvIRfCZ1RpcmH4eWn7QpbOOear430yrbRID4GPhMzpME8em+mEpecJUx/D+DhHAdnBB3jIPgtA2tdrl39Z/YKthcVb0D+MTs5oFtvmqBURk+n50ute6jgqkTtPWoMd6JIphJL/TZnj114d8kLawzzjwY67LFG/ZFEWLwYMbnHIfING8sU4zixEpiYDBLpQXDi+/WDUq75bmY8iySC6/xFrKf8uHtDgV1HzkVd47YedDBoKLMRXpoTEqk0w+ngsF95AhK8w7e+9J/Zqe5D3fiZa9iIq70hgTKwsXyZJx5fOwAtdJqwH1e5DahOxjV45MgWxMRw3xg+bM3CrxoLnL0j9D2n8qdIQLnVa4Ab75NWcmRRX0NTYbCirtimTJ9sBJIR2nJDK6EivfVx1LDu+ZqRnEpTMtXGjx1CcLbfPVbqBceBOkSLULsiRGZ3KFYVYZq46T/+rH0B09T5WGvSvUrW50tnOxrDzoDsk5l9KuAC5miO2zX06Vb3yvsPxDXWU2jBT7TZBx/Et9omIVTAP4ylXAKRDFkyH21xP50tbsgrTaO8eYNLRYfnzDgX7SeapjqkGXP38Oc20L9it1cNXOmXxNuD6n8/ypXIb05GHigd9ogeii98J2zGZsNfRgXkBpzsJ5A3D1q1JgWy1SFhyrPPYrT9fPzfIE4rqDOkaMO0pXfqGqL3xqP8dZV/ymni1W5E2k67uQu02nsJIDcRNJP7fNkhdZrelWjVa11Z0qzlOYcYKlr1xbEVFJLOSBFvE+xGAeYloOX52OjFWYJfulJu8xudzK2hRg6KlGNwgLeA6WBlNYxeAfKqTzLk nmLiZRQN 8gwRuW6/ooeXVcNkfL3S3KnAmydsBx8VCOvaFTWa9R23ST0ba59Zd81/qisk4QcSLfYcgmcgn3cFTvKNm98GVnTbXNI01OL8SwHV1ZOzOnUIUKKciEm75XUduqgnCCzWXkG6+bpIaHktaEQpgdSwQ8p166Hh+Rl69b07fLHlFzpPTxxZxcLmX1p4KeSYkfKTokRbvnt8R4Wsn1CGSkqa9bE875K908g0Bw4/Pzcm4Qi8wq2fLDKhlj3JOqJy5SOS6QXF7nw3fcOlBG5kTd02oZ//OyUPnPS0F+T70Tm0G/UiAiyEiIQo302M3DbJLQdj/7i56S6mwc8ISTVpthejPr44MKt2MhNwML8LrHY+OF6lcKvxvqazBoiw5o/KD3Mk843yLggvXwoLY6bKbdQp92UjrIA== 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: Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). Signed-off-by: Johannes Thumshirn Reviewed-by: Matthew Wilcox (Oracle) --- block/bio.c | 8 ++++++++ include/linux/bio.h | 1 + 2 files changed, 9 insertions(+) diff --git a/block/bio.c b/block/bio.c index 043944fd46eb..350c653d4a57 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1138,6 +1138,14 @@ int bio_add_page(struct bio *bio, struct page *page, } EXPORT_SYMBOL(bio_add_page); +void __bio_add_folio(struct bio *bio, struct folio *folio, size_t len, + size_t off) +{ + WARN_ON_ONCE(len > UINT_MAX); + WARN_ON_ONCE(off > UINT_MAX); + __bio_add_page(bio, &folio->page, len, off); +} + /** * bio_add_folio - Attempt to add part of a folio to a bio. * @bio: BIO to add to. diff --git a/include/linux/bio.h b/include/linux/bio.h index 5d5b081ee062..4232a17e6b10 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -473,6 +473,7 @@ int bio_add_zone_append_page(struct bio *bio, struct page *page, unsigned int len, unsigned int offset); void __bio_add_page(struct bio *bio, struct page *page, unsigned int len, unsigned int off); +void __bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter); void bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter); void __bio_release_pages(struct bio *bio, bool mark_dirty); From patchwork Tue May 30 15:49:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260566 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 F2EE3C7EE31 for ; Tue, 30 May 2023 15:50:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6ACEA900006; Tue, 30 May 2023 11:50:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 65CA3900003; Tue, 30 May 2023 11:50:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 488A4900006; Tue, 30 May 2023 11:50:30 -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 3374A900003 for ; Tue, 30 May 2023 11:50:30 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 13A4C402C7 for ; Tue, 30 May 2023 15:50:30 +0000 (UTC) X-FDA: 80847358620.26.8F98B4D Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf27.hostedemail.com (Postfix) with ESMTP id C582D40010 for ; Tue, 30 May 2023 15:50:27 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=PTZkcIk0; spf=pass (imf27.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461828; 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=eIMNShzbX4d+fuJlDQGVddQb83DiGokEGK2iaexvnMI=; b=R0xXa6xeZdNTeeUkV+qV11e2kEFOaqKuFBviHZsgi62w1p6K7P2f6bBqyZz17rcppoB+vu faHp1KmGNEPk1Au48SAjP/gpppFVKs4pKtBMDNYIf0agg74bZeswKlUlfTDWL1XB8iaA/Z +8wa9eEPf1IZ63Z9EuJVW+Z8dn/ePWA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461828; a=rsa-sha256; cv=none; b=gFORBBrx/dI/cV/s04SJ7XWuDLMrbp7WXylwdq8GUdn5dux0AKpTP5PMrh2gfqICqDS50w if4cczgGf4xeebCmnpYk22fZsoOSDPxC7j4+JGf4cSkFvWZUsslC6T4WwaPPtk6RTS3hfW AbigiOjJTKLDVxBkar4DgDaqgbDeKoE= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=PTZkcIk0; spf=pass (imf27.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461827; x=1716997827; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Mcd/H07yjDNLd/X+ei4F/kInbJgAqWy0dojDfw1QWYw=; b=PTZkcIk0KtnwDwSQzUA7nqgARKxDH+YKYBnkqf/ALRMRXVT07PPikqN4 KQ8IpwicrfANfCP+b8hpkuFVi3xYOdWxdx96rlvdo52GjR6Sb6E+ms7X/ +dCch7tY8qR9g1vdsz6MMmESBoOw+V6ozahzCBYAHyL1gQD4n1yMwzLYs Xo5LHtuPaM1fATdmtWFp2CrXVTBlN4dWrdry4o4hEoQjd3lpejFKU67H6 VUZD0ogC0fxxirPiGlMSEzuUF26Ayt30/PTdGEmUSfcilyW5+ckcfE/Zb UMDeFUyvv/ZnCROHy9wxbC26ty0bB6SIsHZ9B+zRYGpr3gHqkeid+t8jI A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905799" 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 May 2023 23:50:27 +0800 IronPort-SDR: ZzAz1X97S0NWxv9uymqMc7LH5P4ch1KM+J3+W3TDL17sVZA3ZAgMTlQt6kzuPqWDJEdvv6MzD5 mxInpsM2i9azFNZXDH9DyG1T0Rn1LnTLloR97FmEpogmM94CjnWfxQz1p84/yRn/OgaKqdRJzJ il1xLKDEI+0ZWl5rVYGFzXfAqwpWdLR82jOlyE85jsdiZpkOxOgiwmZf3wgAfSxlQs4pfr13uC gGCD1dc7axT51e1P8pvNiMMC41QIxZ5bDnJB1lwzdHUo4sFsBE/ZUeavGFrxgfb8UCEJZaDvPl 4nk= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:39 -0700 IronPort-SDR: vm077LYPjNAgf5XlpecJ/3icJc5CMvd0lv/Avf1qt9Q/GL6TJkcMXRi6IgIjrnSc7COF5QrvoM rybn4aIsk3ovkS/odxyg0sJi8dTutwPKjZDfzTgOQd2shRAOUl0eyZW+AxMzq0gSSpTLt0zblr UlT5/9heJdPYSEr71OD35L2+mnxp5yfUxAvMikvD+47W4RcDny9nyhyoPmkkZUZCDcFsZlAdtd Z+zkSGqfSgcxDW2nlTOB+X8K7FgyMtw8b3N4WfdZtYRGEapJ7oDAz61v2TGB77bpv7441w8fn/ igk= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn Subject: [PATCH v6 19/20] fs: iomap: use __bio_add_folio where possible Date: Tue, 30 May 2023 08:49:22 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: C582D40010 X-Rspam-User: X-Stat-Signature: rrjjzwpubjj8rnte59i8b1zepw7m8ur6 X-Rspamd-Server: rspam03 X-HE-Tag: 1685461827-936313 X-HE-Meta: U2FsdGVkX18STj+icSDvCNcXgYDHF1JL2png24CzXi9pxh1SUqIZEF8wyOqxZ1NmL4VTmJNkQ8RkQAWcqGmsBV7+GD2KhvRyzscpwLF+jwVXtBQEoFuUjoJn/OplvYzptXy8IzfSngoHmSOlUjasEJW0li9TCRDLbt9F+guuw8VRLo4hWtxRJGiKEhlYeMAr1DIt+jRfxU/eJwqQ8PIF+99xn56VRtHsQdio5bT45awelYgp5zkQ5uHU3OQ1PlZ8rC/80s5sor9crNk/v4NKnU5zoytioN3NsX7OWvVFpokmMU1J4mfh6ipf1JZQFZ6Lb97XB5KxK5oOCesRO6LUjV7yLvWI3ViKQWuDiEU4dJOlwVCC4VQK/wkEf+VScplgeLaY2S9sDciTMb+yeoul5x5C2h1q5ePQhY1CztIzYpcgXBWKcy6kNal5khwV7XPieR1EsEI7dgrXb1znIK46TXXYsyz0mnjAHm+McKyxPwz3RrjssxphUxf5b+HaU++y6oPQiPn+3Fg2lw3GVYlWmhfE7fdGFt1sfsz4ObVU3yfU+dhDuexbFD7DK786EToAgNkOQ8z0TWcqRpMS/zCwIYbPOhTCdR0sZnTjAUifTiEmCTDLtpD+tHCGVJl1qAcCY1RfyBxzfB3V3pFam/TDMODRv7wiH7gs9eytzI7M5up7jIemhVzLqXdFpsCmYP3k4oJyhpOaoZ4JNXGsjecHx+b+QJP3xZoulqYH+ix778TQgi4HQJJeVcPUQx7G9YgybtWE+t1wL5/yuzZQx4Zo/rmrU/2TLbP5CbbJjqYVDKkdywh72J3FM4+kcsfGvY9aAjO7w2/HPCQdpgL8IjrlGlGQpGlfAltw1EPlebsL5KspY/cqUJ7EJ0s29aprvw18pxICsqlLUXIklCZK4dogjZChsgYj1hb9eddgY8yYH7uCI1e5XdYlM/unLrxshxuEWz/7iIfycMGtamfiYD9 TfIDZl1H vD9GE+iCMJTq0zTvbEutqZp28tECgHLbm7wO+YZ2DUUVhy1YM9yhcuA1VANN7rv/CKHECpYttBV+d5yS7JJsPF1SueIF+347z5/+lbQ54v9s+g+IXJRJQvXGmHiu0xLyNC9+IM5WxMszv2+M7kto63k6oiXx8aVPtUmHUau6vcxkc/KpcUpa7/P2GHC/dOiM28lf3iVqM7UIlrxnmJ5M4q1Vrw4Gn+HTGTIahFlRT80hN5N2/W29XEgwvcLmhD5RqNnFGlv+6KQ/vWXwJPblVvl9wmfTaqtW1ZYDe+prKwRmF7PZTPdvIdqHDKpePNcD5olN3n0hUkNeJi/kXoAfbe9JMOyX1bj/rObqS8WsODy2dncd/vfkalLQbKpUTLW+9Y8KPHdSo5BYoMs6tEIN1fe+EeA== 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: When the iomap buffered-io code can't add a folio to a bio, it allocates a new bio and adds the folio to that one. This is done using bio_add_folio(), but doesn't check for errors. As adding a folio to a newly created bio can't fail, use the newly introduced __bio_add_folio() function. Signed-off-by: Johannes Thumshirn Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 063133ec77f4..42c5fc0ad329 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -312,7 +312,7 @@ static loff_t iomap_readpage_iter(const struct iomap_iter *iter, ctx->bio->bi_opf |= REQ_RAHEAD; ctx->bio->bi_iter.bi_sector = sector; ctx->bio->bi_end_io = iomap_read_end_io; - bio_add_folio(ctx->bio, folio, plen, poff); + __bio_add_folio(ctx->bio, folio, plen, poff); } done: @@ -539,7 +539,7 @@ static int iomap_read_folio_sync(loff_t block_start, struct folio *folio, bio_init(&bio, iomap->bdev, &bvec, 1, REQ_OP_READ); bio.bi_iter.bi_sector = iomap_sector(iomap, block_start); - bio_add_folio(&bio, folio, plen, poff); + __bio_add_folio(&bio, folio, plen, poff); return submit_bio_wait(&bio); } @@ -1582,7 +1582,7 @@ iomap_add_to_ioend(struct inode *inode, loff_t pos, struct folio *folio, if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) { wpc->ioend->io_bio = iomap_chain_bio(wpc->ioend->io_bio); - bio_add_folio(wpc->ioend->io_bio, folio, len, poff); + __bio_add_folio(wpc->ioend->io_bio, folio, len, poff); } if (iop) From patchwork Tue May 30 15:49:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260567 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 D1446C77B7A for ; Tue, 30 May 2023 15:50:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D2DF900004; Tue, 30 May 2023 11:50:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6838C900003; Tue, 30 May 2023 11:50:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FCF9900004; Tue, 30 May 2023 11:50:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3F997900003 for ; Tue, 30 May 2023 11:50:34 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B902E140291 for ; Tue, 30 May 2023 15:50:33 +0000 (UTC) X-FDA: 80847358746.18.648274C Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf19.hostedemail.com (Postfix) with ESMTP id 32BA51A0018 for ; Tue, 30 May 2023 15:50:30 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=JxMBeyY1; spf=pass (imf19.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461831; 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=zkowtZ415fCQeJRiHjflZgyo08gZkymF9cFFxhT07Cs=; b=iuGfOPwK9bexBRMVbieYOm1Y959lkZXVEl1RyLfvZB+CM141Tx4GS5aMLeF7KKWRV9YKLx lXBcvrm/3CBK+MIPa39AoKDwsGozQ8xCR+fipmngGJM/1t+qZeNc1GDsa4pKGfJUuLxzSm +3vYPN5ViLTdqXJJuDt3Dbsk2EJLPjU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461831; a=rsa-sha256; cv=none; b=s0cDw4yX247uzUFOT6Iv1nK1L13K8/Y2h4CaE4yyfGtY4CTLVn2ddCA0kD78FRvH92GKs6 swAI8/GYuANh2XYpmcZns9e4yL4XhlFCq1TFdUAgYgz3JO5IqFiMegXdyA2Kzs8QPyohTt EqeMhp6kBK1llen5PukbyyhuumxZvXo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=JxMBeyY1; spf=pass (imf19.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461831; x=1716997831; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eyPQiHOzD3W2DQRKwVAI2Cbe6Umke2Yu0VLdprV7VgA=; b=JxMBeyY1wITEn8EypTC2IG+9oDiruT3hTA2eXbWq7m6ny1Y4XfxxiSZ7 TuFvI9ZpcBQmGTQTBju4V4PQpvGTKiJMxzR2EUFbyr+Esuzpbd5LQIabc GQeYKgvZxsZskSxMJnadJtRDun4oErD7VoBnsdQ306SZD79NORVNTrXWF sAoJ4wiV6QfzkV9dV+ScScQcGZh7e2n3s+fjIm2iL7R6m4UDlxg0F3s1k nmolMe2bxIw/eXu5j25r8re+ulXzfwpn266BcLIxCyZMHC53C3ipLV/Ia FUCc9YgeF92q46cDx2KobNKdGoA+C6VFyojavgt62k+vMUGwBu1FCY/mh A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905804" 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 May 2023 23:50:30 +0800 IronPort-SDR: unyxnGWYrTNFCzzDY+WzDpBBK4dUa2tKWyah6OdWAPvEqhJaCCZRFVmEM6M0F2fHuX+7BnTNNl q3nhCIBGmyZSuCLNDPVL+93hvw3Hkg9wFVT89H0YRcqwAIH3kf985YhAJIziuxaSSfJ6+ocyRK qeHwvjG/G15pR/zZenhjkjLVCVYshFea+ul59ZC+LetAIdJQTY5//m++eb2yZKQz7bT2KNNUuo C1HeJqk7yOadalOPNxnXkPMW36FTuTn8hGp8vb0KvwIDsDJR6d89+AoGFAlJD+LHF98A3aw3hr 2D4= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:42 -0700 IronPort-SDR: bSqBFzv7rrWvPvkE4gwhOHj9e0jpcVXnuD/Kq3xELlTSi+Nq3cUl8HGoaL0rUxB1OR25AAJdei TIPhTBMTndkhO2YNy8PxBhVVLv4Kla8ZXnfIi5I7M3fxa3gTd8oOlhRXj2aVcnNgmc/rxQ3lh0 pt68H/iNv5aYOaAvAaRNX6IexlshH2MNcr7cPmRVBzj+I1Z64b2NARfsMPI8qXzvdg6WEXxV+l Bxa2dMoJnICTi4jECIHCBYec6Uvp0PaRuTsjD5YAUZHSr6x9Mm/SzMBT9zXRe7WaHmXxtQTl7o Jr8= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:50: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 , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn Subject: [PATCH v6 20/20] block: mark bio_add_folio as __must_check Date: Tue, 30 May 2023 08:49:23 -0700 Message-Id: <3d45098a7640897cbace54713efe10d88b74c160.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: yu3h3ewnin3dotx6eb5eocw4himtdtd4 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 32BA51A0018 X-Rspam-User: X-HE-Tag: 1685461830-190393 X-HE-Meta: U2FsdGVkX1/T2aGvxdw5lWkH7UV5jfF4qtyW44cjmuESmVNrtRLIvwNe+W+w7oLKJhBYlEfu9IgCE8XQyCORAQYjkop2Fj6by6YJDBSBFkhtWMZMd9YS7a1FY7BVyjegHvJqnPIj33wUktYhRwS6CdoMr5UazTWnp7YC1p85DAsKAAl/O9rp9NXqUVV/QZEzZF4l7TEUdBzFEizM/I97HeJvYjFpzkZoAle9jIRAsp8LAY1HwduprWi6PT5fBaoYfGTlLUsV4B8+ja2BcYgLMQ3eAeoAiCs189B80FyaY/4QlXHRfk9N+pAQFv6/n9ZR+Y30yeSLy32PVt8Wt4daNfuDrLhh5HAvqADToNOqFekxaT+zW7f/tRgp3XWHYZQCwP/jEpcfQI/Y1LWDRDr6CA2psHzgHn38ib+r446yAd9LJlyITmOO621E5dOF2xa3k7t45uJoXgkyIkGPy2Ydb/tgf+zGnehtk3FAxyKwFT9h0Tm3ygxyAfWGt8FL2gPBa69EmyWjiTfYAcMY9pkW2f0QoSe7IyYkMKfScpOIpDb5fsXcsWPHdcC4hQ3KzQlPvSX7ZPzdZT5UloOPRpgxTv3QEGK9hTkuKIfinEwYzqPcJGV4ypxfu62QrvQmwSDtXERbQvPSujYGSRovzbGfWBx00Zu37pXFKeha7Rzyx+rrzPlxpt7fJfNcC2l1abyhway9scR8plodounGpjNasCxpQIldf/y7IqSdyC8KSQnG7fkDV7JaWasdjhG9brMpFdfFYzjJEDyddhiJ0KXHQX5ErRKjnmLX1ceagAGoc0R6ccN6h0LGvVnh0Bq6VX3O79FZBeSPHN1V44TILAJrX680wm9e2cqypwNrPgGlCiPQmrh1NoqgnKpncdSa663hrvNlmPAEkkwaIKkrHmPEamHhP/xL26XRC7h3ps1eBlr9EQ0wZjdWow0r7LBqKh8nPFzK8q/LlTiO/EDB5Xf ICjBOW4q o4y2/9M0aQOa6GH4DmPGLupiY9ScR8yenAnI9BVnnS9Px8GJ/PqE4JccXLCiVNCsWl53YR3zA9WGk//FyD9EtMeIKxQ00ZwJFQXosK3ThjGc9CNF3zYpBKwENLXr5knr6FHN9f2ov74nipkq/4aHJV5KYAI5Bj3WUmgOqUMstFYuBegrFkU46fR1RXyiEbQTSH+sH2PAGLqOyxfCAAJU6Hb9IgzFysLEd+CGrvHHCYW/TRrpL3ryBGL06ROtVovxtBEdoX9TF+kf4PBFm5z6j/E82vP78UJVGrJaBLB3MWHrA/Wr7ZaTqF+ELaAeZVZKHt+G77CQQcahrYUyZTidxGDcNrlDGxiCuafzBtZUN4woVohGFnA/DA61+26UgycYgIQX84SewMfPWYVHQ9OrwtBdnYQ== 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 callers of bio_add_folio() check the return value, mark it as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Matthew Wilcox (Oracle) --- 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 4232a17e6b10..fef9f3085a02 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -466,7 +466,7 @@ void bio_reset(struct bio *bio, struct block_device *bdev, blk_opf_t opf); void bio_chain(struct bio *, struct bio *); 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); +bool __must_check 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); int bio_add_zone_append_page(struct bio *bio, struct page *page,