From patchwork Wed Apr 19 14:09: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: 13216872 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 3957DC77B75 for ; Wed, 19 Apr 2023 14:10:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89B4F6B0072; Wed, 19 Apr 2023 10:10:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FD15900003; Wed, 19 Apr 2023 10:10:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 67713900002; Wed, 19 Apr 2023 10:10:33 -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 56E9A6B0072 for ; Wed, 19 Apr 2023 10:10:33 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2C8A21402CA for ; Wed, 19 Apr 2023 14:10:33 +0000 (UTC) X-FDA: 80698325946.09.21550C0 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf04.hostedemail.com (Postfix) with ESMTP id 56A774000A for ; Wed, 19 Apr 2023 14:10:31 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913431; a=rsa-sha256; cv=none; b=SyzDpSzbtXJLy+rchDMcEYqMBXFh3APHLZPzgZ99IqLz224g3xsZC+4YOZRKKYOolwGifi zKNHp9z7cyUXcszoes5YUbjwdCrs9/d4K4U/xDmRGgy0I5lvom/RJYVvSVKVh6Aqw6nOkB 6TU7S3EbakGBucgCV34+tbCU1CbuLw0= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913431; 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; bh=s93ifE1gU+0FrrRIOdnaALh6w14X2Hkv+dazvnzybyI=; b=pLuSgo+jUThfPuBq5jI3PDwBno4IU0wdxe/AayYOJzHy1sgkiBk+NrURAeEQlv7fWKLh+5 fkBLTeXeaG7oPYhSZIZsNdIbfmJc+lUWe9hexPhA5bLKCaSDnBlyymSVW9Od+IQGmB3C2k DlynGIYn3uMCMdc9rv+y1srxTdfz0yA= Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f1728c2a57so27999435e9.0 for ; Wed, 19 Apr 2023 07:10:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913430; x=1684505430; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s93ifE1gU+0FrrRIOdnaALh6w14X2Hkv+dazvnzybyI=; b=UTlh9jCAXvlW25j8hVYoQ/kX721TWmPe2qJ6+AOWgGw/YfC4iaxUc2pgYRAB656vmX F9LlXWzKG6w70cpMQhhR1/3bMA0Ddb3ULUOo3oe3rs8PqoUlKvWAPR90eb2eUboNYMQp BokokRkZ8O7aRaFeigH6Ufsr2xOIj9xRtLu0i4aQuz0utDcJbf+IdREkeVDrvOoUX1Ck ZTWqJ3GBOAHaxVtPw6sthJGV6R4FZy6d9K6oZUpy1cxb6xqg/GH8ufNonX/n4F7a9yXO Y0CxU7aqVEslNYUkU/FjwYFEWVMwcHHi/6NRLdZKQXkTuCnBvqwVDNDDdwaY09tDQAkK DBkw== X-Gm-Message-State: AAQBX9fb+z34JNjRt1fbEzjkg02gW39WLKzIOZ1Me4nTPfjZJaZE8mol FcfUaEOIH0aowP7Fhiy3ZKE= X-Google-Smtp-Source: AKy350ZCl1EYTqU3ojhOwJGzyXG93dcv3ZTDUZMe/RLHmSNNl6qs8XKigCD/A93InHHpiT9ONj63qw== X-Received: by 2002:a5d:6609:0:b0:2f9:9f6f:e4d with SMTP id n9-20020a5d6609000000b002f99f6f0e4dmr4489637wru.39.1681913430030; Wed, 19 Apr 2023 07:10:30 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:29 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 01/19] swap: use __bio_add_page to add page to bio Date: Wed, 19 Apr 2023 16:09:11 +0200 Message-Id: <20230419140929.5924-2-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 56A774000A X-Rspamd-Server: rspam01 X-Stat-Signature: xp6afn4m9fyqwf4o4qcng37har47npf7 X-HE-Tag: 1681913431-848424 X-HE-Meta: U2FsdGVkX1+qP2rqPYY8jzxD6VUjK279ca+M0SmWLO1AZZTz43UfB0ajOBB11kYY8XOwAzFtu5OoGpedturf3OuVDf5iiZIxN2A3WcZd/TVumpfwClqdegmGqervHcfqpBAcB/4OTXiEF2xOdmNFliksipxzRH3Bi5r3LhHPBzTeF4VsFT2PPtO4yHs3rViY1EakewwlhbK/roYytV3VwCopm3HMKW9rX5E14YQswFRyvduMM0SlTpRBKe5prYF0B3nFJ1hK0tjqRuPZxT6UgYKCzoYXscSKJGg0Dv2nKlBHmiTT0Clx8s0vAzen0X0KIny8KquKa9191SE3SK6HI0bdWydeR15sDXVbM4zET+ATyI4ONy7Zz7tKuoh3XRTMzGQofPZtcnwZsoJkeRjH9Q0+X8eUibr2GQJ1cP6ZzUIEYn2G66R14VcFXyBl1fxYIUvXwY04ANI+sXsq7GHHf3FRGJNVEoIDumwUNyekgfkYlpe9cRnqMI2p1KesT6B7okjKkF6VsFm7IULF/+ReIq/a6BYZhvyDxDILa15PcyF5tsnaSNZbphxRV9O6Dh390ONGTseseR31eMRB7LTHUKWQL3fSO52hIpgFR9djJ4XHgSvJSryI+LIM+dkuVJ5toQvTkSNvCF4krvym+e/g60VfhMYeGwZ9fRoRwhIykdkyArIeqrqUzReNyzyiO1VqrlzvRI7sj22lviJXp5UwSNYPH8Lvv4lqR51IsexmW3nYPK1p/OcnQPy3cwAGD9gJHWvvAO248zG5M8U5h9Sqco+PqJEHpUBdL8MCG1f2DAt/Li71ZhIck0SNMDB2lYytbZ/Ls+WHd2HfSepjMZUXle0tjJY+F5FNaCxXUrgumikDAKm1IYdF7OMPuot64hdGEoGu1o2LM67/Lz4oE6sSGDDnK065/c/gqid+SojGIvjFRrj9lPMbBQxuTfE2r9O0uH7Buw9S4MfwaLmBjzy C1hzBnMI RFKHAagoyExOh+TtmPcfas7FZHH5Gvd+DBOTkgh4Drs/jTJhUYsc5qFEtSz6u+wITjeEeOrckLj+fJpFNlFZqvmoB4aX6VEvl/xLUXr3IwgSN8DV9VQMIrKCnREorH/c3Ck2nko6saWAFvDS5SQEkDjAH1WmmfR/ib2neAjIJNrctrmHYwUZCHgeKWmYVl4SiMpLo731UjebqbiD9529mnsIGQu3w3VDyaRj+KUlX8quMjHl8f42OveuZmZUJn5xGaRSRQrUml1wZwOzzV3xPFa8gRi/+eEf9UKmb88daGt6gBbMJhbBoqu2mu/DAYTEuKhDIfQC8opk/nA4KPHdMKTS5ZrPTeW9x9vm8GmyFykMScCkDBnYJwLNtbnQJM0FddPcg7s+pm3L8XMlOEQG79XtVFKrEyPuEWGM3Z0Pjxy5Uy6zkg/TGPep1JuCE2sTWlZFgXaPhTC1ORm/areQJDyJCqZWGtaVItvjv9zcyEqJIHoV2kozwRJTVOWMwuOVBBc0OBZ3vdAUFsdSSrqNyofucjx/vnf14fhPmEy8Az0etUzKeQ3h/6t4rcNBkV7ICDbe/L2kH+7yDoLKWJwt0MUhQzYqODFxean7D 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: From: Johannes Thumshirn The swap code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- mm/page_io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 87b682d18850..684cd3c7b59b 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -338,7 +338,7 @@ static void swap_writepage_bdev_sync(struct page *page, bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc)); bio.bi_iter.bi_sector = swap_page_sector(page); - bio_add_page(&bio, page, thp_size(page), 0); + __bio_add_page(&bio, page, thp_size(page), 0); bio_associate_blkg_from_page(&bio, page); count_swpout_vm_event(page); @@ -360,7 +360,7 @@ static void swap_writepage_bdev_async(struct page *page, GFP_NOIO); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_write; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); bio_associate_blkg_from_page(bio, page); count_swpout_vm_event(page); @@ -468,7 +468,7 @@ static void swap_readpage_bdev_sync(struct page *page, bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_READ); bio.bi_iter.bi_sector = swap_page_sector(page); - bio_add_page(&bio, page, thp_size(page), 0); + __bio_add_page(&bio, page, thp_size(page), 0); /* * Keep this task valid during swap readpage because the oom killer may * attempt to access it in the page fault retry time check. @@ -488,7 +488,7 @@ static void swap_readpage_bdev_async(struct page *page, bio = bio_alloc(sis->bdev, 1, REQ_OP_READ, GFP_KERNEL); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_read; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); count_vm_event(PSWPIN); submit_bio(bio); } From patchwork Wed Apr 19 14:09: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: 13216873 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 81188C77B73 for ; Wed, 19 Apr 2023 14:10:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 149206B0074; Wed, 19 Apr 2023 10:10:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D2A1900003; Wed, 19 Apr 2023 10:10:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF0C3900002; Wed, 19 Apr 2023 10:10:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D12086B0074 for ; Wed, 19 Apr 2023 10:10:35 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 57AF51C634C for ; Wed, 19 Apr 2023 14:10:35 +0000 (UTC) X-FDA: 80698326030.17.F24EA52 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by imf19.hostedemail.com (Postfix) with ESMTP id 086151A0029 for ; Wed, 19 Apr 2023 14:10:32 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf19.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913433; 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; bh=orhZa1fQDVNg13Xf2hv14fXxJ7CL2ohR8GPEx9ozulE=; b=1k9/kvBPrjd8U6AKKHVIJsq7pFhMET0gcxeC2GfjuWvxcMkEkQ84mc6IvsOxAFR9mH7dis dd/WBadPXxO+fa0G4/uGsdDM5aEL8gwXsz+gNoSEnnatLMSwWc8Rk0SFwxCblSs9WMWStM kt3QJ04Y/uwmmkBCB2U+4GsbAI3J6Sg= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf19.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913433; a=rsa-sha256; cv=none; b=W2S+3JJABn0UviYoAW+donwyPeif2tPGz85k7YjqVTDcbD23ge4MzrY/A9EwXnFPDA2Qjb 7fNLPiMYtDNXx1pGMNKSOawJ+4RDCnh7J7QuH8Nv6CglPCItynU8dmQWyXhSWEMKAZY9df f0wQzVPmxXGTd3FaKSkUyqWo3ILZOEg= Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-2fa36231b1cso1714134f8f.2 for ; Wed, 19 Apr 2023 07:10:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913431; x=1684505431; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=orhZa1fQDVNg13Xf2hv14fXxJ7CL2ohR8GPEx9ozulE=; b=UiL/+diNjZ77UAZ93uE7BupL1cqL6ICaFftVh9bB4gabtTG8N/04v5lTWo3kOONuWN rMQhKmBVVi/D/OGV23JppNfVijzcZaexeo0JDSFjQY0wiNo8OMj6lzoPfm3WI+DmshaM nccOkrDiqF+veWGAJa2cpW6hj8FUZNT18a64f9thEIW/HmrMTaN9TUggrulc8Q4Ck3yR EDqWQrkHf0wkm0Ovbe6i1ND0kx8u5n03SNIhIMvbUJXdcc4QHWhR7ONmC+2+3TFmvHaU W0YjWbqn20GeNgeF/iUek6JGwLrST88s+bu3niyjE85jA2Uz86F6o+J3LBwTwsbyTYBZ 9dcw== X-Gm-Message-State: AAQBX9csssfjVjtyjwSvq7Oo20IR1ajwVA9LvFAAvlA+pbsNWL2G8RIN 5eJxVTrmvGxNudP2P855DMk= X-Google-Smtp-Source: AKy350ZGnNvFCGHtOF5DkVkLZweQA6NX/MNorpPWAg7TznL+D24Y2XSpeMvyxjzCOqr7ZSOtL7zx4g== X-Received: by 2002:adf:e301:0:b0:2f7:e3aa:677a with SMTP id b1-20020adfe301000000b002f7e3aa677amr4994062wrj.46.1681913431422; Wed, 19 Apr 2023 07:10:31 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:30 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 02/19] drbd: use __bio_add_page to add page to bio Date: Wed, 19 Apr 2023 16:09:12 +0200 Message-Id: <20230419140929.5924-3-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-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6/3hH UQbfHMb4 08NBqm7mSBydCqUDYbZBWliIkeQhzJJsBm9vqByOTF4te9TT9bBHJ7hO0bUzMVa59SakpUOI8dPhUkr2OIMSf8w42EbaCxQyFXuFmOzLd16vPgF9CZOO2zcO8sAyDmhCrov93/XJwUmMMq/vBz7SswtoHXbN57R/Zt+WTQ5sFkrZhSHCBmLIARCy9vV6jUd3ynDpqja/AcIOzXER0Y4ui8e8EHXuQzS93pEmTCTFO9NSpvX8Dc7FchqEoTRHKa/T8RPHoSa18GtCOyMzBDV+Rm9ma8CHSglJAffkUtlTuqlE71Eck+wd5t33JVSz2EDU5pqlfSJQ5ikbyF6d4pTHjdJBs4rqvWPJDdWBwgyjGVvMv7sNFYMqlCIduI7RK/2sUR0rkOjwG4YNlyzirbUR2dylZTPAmzH9rhds0jYf2bV59BAZoL08+0VVN/gLrGJuvVgNVNkc3xoSesxApEINp8dwMwxM4V0ZCHlnzT6fE/GlGOP+5ebCZpJ6Y32cAbR9tKEBZTep/T3ixPrIRJM8nVu3xxMde73ZM8rnCyPTdzdfDFeVWJ5xA15DPwgBZCIiXuLexsRfvULnb1MqArhVDqVxF4lXit+qBnFnc 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: From: Johannes Thumshirn The drbd code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/drbd/drbd_bitmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 289876ffbc31..050154eb963d 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1043,9 +1043,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO, &drbd_md_io_bio_set); bio->bi_iter.bi_sector = on_disk_sector; - /* bio_add_page of a single page to an empty bio will always succeed, - * according to api. Do we want to assert that? */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); bio->bi_private = ctx; bio->bi_end_io = drbd_bm_endio; From patchwork Wed Apr 19 14:09: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: 13216874 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 C5BE0C77B75 for ; Wed, 19 Apr 2023 14:10:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B589900002; Wed, 19 Apr 2023 10:10:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53DF96B0078; Wed, 19 Apr 2023 10:10:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3420B900002; Wed, 19 Apr 2023 10:10:38 -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 264526B0075 for ; Wed, 19 Apr 2023 10:10:38 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id BFA861A02F7 for ; Wed, 19 Apr 2023 14:10:36 +0000 (UTC) X-FDA: 80698326072.23.C4CDD34 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by imf05.hostedemail.com (Postfix) with ESMTP id 7F1A110000F for ; Wed, 19 Apr 2023 14:10:34 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf05.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913434; 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; bh=asKpmswp0ZeanhVo76Eo+6VNkXdxI3jhQK0PDuQZThY=; b=Mk9Xb8Rey/5uMnzmhE0IyDmNU4Z0xPHy5PxDd0asY4kgwVH1MF2RB8iNBxfhj4hLR79m31 6GtVPr7nbpHPuxfaqPy1bq0q/cYayrExKp3h9dMxVSmMM9pxQzh8XXrh81X9MW0g475sQn Q+vPEQyaQmAkfsgIt2L+/jGSCRmxXM4= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf05.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913434; a=rsa-sha256; cv=none; b=Jl5pfjxKlvjSiqkQCOSJoHTMjq4fi6KEuTo8qVwGopyJtLyDw2RXeLBmY5qaq0NVkjDjBg M7WNxvjQBmw11cyaCEVNc0CJsqPQkTY3cZIAfz1ImVaaZAVZeFlRH58uo1+t9U7WjVFPg6 HlT5egpoQvmFjzwKqCuVmxjuWiMMd3o= Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-3f182d745deso1685535e9.0 for ; Wed, 19 Apr 2023 07:10:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913433; x=1684505433; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=asKpmswp0ZeanhVo76Eo+6VNkXdxI3jhQK0PDuQZThY=; b=bJ66IhdkWteEljfII+qiuv91zfV0Q6UxYuSXOUtl91acKpY8ixEn9dajZpaAj0GJKw fORBo9aMLOZJFncVRlS0IIRG/LSQnZAmRuXVUmFpHhNOqWO8MLcnHL/r+FLl6NKOHCbt W9tBz5ioROxreSThZQjV275nSx50v9J3vEK2VqGA/4MxhFyt2+E1zH2eKHKrSdyL3h3C Ab4G+RVLFKHKuaq+gw7PwfxmdtoCR1dUrHXXgR/F1CHcDxZG5oo5GhnCuJPx3IyNaNjF bZ0VbGgPRIiafoDo9cn1UjCfhOIqXy7LssHVSM7VffZxWFTvCx2XfjiydsoK9Otamc7d aDYg== X-Gm-Message-State: AAQBX9dB3PcCRGTWh54/yiqJtV41MJ2nTseyH/gVFryPqXDoYUQ9AgzO kGTo4nUq7JnISOa0EZ97vbE= X-Google-Smtp-Source: AKy350YqBEkn+VSvf2DvOCXN7mDa/WvroFJZvGVNeDs7bs2faerUsWpsWUIcEH/19Lk45zhWOo8M7g== X-Received: by 2002:adf:e892:0:b0:2f8:67ee:5ca9 with SMTP id d18-20020adfe892000000b002f867ee5ca9mr4765546wrm.65.1681913433175; Wed, 19 Apr 2023 07:10:33 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:32 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 03/19] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Wed, 19 Apr 2023 16:09:13 +0200 Message-Id: <20230419140929.5924-4-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 7F1A110000F X-Stat-Signature: 3p8iqcuywo7pz6wy35mrscq9zcnq5jfw X-HE-Tag: 1681913434-317682 X-HE-Meta: U2FsdGVkX1/nj6lk8xbxtwQE3Y6iXDREFio+Jdx7VMfjh9B3CV+07PjSa13s4klayeLZCcPt0VRWgateAozNJv75WJtKSD1lmpAFLOmEBZFuJHKM11lrTOoZPC06rj+s5a4QoKAZ6alqvZmdk3eY8hkbUOxBa9UuUAGmY03PEPCpWpwLKowhaIC4AYCcRXHsONxjF6V6oc6qaVxubdO6GaK2z4nkHU2cEbiCf1STZWvQ1x1JzkXAjxInnsi6hhsWFnh51hFGhzpfDpo6gxi3ROAzi5R3L1Z9wQkZV8Id53MhojoWgVqLZgbN2z3QpXOtGjQxAVsWooWIxkIUciW1Ka/yOmzh88vGdTxd/z6JmQEnQjybmDTwGfs34SJt4Ym7qDz0HtQCac3+Z5tQ6lI9qgM80w9BdR4WGI4Gn8uMQszBGLHrykw+bHNiVWFcW8YFDykbgpYTwpA0O578Xej/vPd6bwfVPLCpoCy/2HC81EMPDfX3auVStjCSJstGiIvjoDkFlUV+NSbaVXSUC38sbN+CuEt1Z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icity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn dm-zoned uses bio_add_page() for adding a single page to a freshly created metadata bio. Use __bio_add_page() instead as adding a single page to a new bio is always guaranteed to succeed. This brings us a step closer to marking bio_add_page() __must_check Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/dm-zoned-metadata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index cf9402064aba..8dbe102ab271 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -577,7 +577,7 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return mblk; @@ -728,7 +728,7 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return 0; @@ -752,7 +752,7 @@ static int dmz_rdwr_block(struct dmz_dev *dev, enum req_op op, bio = bio_alloc(dev->bdev, 1, op | REQ_SYNC | REQ_META | REQ_PRIO, GFP_NOIO); bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); ret = submit_bio_wait(bio); bio_put(bio); From patchwork Wed Apr 19 14:09: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: 13216875 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 CB7B0C6FD18 for ; Wed, 19 Apr 2023 14:10:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65210900003; Wed, 19 Apr 2023 10:10:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B3ED6B007B; Wed, 19 Apr 2023 10:10:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40541900003; Wed, 19 Apr 2023 10:10:40 -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 27B196B0078 for ; Wed, 19 Apr 2023 10:10:40 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C9A19AC14F for ; Wed, 19 Apr 2023 14:10:39 +0000 (UTC) X-FDA: 80698326198.05.7488480 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf03.hostedemail.com (Postfix) with ESMTP id E4BF32000A for ; Wed, 19 Apr 2023 14:10:37 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf03.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913438; 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; bh=EWddmUi1sUqAJfDu3vTNgbuTywHhrfsi4XwupHN4WwQ=; b=zWkh8RNAXqSCQDc3URjgGSQgpyDwZHKvd7Xd2UCTiv+IjJ/CM2e0iAFg9pT2skHNEaJqc1 hzaRsocTa7Oj8QmZH+ZS/Xzomf9Rmo6DuYc34x7ZC6hghtsv6xtmf4Lfr3yvFUabFsDP/M I4sskb2eF9DvJMrxgFwwSJX1G04pS5w= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf03.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913438; a=rsa-sha256; cv=none; b=TaTcRsbiJRNKO0bw3x0KxDaYHQ49006BS7B69Jv8w+R87phKj8TcOoknzfpcj46kShhzx9 ojqeHATHC5ODVXbUuP9+XKdyfcsYmAogV7d1bsPH+To8+/YRKqJ2mVGFDlHTyBQt2ldrQB YWCeVRBmAWwyqNgp9852dD6n18M7Fi4= Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f18123d9f6so3362675e9.0 for ; Wed, 19 Apr 2023 07:10:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913436; x=1684505436; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EWddmUi1sUqAJfDu3vTNgbuTywHhrfsi4XwupHN4WwQ=; b=LFszx3ufpgSiYLk4DW1d7bEfwbh/wiSzlUw5StFfUGhklcZ7klmEpRfr0hw1KZNFrX AUoN4AwsMm/67KqzVohpkAYQbEt0tuv/VF+kXPAGZjPqww9nq1bhCRwQKGi7Lpca9tao KlX1zC3B4WwFnF+sgUSyQ3FSLGInF8GL2Hg1TfxiTlh/wfM1vzqa8IyYi90oeiDI3/TF CAYvfN9xmkdZ+ZE8iw3YpexziNbDrT2jmANjaF7OR6CVTfB5nDAuCux/9NsP9BQ3GUYP umQTOqfpZUUbbyNC3fVDfm1/1kVkmhaWhz8TAgMxyz8A7mlk5woQY1q7eZCTQoTiGDeH PhKg== X-Gm-Message-State: AAQBX9eCN+L9Nai2sXbQ89NeF6x3hR84RgRAdl2Kuk3OdLdr8TJAb6Fm Ao0yxmLUtPD+VbX/WMfakCs= X-Google-Smtp-Source: AKy350ZCP5TtktKYHNeFf1z9UiQzamRZMP6zyEAA3XLpw0OrBxsfVcM+yuHTi4CwYRfJVTx/CPP8lA== X-Received: by 2002:adf:f0c8:0:b0:2e5:d4f4:c43b with SMTP id x8-20020adff0c8000000b002e5d4f4c43bmr4684807wro.55.1681913436518; Wed, 19 Apr 2023 07:10:36 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:35 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 05/19] md: use __bio_add_page to add single page Date: Wed, 19 Apr 2023 16:09:15 +0200 Message-Id: <20230419140929.5924-6-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E4BF32000A X-Stat-Signature: b45e53653egc7q644uc4offkbqqjuu9d X-HE-Tag: 1681913437-444378 X-HE-Meta: U2FsdGVkX1/t0BMtIDvrw6th5B4Y93sjVC2A8HcpnFEx1gwmNMGh2uidGxjwFgWjtLLBESAKNlIm2x6aiu26pCCkN7H5/haQDEIT5c0QbnnOoNsZvpf70HTJOQIy7NDmVf38Z8UVgDriL/Qr/8e4FGVagdbueYNQ2d9upjenH8HEGpVGx82c5xWJtajGFPI1v3VwNH5HtWt+Fg5807CJrdt3CFV9qXIL90alPDFCJ1ElfUB0pXj+eoBUAlI6Ahvr5wAfLrb6/Fi0Hb2BSli3ighnpAwbSei/Tj69+3ob4opf1jbfMXRnJ+GVKNkm+2wTyAWQatQ5xq6+MW6A7sQ+oPpuCOVrAf7cZaXMzXaziq2V6UTO1rHdG3j+ocOqK823IEDx9E0L+M2hU3K9d3CmRKhnp65zyO+uIFh620lYTJ/M4+Zf6YEY8vM9RskIePNSoR1vH/6ZnO+IRlPXs+Rq4YbOGsQTbWxEw7ds2J1/2dHwhvQOuXDdsfqtJyWNxM9o9//MxoXf8LMn61u7KE9wovF1M2c7YxazOzDZvyCM4SLJp/+WN3ZZW+eGzXwwXnPaLgAjrnPcxpPigoFaSQqJj04xkfH9d1KyZJsbMDMBVZQ4mifJpYPJEApi+v9hH5GMHbp0FjvaQ3ncz2fGneAyMvyeLkuD9OeZt9cBaG8cQGHxpZHMprC9QRfnBmwugvjk0Xn3MxElP1h5dZ0c3VhwdVBeJPl6XJDf6QS9jSRYHedrJZxtDXflvEpLB91WS9h3H3BSzjIJwCSlOj3ynrcC2c0reLPMiKLh9KvNDQLM9c0OJO3aWac1k3Mix63Sj2mCF4cGW2Ohacpp5osoXvrlj/HSgJsGMg3t9K9DnLMseFOeoTLRH/icDmF7JM94McWtNe324pfOQTjNMIwSX8kb8JWfSeFEz/8OjxvlyP6VEqqhEjjAeRCkdi34QESBS07AEsxSeOHPP4eopCpI26Z MchvHj3Q J6Ic5+Ezz6V0kG0t41rSfmH6qOoTKvbxCtGq8y1ffFhlOX7Si88O+z5lJcbT5uA7ba9tPIt7c9FGRAYC1G4QL05d9nKmQf2TjC60Sp1wcIVlS+iHNP5n2d6dwXLN3CKH3a82csDY+hxwH4f74axmDMHwnEWVSDibqyktgHiB7Ve5Pbg+Zk4QxneLhBC0lqyjsHMePPPielWiDEtIc2rqB2TRz+G4LqPpsbVc0/PEE5HmfE/Hg6cL6jb3StDtdOly355wwmmRz9NUxj9tK3ZBfvwn/uuRbaPDIcWzhuKfxUq+YI7HuFhmnpZBXagKQIXqlAux54JiWoq4hnpi6W3Hz0M9Pf6Y9WIKZ04cur9Ehz0Pvzuvlc/mxAKWz6IMSRpikTr8em7oIhnCkiLupU/DVQPYIjxlqLttPv5zA1Q9MN1Pbd/cYcUQ+bnGrXvqmk9Xq5itzyRRd4WltO8Ob9z/CbrdkP4s0AwE44Rm7+t9OJTcKsxbB/eJ+ikcXs5896u0wtGtOAcP3tO70f9e0RelhgnM7SybCUjhb3ZeE31G4DVS2G7ay1BZXhAAFerfTpArcjv3RJmh5g8Qnt+qV9o/vurM6RdoZYbvvDpZgmvmfor9NR1lA45WKNxZ32xC1JqH+/OZo 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: From: Johannes Thumshirn The md-raid superblock writing code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-of_-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 13321dbb5fbc..20b9cd7c2f39 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -958,7 +958,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, atomic_inc(&rdev->nr_pending); bio->bi_iter.bi_sector = sector; - bio_add_page(bio, page, size, 0); + __bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; @@ -999,7 +999,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio.bi_iter.bi_sector = sector + rdev->new_data_offset; else bio.bi_iter.bi_sector = sector + rdev->data_offset; - bio_add_page(&bio, page, size, 0); + __bio_add_page(&bio, page, size, 0); submit_bio_wait(&bio); From patchwork Wed Apr 19 14:09: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: 13216876 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 BC399C77B75 for ; Wed, 19 Apr 2023 14:10:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 56746900004; Wed, 19 Apr 2023 10:10:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 453586B007B; Wed, 19 Apr 2023 10:10:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F404900004; Wed, 19 Apr 2023 10:10:42 -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 1D9706B0078 for ; Wed, 19 Apr 2023 10:10:42 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E269C1402CA for ; Wed, 19 Apr 2023 14:10:41 +0000 (UTC) X-FDA: 80698326282.14.B4F8765 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by imf07.hostedemail.com (Postfix) with ESMTP id 9E79F40021 for ; Wed, 19 Apr 2023 14:10:39 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf07.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913439; 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; bh=2Fzr57yVT4AGfP8f/rHc++3o/RNaaVBknK7ki+b7wqg=; b=2KJX2r1SXNDQV9EacNifqVxwcr4yi17IDsQwPcRu3FHk2+xU31sPOvMaT9Yybev9WI2x5o 9jadHEgytSAZ0zSE+FCfdwFIvg7x7tM7vM6O3uIkhV1qCZlJSjJX9u7CUjzwh4zACgLqM6 auzkDok3ZtgaCjT0BrxocF26Z+9tVTg= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf07.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913439; a=rsa-sha256; cv=none; b=sg875wEFS5HLOmKm7aBKYlQpELn3sm/3j0XwDJSvK/QCSmQb5X9lGI6SY4MeQ5W+U3zikn dxou/kMpb4P+hWS903LnkikaJogyFXS2V7yUn21XUNg51pNWucPUpUqciyi4vmoEG0M8kr u2beZTpl66dDDYLvfxXj/5k6GKXkMm0= Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3f176a16c03so13865685e9.2 for ; Wed, 19 Apr 2023 07:10:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913438; x=1684505438; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Fzr57yVT4AGfP8f/rHc++3o/RNaaVBknK7ki+b7wqg=; b=FeL9TFYOhqn70KAGXDatG3+t+z+MfR2dVckTpFU93xgWNW1CJp4AFi9XO7fAdjhPaB rEkqg5WxlBBnn4tjrTSb3N/JoIBoN14TjgLy/h+djYi1BCgC19z+Do6DWLxYJAWz3bxV vxM6T06yk8hR2JRpo5AFvppPjKYrffWYITUcAxLYdWx7xf5l+GeNgsI7im4IP+v1FR4b rBatmj3CmSGu2AO/TsnR9VEDux9WUUtELhRq/bSqy1+BFnkRQcAc7FJjGNmLHpKAhxpV 7R4JN9Axja6phStdLBXZ4orbvbs3D4R844sQcpyAOIvwymw+R+EGwuvugU0MS5/a4RzL fXZA== X-Gm-Message-State: AAQBX9fTPSXwjzhcVi+i9qT7lowNIxthSA/ZAQgJ4+a2BqZrx2j1a13V VrdpN06bCBSICxauJ+jzUbg= X-Google-Smtp-Source: AKy350b+UwzbHTOCNn17UYnXZKHlXNJQwvx+l7TgssVsB5tDN4gwDjzdQ+Z4ngjORp4WObNT+HzhDA== X-Received: by 2002:adf:f10f:0:b0:2f7:efb1:ec8c with SMTP id r15-20020adff10f000000b002f7efb1ec8cmr4366904wro.23.1681913438239; Wed, 19 Apr 2023 07:10:38 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:37 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 06/19] md: raid5-log: use __bio_add_page to add single page Date: Wed, 19 Apr 2023 16:09:16 +0200 Message-Id: <20230419140929.5924-7-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 9E79F40021 X-Stat-Signature: 58ezmuypd6kjfxpqap4i5hb8exyapfb6 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1681913439-805244 X-HE-Meta: U2FsdGVkX18O6M0Yr36tY6Ht0550Hu/UGUtxOdf9J0ZQUJEXpSh5+WdnBAKx8/0RThixm0aorg7XtbjT0CK9JDuHBgkOl2eGGSdIDk9CUsXp/4xZlLw3vs32GLRWmUqbjayLrMJiQpPjmqtKZeIq2Fw85lFYC/guXnYP4851ZANVFR2SGS2yLEIKSIanpitfxziuG/q9AMPIsRUySnh165raAUWyHLkhmVxNDNcKhujNw45m4wySxqDNS7GPjuo/kkXLtZ/ozLna+kdJ736b4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KwR2h5KlX055sSw0NoaUJvW9mOEaXOOENuKj1iw/i9qbTXpqnwey+O1ktbWkt+aBoYTz0BgyE3RjnpqIt7vp4/k960UhtoHQVonypCy9ZZAXokSMQAmEKBdQ7Yx3EeFGEkElksDbv53GOhyvwrhf7Bw5Ng+Cov9H9QwmjB2O456eTjke1xcT4sN51uZgagkGd5ymcDERK/HFSc0dTbRRvI8THOC7lW56prLNQc/NkUGLyy7OgLyOhliXhfXqOPnNZZUDoPzmdvYc 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: From: Johannes Thumshirn The raid5 log metadata submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/raid5-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 46182b955aef..852b265c5db4 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -792,7 +792,7 @@ static struct r5l_io_unit *r5l_new_meta(struct r5l_log *log) io->current_bio = r5l_bio_alloc(log); io->current_bio->bi_end_io = r5l_log_endio; io->current_bio->bi_private = io; - bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); + __bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); r5_reserve_log_entry(log, io); From patchwork Wed Apr 19 14:09: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: 13216877 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 8281FC77B73 for ; Wed, 19 Apr 2023 14:10:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E9206900005; Wed, 19 Apr 2023 10:10:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DF0806B007B; Wed, 19 Apr 2023 10:10:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C1BB7900005; Wed, 19 Apr 2023 10:10:42 -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 AED986B0078 for ; Wed, 19 Apr 2023 10:10:42 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 61E161A0197 for ; Wed, 19 Apr 2023 14:10:42 +0000 (UTC) X-FDA: 80698326324.07.29D3E4C Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf03.hostedemail.com (Postfix) with ESMTP id 62FBA20003 for ; Wed, 19 Apr 2023 14:10:40 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf03.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913440; 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; bh=F5xZASE6AX0FDAF9QaXMQYNUIt4BDoCJAIYtVfQg3gg=; b=GnvTAK8/3GQniplO27Pk13w7f8Thaaiy7whllXL+DGxUNybNhR0UCgTSiAGc22Us5SWV9Z cJ4WrfupeT1L2M6sD3i6J0e/7tItkYxKn2/QcLjTdtz16YdedzrBUjvqE/t292ifgHhw+z WpnQCJBA3zm4GLOaujjEIKO+0F0pKEs= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf03.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913440; a=rsa-sha256; cv=none; b=L5NskTamd2I9RWwVTr/bZngxHbokh3iCKfeIehRy+xKhYhzqIBs/Ylxcg5DLhxgr4CvGuR jDR64nCrbs4EMehQdNXhbGdC+RlWKFwksrq44BXnJLMQAOGVMcIiYoh5D+347Mpodhwr6i L0j8GGfG3VFnJ0GKH8l1/R88+hQMs6U= Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f18123d9f6so3363005e9.0 for ; Wed, 19 Apr 2023 07:10:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913440; x=1684505440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F5xZASE6AX0FDAF9QaXMQYNUIt4BDoCJAIYtVfQg3gg=; b=dUEOnipD6sSrApYDtZYJqAYABMLDdQ6B5BNHi9mWsow6LpxQ+3VTLRJA7Ph6wq8pte GzsklF3e33sOLZuFUg0LkSF8Mlt627qICqCLMMkvXiMKRyEEWJ5dd6P7BD5EODRwKPWU G2kBAe8r+vpATZwy0e3MefVp+wz3WKG3BZLAAxUUzHWDNIWIntcy+j+gfvvq1JLQCHhZ OQLKGtOqf4YLn5w1NVDB8VRn39YFJO4C7nWCqAu13Tv7MabPZtoRHjk7qPC16IS1Y34s cz+9xue8S+RhlSrwI0I4aKTb+oVqhv3wFcEAQXAQcv6Ko14d8ojv3B/CkPtDHBuWyRPt Gq3g== X-Gm-Message-State: AAQBX9csS27p/bWJnflq94w+Edl8+f9xAqA1YKjZS4SOoWM5tUgWCA+2 TOSYNWMrvqWLij9EiFgJafg= X-Google-Smtp-Source: AKy350b5HmMSxUjSF6do3ACzNk+y0AqqAyJ4H9Xhpj5FHnN7rtVrL4Qm/xE5kNgOgQjjoDpX1eOxug== X-Received: by 2002:a05:6000:11cb:b0:2f9:4fe9:74e7 with SMTP id i11-20020a05600011cb00b002f94fe974e7mr4966092wrx.70.1681913439747; Wed, 19 Apr 2023 07:10:39 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:39 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 07/19] md: raid5: use __bio_add_page to add single page to new bio Date: Wed, 19 Apr 2023 16:09:17 +0200 Message-Id: <20230419140929.5924-8-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: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GtVzf4+M6zYAXboKTIsEBswqIStPpzNwexd8 maEzJk7a DkgmT1H96Byixd9WR2AEi9wOg4UyUP3B1zd4CLIiAi5esNIs8o6kRwMx/X2BxfDWnwMZkBUmSlNvGm7N7NxKsMhT8hlYwS0pV++vbcA5EZEUe60SyQTU0CesyvlpNVZ9AmYdNOp3iKY/TvCd8l7R2ZOLQy2Q4AgFpkyFLudhk8jAgpwWIKhBd7/LEMtVKNYo4juY41m3QzeowiksVzsu8rRfdD2kIhOtzR1tU3Zd6wnYMyX4RkA/Xpw2+Mc/O5isICNTaz22fME98m+4qaDSxy7dUhvExIoknk/mO/3dewmm+CT5Q7ra8XrQ6Dnuz0bEQO23mnDTVg7qVQxg1owBZOx101oKgowsUhjWKBHlN1X6PvPv1i2j4jAngnlVUPVm3/ial0eugG2saOyPbPkKL3nhAl4TJ6tnSDClnDoOl0cf7vF8QqcAGIAP4sR9WeFkn0He597vThJeV9KybhuqH/eSM2Y26f/5nSBopu3UdeD+PGCLqrFQ5ZroHkdVDIJ0UxnrbTDJv501QdRn65w1++XXsz5cXvhzq5rRCL1EbZWXzXZ7dTMpwfuVKDrL6IlX9YVnMZv4BAr4yrERZuT41RHl6DfDqBsSCNeOqUQNADge9VTzkUOl/FzA1TeaVMLUArpFH 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: From: Johannes Thumshirn The raid5-ppl submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. For adding consecutive pages, the return is actually checked and a new bio is allocated if adding the page fails. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/raid5-ppl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index e495939bb3e0..eaea57aee602 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -465,7 +465,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) bio->bi_end_io = ppl_log_endio; bio->bi_iter.bi_sector = log->next_io_sector; - bio_add_page(bio, io->header_page, PAGE_SIZE, 0); + __bio_add_page(bio, io->header_page, PAGE_SIZE, 0); pr_debug("%s: log->current_io_sector: %llu\n", __func__, (unsigned long long)log->next_io_sector); @@ -496,7 +496,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) prev->bi_opf, GFP_NOIO, &ppl_conf->bs); bio->bi_iter.bi_sector = bio_end_sector(prev); - bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0); + __bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0); bio_chain(bio, prev); ppl_submit_iounit_bio(io, prev); From patchwork Wed Apr 19 14:09: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: 13216878 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 72FEFC6FD18 for ; Wed, 19 Apr 2023 14:10:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B926900006; Wed, 19 Apr 2023 10:10:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 342876B007B; Wed, 19 Apr 2023 10:10:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BD55900006; Wed, 19 Apr 2023 10:10:45 -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 0790B6B0078 for ; Wed, 19 Apr 2023 10:10:45 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B926A1A0144 for ; Wed, 19 Apr 2023 14:10:44 +0000 (UTC) X-FDA: 80698326408.30.EC5EF6E Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by imf01.hostedemail.com (Postfix) with ESMTP id 6AC7640030 for ; Wed, 19 Apr 2023 14:10:42 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913442; 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; bh=UHB27r2VAJYtptv/DszRuaYXLzHwMALFS99ixQeQIrk=; b=qesZlwDOwO3WeDNTUHb7ZSglIDznHDZreaopJanDCzJakWJ+vAjJyqBSvCpLqEdA1UF4Zb naeT0ShzsPIV2mA1usacffhCsmhySPWFdHeflEZOxFCqypJnXPC5U5xzzprBaqI3ZzW62K 7QPWQj5ATVtYZgzFMyNNs0AZ0+Camxw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913442; a=rsa-sha256; cv=none; b=o8BEYO2E+3gC9UN+gkqqRuPRbn07hJ07TSLGGOVycVGeI95xWwoEuopFyPjiWv7uHlc6Tj Mz8exASiZj4Rq+Ip35YCkdJ3YhDoNf/jHBIiTibhy3JQkltlHgkVU0QDUKnAY2tWVZx9r8 NiIcZ2IMhwGSOgOGh+AURPeWr1lxNOM= Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3f17fdb520dso5922705e9.3 for ; Wed, 19 Apr 2023 07:10:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913441; x=1684505441; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UHB27r2VAJYtptv/DszRuaYXLzHwMALFS99ixQeQIrk=; b=fdxsGbI0OIz8i6DIbAMa7xmKyBtNWSf7e26oXnwqSIkfbiDMl6DwyLk98GYONGzqvU wdTV7/6AlzoWvm+w8MaBSA5QC2bPkktfoX7/TktmEsRARZ3SyEUCzlJ0v838SQvqBuiE sNcWsLAgzGPXIgkWdmPQwXH/C5QbVWs+suPaTe+FT/fcfwxUU4e3DIBFgK/0/wpL1FII jvR/ShmnbmgYIg5nGu3BiZVHohdpX7XYm4eVjqShvfYD5pMhPUxqmNhkxZxxZZhzVtbE IWA33W8gKDGfzk9Mdw8Yoq0yVI5Pk/sWLWjGnxhVVyskzi34IrdQZ6IV5JOvI7YSbvvh kF5g== X-Gm-Message-State: AAQBX9dhkqWPy4tVjq0HbAiogthCYsdoi84Xua9x6P8Nut0sufi/peln G6/6S94hXwdKfRe/ddmIYn6IOIh4RSxyqQWk X-Google-Smtp-Source: AKy350Yzi76bXam/T5ppDWB23h4mS+GurlXtWZ/gJi0rAcUNNcaqO1+varQiNYt0Qa9LFt3v3G5TJA== X-Received: by 2002:a5d:4411:0:b0:2cf:e517:c138 with SMTP id z17-20020a5d4411000000b002cfe517c138mr4900340wrq.66.1681913441132; Wed, 19 Apr 2023 07:10:41 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:40 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 08/19] btrfs: repair: use __bio_add_page for adding single page Date: Wed, 19 Apr 2023 16:09:18 +0200 Message-Id: <20230419140929.5924-9-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Stat-Signature: n9kw618crmpnbjr3po8yxiqxuummqi46 X-Rspam-User: X-Rspamd-Queue-Id: 6AC7640030 X-Rspamd-Server: rspam06 X-HE-Tag: 1681913442-826286 X-HE-Meta: U2FsdGVkX1/37/9yArDqHyVX8Zp+oFTsFU/OdWiBmcc2G7I58i8TKUyvEOFzceLbm2cKwp7IM6VlAETwiFiu+2ei6d4UIDiA04NjpXDX33K6fYcmjkLWuwS2tVWBjoUMxofRPgzjCqHna2LSjIuBioC87lThcpdR+bhWez6nYaP37dT/SzQh9T9tZwBxYJVWVfeOx2iG0q6Z2+Mww84tofgMt6EItsu61QqL5E0nbSUYQdXenCFOqj7KhYMdOoVoV51BgRzbu5XEHCVAP7BDHm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p6fvo95gT2yeQIJaQgJB96fkGv3YRYu1xTyVW3vWV9/WXHeOU9B7fAbT8iYDFPpSi2WMxhoTUb0dN3Uuqe877DMXLurPhtPTC3CsLOvQYUThathKuVKUNwcQLgEbu8OnTg+yVbYLqIHw002qUnhNK2piqVsTdCMS18KtMp47bCV/a+JmYx7iY1tFJrp3i+Wc8p0lu2uiDrs40p5Fq709SBB0DXk1utwwZBKTw/pSiUhFze3JA51xIKdkrEZ9 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: From: Johannes Thumshirn The btrfs repair bio submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/btrfs/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index 726592868e9c..73220a219c91 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -224,7 +224,7 @@ static struct btrfs_failed_bio *repair_one_sector(struct btrfs_bio *failed_bbio, repair_bio = bio_alloc_bioset(NULL, 1, REQ_OP_READ, GFP_NOFS, &btrfs_repair_bioset); repair_bio->bi_iter.bi_sector = failed_bbio->saved_iter.bi_sector; - bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); + __bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); repair_bbio = btrfs_bio(repair_bio); btrfs_bio_init(repair_bbio, failed_bbio->inode, NULL, fbio); From patchwork Wed Apr 19 14:09: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: 13216879 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 53156C77B7C for ; Wed, 19 Apr 2023 14:10:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A35E6B0078; Wed, 19 Apr 2023 10:10:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42CCC900007; Wed, 19 Apr 2023 10:10:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E2846B007D; Wed, 19 Apr 2023 10:10:46 -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 0F0466B0078 for ; Wed, 19 Apr 2023 10:10:46 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E19741402C5 for ; Wed, 19 Apr 2023 14:10:45 +0000 (UTC) X-FDA: 80698326450.07.A39B3C5 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by imf22.hostedemail.com (Postfix) with ESMTP id 20AD7C000A for ; Wed, 19 Apr 2023 14:10:43 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf22.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913444; 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; bh=XSziFxMRLlc78BEY3ZIcArKRUqB+ur0VzFu/o2eWTQg=; b=TvCStXTvTsa7LImSDbnSIPPFPa14rbkeS4HmLIXWccmCa71sIR60JpL9WF5cZgM1Fbs1hD YI+MKJ6r+UyP05JensapRUNZSd7Qd6XF8KNGfKzhndrWAsUXwBBTZfiB6seCKo5Lk7D19S 4eHT87lH26vp7YdwdBMIgc7tRjt8YRY= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf22.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913444; a=rsa-sha256; cv=none; b=qDsRwYTOo2wVpyarH9t2T+A05+r1ysSjgiwZE8AscVjvDXFko5Iqj50Hfs3ysAEIMab/V5 BzUtGzqqnMMn9+eLlaIskBdDE20F467dz+uRy7fhgrp02cYqWTU1yf6PyXy/wSkEBSodgT WYnW1o5AUnul6sIuqPaUvUx6I5/hGe0= Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-2fbb99cb297so1660355f8f.1 for ; Wed, 19 Apr 2023 07:10:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913443; x=1684505443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XSziFxMRLlc78BEY3ZIcArKRUqB+ur0VzFu/o2eWTQg=; b=TfFH0KF8GTX3XbNzOnZZN5pMc/YNzzDqoALrYfUIP3RKUPljTjlnaD155dzH52M9LO +Ao3KSuQtJIGEJS0VGNL9GM4NFRrx8jFzVtuI83zt1oDG3Fm7db6t+tLd5LPkemv+9Yo uVXXrWk+OssqiP+Jm4VsIiN3mDQVMr5iQE36QO20M3b/MHqawkEo6E7y8jpKf2uTjbyr dcJRrBf52BfFsCbbzQlLkbh41iwscYjAKyw3ecvD64Mamb/VwT33SWiKD31kYlvh33QT f1ebDSOqve4FTzrRxcdpye5ebrtMwhje7MRLVjBQ1odB6Hk95H7u7R66xRCYPbkhKLoa uTwg== X-Gm-Message-State: AAQBX9dFGxcnolyXcUL7x6lKnnvy19kq6GVAquGcYk2uCYnnrgKLc1ET t0ZirxI9fB5RZcqdIUchNuk= X-Google-Smtp-Source: AKy350ZNLghyp21Md4xzCnKC/CZ1jD7PS3tRxkpm7/A6UV4bbe7dKQsIepFwKTi5j5wXVP+SbzJYCg== X-Received: by 2002:a5d:6a45:0:b0:2d3:bde8:9ff with SMTP id t5-20020a5d6a45000000b002d3bde809ffmr4938443wrw.34.1681913442744; Wed, 19 Apr 2023 07:10:42 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:42 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 09/19] btrfs: raid56: use __bio_add_page to add single page Date: Wed, 19 Apr 2023 16:09:19 +0200 Message-Id: <20230419140929.5924-10-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 20AD7C000A X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 5wwndyqaq6nhameuoy4zc8i5ixedeewk X-HE-Tag: 1681913443-133754 X-HE-Meta: U2FsdGVkX1/G4zGCEzNU21EC3LIdkHz/DkpbktSdc3Ou8Lx5ipi7DrCM+P/r1Yq+5ecaDFNoyVUgREcIXGs0+AmgotOxgi9ArLk2T2as3hEuAunhAOgJU/AvEdsxAeYEAvrUNs4fpQvWzgSiuHo0FGQjziBoZtq0MRPU953i3TMRo7F7KE2dgTzhNI1lKsHA0owLmB3dojDVp+I6VbFFyLVFh9422YjME5z6gMmPzH40dFK5ssENqbYiOobnp20ztibPMehd6ZNmujwD4IlgtG8ibVN0VKqSEB1iGgEvYwy6q35+kBQKEezg1u43jiD/6HWZYREFLUrxdvcWb81fnDrDNVu31F4B7KvQ419zdZYeUa2QpgL+lkO2iewAGWUCU+N9mRmRZPB7bXqZzkzZZn7MeCy5CRG/9NQO/w6qZNzUUsh2K+gFgxiewXc9h+92O2NaIWBLHPJSQVIFJmejJKop1HtEtkwBeOzAVk6YPxMEKQj/nWxxJxiTQ4iRPT9KxLtuT3CphAOPdCyTyjcIwhleU2gF8WaRRKsGDpEQBwEKYSyiqAhVCIHuO+ew2O/TT3Pkn34u+Clndtd9GVoPYC3Byg+c4v/e4VIsgJPMnzcar/EmLXSUcpdrRuCVzPNJ6Ij8NKBH6jVfVTafPy1u3Ty7oscxGbKwxdVEuWEsNL6lWayVCVRZytWUT+xLvLkA4LnHJjKf0svETpPL59Inp0kHT5zg7XUmh0Wl5jy6RkBEKiC5vuBkPLOxoqdl0mWJHGiv3cod16UCuOIAHkcA1ac8gavtHumDRZZyUlYtnv6D5RcOoS254G0VyHZrOyEBI+muAReTBQh5BdxNNKPqdrd6uFAKXUzTl9ctePJJxl5AERjbAJ2JsJleMFHI0V2MCMNu97oarGmUsyMQOdSr9nQyNl5OaQggLwokD5kuBgC7jWXCJfoeSh2g9530qxfE8iV58ainu8TzPjiGm+J 0hVpWeQ+ RhJX3xiyKA1BD4GWV7HQ22hO8oUZAmoG4Xu3yII+U5b9c/oN+w7Qd3XfQ8b7+14F+3lt8wuxuKn/NP4CAB7qnObc967IRHtAF4rAEvwP0T+gRoOspqIpmiZtODFiV2FYPa8fL/3N4vIXgTVRv0w5v96O0pz0Ku9VI4SvF67/Eij6fxkZaHqdtskxQ1qAeHctk03KdSVWtRLj5Nm/HvEiSYntuioGyWdTPhLjgXPnryv1GKzDJaEQnqXfDw/6WSGVSPgrSJ+rHun2bhIwfYn85BuuOWrPBWJvE9KPZh9yP4dBt/g36ReXfO4XxiWlrvh2WGV+rqne+4oz9q0rxMlO0Mdlq3Vv5n+PGFsBLTMADaxQb/PahFiBFKqp9Y83OuaocX3geqKtb7EeqFKNAjjWj3L6Z7mweIPiRfyCIfqPb3tQkshV81sGL/gtM2jtEcJcA6ZiXaG0DyvtAnk3dHbRXeliQOpX6jZq6558zQqyvDCROsXzBnWZi1HJ7OdicFFzrlaHGYmCG/1pw3tJhFgupjObGST2uwH2fPVYHiqOF2QGQTzPely3hXm5zN0RVfEno8CrePGsuA+itC75bZGUeAhhj7UxWttljYITq 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: From: Johannes Thumshirn The btrfs raid58 sector submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/btrfs/raid56.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 642828c1b299..c8173e003df6 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1108,7 +1108,7 @@ static int rbio_add_io_sector(struct btrfs_raid_bio *rbio, bio->bi_iter.bi_sector = disk_start >> 9; bio->bi_private = rbio; - bio_add_page(bio, sector->page, sectorsize, sector->pgoff); + __bio_add_page(bio, sector->page, sectorsize, sector->pgoff); bio_list_add(bio_list, bio); return 0; } From patchwork Wed Apr 19 14:09: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: 13216880 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 3493AC7EE22 for ; Wed, 19 Apr 2023 14:10:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D3112900008; Wed, 19 Apr 2023 10:10:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C6A3D900007; Wed, 19 Apr 2023 10:10:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A477E900008; Wed, 19 Apr 2023 10:10:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8F2EE900007 for ; Wed, 19 Apr 2023 10:10:47 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 64215AC0B6 for ; Wed, 19 Apr 2023 14:10:47 +0000 (UTC) X-FDA: 80698326534.21.1E88F52 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by imf10.hostedemail.com (Postfix) with ESMTP id 5F06AC002D for ; Wed, 19 Apr 2023 14:10:45 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf10.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913445; 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; bh=CtDbz8KQ5RO2QKOv20A9cNZoc5bLawdSeLMzRI4Z4l0=; b=XbUG5RC6Uj0HZOe75v7+X6dP0gtrO8AlyjhnpPWutVwJxVwIGoFWjrHBOaUU5VgrbIFzDn Gl2F8Qaz0WuYdm7ndLwA0/9p6m1JtpkYyO9pcrnCIZUz21dIT/m/0QZCH6owq59tPeJHKc S9LMhgI+lO8Qr20XYQVFNKPgkRmcrms= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf10.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913445; a=rsa-sha256; cv=none; b=QykQnOdlmdOR7mFLc5Wm+GZOiEuc/kWfQsnGps1RTDVbxIwj8NZZUHdltLF0ejnT4luaoi CISVjL+fPqj/n+MIgk9cDRdbGMqASIpI9zYdNoRBXlGwvRikf/fAvf0oxRS/fFtBL4SvAn NwFFOBTdk1QYW0+5+IWsEB4zqfNL9KA= Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-2f62b1385e3so2059944f8f.2 for ; Wed, 19 Apr 2023 07:10:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913444; x=1684505444; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CtDbz8KQ5RO2QKOv20A9cNZoc5bLawdSeLMzRI4Z4l0=; b=gioPuJgoatNoscnYo2WoRY5bPzz7Jn/bJawQvyAlrfSXy1hUxvqf71HE+OcAXMxdbg jNvCnnLDPw8EONuV64E7wI3cwJ6z3Fs+wswRP6NE0dCVVEAJkc+eX2kse3B9W0qQgHKX aSPVSxr7OfwSVPDf7Q0DXZRgShisng0WCMFe6g6T2BDZWXd+srUdXAucwUVvrKQGKLbP dMeNPX5km7RaumMWX6t7y+PVf/THz+WAmfc7kZO/eYeR3IH4sgmCmx39bGMMQMW1sXYT Yzt75czV2Zx1zAr9vdaDgPX9e7ioG9GmLJNFi/4skpOOUCX0BDm52ZD8wbeSXeWf4Vq+ nz/A== X-Gm-Message-State: AAQBX9fKNmhzuvtVQXBychDinA8fqawml8xhvoaBBSTYCWe9lp9ztiuN bBQYC/+oyPlmbfyQDZX3RS4= X-Google-Smtp-Source: AKy350Ze8Tv0YqSXT14neaUNfEVUUfvrnu6p2Ls7vR1xgw5JSmGx7I9PgXV6gytGGhd8sVCBPP0ulQ== X-Received: by 2002:adf:e584:0:b0:2fa:3af5:bd36 with SMTP id l4-20020adfe584000000b002fa3af5bd36mr4878832wrm.24.1681913443959; Wed, 19 Apr 2023 07:10:43 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:43 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal , Dave Kleikamp Subject: [PATCH v3 10/19] jfs: logmgr: use __bio_add_page to add single page to bio Date: Wed, 19 Apr 2023 16:09:20 +0200 Message-Id: <20230419140929.5924-11-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5F06AC002D X-Rspam-User: X-Stat-Signature: uy5ikapzkdy1bihnf5bsfo1irg1feykj X-HE-Tag: 1681913445-860418 X-HE-Meta: U2FsdGVkX1/bCGZWtk6wuHDVMlI4X247nSK9Zi8HcOyZhmY9p2wwCiYr4kF9YhqfLEIQ1UeezXO2jjYZVJUja8BtdRzjAXkv/ED3vfNf551BLQwHHh6LXpT97FoVN19enAxdpJcrhvSIMd/f1VPCYFcKcqhL+hmBnHfy5wBsJEY77HFIjVrSXusIQy9/DT2EHgto7rTfyYE1tAJdNiQ2Hz8hN+RpfK4p30Ad57p9PnPeQpT6UcdwljX7wGBsy9fJHq7mVLLY+bbeoJ7ZU2IrS+EcODggNshevMLHvcz28ClZwEEPpa8izKSJoZz7nPE48wh0Fyv211z2WMmCSbwmOWs6gYLIrFiqdhRlehB7D36g/zbir9M3OOHzVDZH6KFTdesULpReTuyNdl3s778Ff51me9XoAaRnplomspCuj7US8VC7NVqtljWuz7It2Lc18uuA6jR+06TkoNTFwvfnHt43rBA/OPEvB+sVhbUkbwUVFtdrymNLEGi8jEXJAkrbVu+RbmP1YXxKb+c1AVI/MhT3G+FEMS/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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: From: Johannes Thumshirn The JFS IO code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Dave Kleikamp --- fs/jfs/jfs_logmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 695415cbfe98..15c645827dec 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -1974,7 +1974,7 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp) bio = bio_alloc(log->bdev, 1, REQ_OP_READ, GFP_NOFS); bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone; @@ -2115,7 +2115,7 @@ static void lbmStartIO(struct lbuf * bp) bio = bio_alloc(log->bdev, 1, REQ_OP_WRITE | REQ_SYNC, GFP_NOFS); bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone; From patchwork Wed Apr 19 14:09: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: 13216881 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 7C71CC77B75 for ; Wed, 19 Apr 2023 14:10:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F620900009; Wed, 19 Apr 2023 10:10:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 257C9900007; Wed, 19 Apr 2023 10:10:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2915900009; Wed, 19 Apr 2023 10:10:48 -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 DCC55900007 for ; Wed, 19 Apr 2023 10:10:48 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 802721402B0 for ; Wed, 19 Apr 2023 14:10:48 +0000 (UTC) X-FDA: 80698326576.29.7436025 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf06.hostedemail.com (Postfix) with ESMTP id AB15618001C for ; Wed, 19 Apr 2023 14:10:46 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf06.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913446; 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; bh=tjFYGcD8nQN9rifaEDTZAqJ2yu2mzhO8AAh5DrpkTqw=; b=tMSgvDlBKJVrBMwAR/QOxmHNkSGze9V1E6R8fVucoK/PJlYaXjdgDrjXj4PO9/1rAeJ7KF reJbMk4RFMvl0L+N4rcaeTVQdPSsXm7L1/GKJZaI+m37ehBcXY1pT6uV+BtWGE8oRtn29y NorYAXiY0EMrRtwJ6PP8eNOxbOw0BnU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf06.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913446; a=rsa-sha256; cv=none; b=cNS0CkOdNxjYtCEwHC+wA57oTAphy3ptv1GVKueKukrT6h1J2CEl3c+Ac91fvpQSVMA/Y9 SbOV9fS0qhOGCVbDpQUrherGMfsPaYkfd74DIFLEn7RUQ+EOQUXhEgUPqBd6T7DNfi5nLZ nG0XS+PvJ2evPExFbXWTdX5jRQZZQc8= Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f16b99b936so20277525e9.3 for ; Wed, 19 Apr 2023 07:10:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913445; x=1684505445; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tjFYGcD8nQN9rifaEDTZAqJ2yu2mzhO8AAh5DrpkTqw=; b=aCp6kMeXAaIriqUqlpk1T1NajVWfE3J1zSv8fz4opUXaBvM7TprCOwiXGufyX6/OYe V36YtbKlbgycIzxsEI6/0ZM/5twHnyTw0l40ChHX3ksbhCuEvhbokU4KSngEYtz8F2P0 rqIcAwBf2cul5M5hTpb3sigUG5TRKSItYcKVX514jp4AQORMnZSIQcTh83Dp6u7O7zgJ SB03joTz22YcBlgLnaIanMjYd7uIcgyBbn+4o9zp0lus8+P0HMG5oIC4wDSI0S882Q+G xlsmKVgiHxoZnnHCIN9YI6WhVXuJ1lGwtDG7QCMVQeTTr1ghHIRTBbl0bjAEe2kPYKki t+6A== X-Gm-Message-State: AAQBX9dmk4MpkdnufuLTUTqE4vyegYWfgaw/LN8xC7+xsihSfR7fZnGE TsTJksIS0FpL7RiPn5GuUNA= X-Google-Smtp-Source: AKy350aGGEQ7SWmnov97mBi05fDjNbcA0jBUqTYCskx4hlxP5WN71pxTOnLMeDvsnGyrkEzM33OnpA== X-Received: by 2002:adf:fdd1:0:b0:2ef:c0cf:c72b with SMTP id i17-20020adffdd1000000b002efc0cfc72bmr5153952wrs.29.1681913445555; Wed, 19 Apr 2023 07:10:45 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:44 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 11/19] gfs: use __bio_add_page for adding single page to bio Date: Wed, 19 Apr 2023 16:09:21 +0200 Message-Id: <20230419140929.5924-12-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: AB15618001C X-Stat-Signature: dqfjez3dwmspxarpd64fyikzr8d5c37p X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1681913446-967492 X-HE-Meta: U2FsdGVkX1+L1jhGfr6EzAkBWtcjtV5dezjiwfnCT5Xklx4YZ7Tlhx7IKx5qBTmEdIYm+9o6FPaxgEZXUv+S99iXN3FSYWCeCqQ9J7vsStcIYXbPaHttfr177plemfrT/0oUqW3BomrMR0bDRjk9K8MEgCdgTx4aEoZltvuh/kEgLlGHkxQY4o6emxV47qbL0NK4nO8q/dmc7WuhXJ38+kc78ieBAKP23vqKvtWI0EdCpVlZikbzQflY3VPdAZW0gStSUNkvXd3AYK4cmS2Lp8f96UiRaDowrc0trWWT6FZdYmjjd9lpvj9B/Iz7UhthvUBuFDFCfw+8metc/GLMOHe7WAd1Pa38V7lIJhH3nkIA9to8njocUcH9Uc1itXxGX3HQPPCQNrp9/FQKxtazBVJscTlcOEcZCWqiI3AXeGBq62lUxcHWncU5Edyh+Q8GuCT8PgVIVs3WxKcL29XpZKl6exQOoUk03VyaRVqP6XrtusMOSMclFoe+ubS88/FXVquzWTt/EdKaf1/mCLFxjABPtSO4TNUbj14aBSBXD2MyJv8sj2oTxwllDNCcNjDnStsRJ3VgY9iJblfTvBoq4+jWK0CRCzU+85tUx2W11l7OoppbTJ0PcWehqZfW+MqCw6mS2XaQG3hfP5sWUbY8s/lSd2Ki0tDC4wJYM6hD41tOJmSfI1EHtn7MxqZGsvIBiM/Dcdmy2bd8rtx5Jpen7rCfqIH86BsWtjhp29Zc9MS024PlI7s4+6B3d9rPthMxibdSLSo+cvG1HYEKDbHiCJev21h4d1TdMsBka7YlGacq9toxRiSLUabAb1WTp3ZFXEvKKdZsWY69MYP0ro4JxVjKpwUrtJEA6AnIHIp5vBKpa0AF7jSr2gLYHOb73rmXtvgt2t5jy6T8Ixdd47/aa98IuTTjwcee+rZryj+1osFJPzOMiO+eBNCck+5Ul65gqZcPxqmcWnpo6/WA+rh kybYBoGP gJCtxMyfeO0QJdHnFoxgIHe2cUMujZl7mcO2+L1BYlphLhCGu24u6oNRHgofv2lXqQAJrcamDJsFdp5YEYqNyzYzbOy4nzsLOWas+llBuWJ/3Y3wvUrF+JqPTJbK3S/ghwOz0puvsAHu1HXK+K4lALDm506qs4XKv2CxiOW2gURCXRu9dimUtQOj1FX6mwMLQ6r26IVDJpYTDdzh2ThHdDiWXhH4uZJp6qXinXdQnhibMNyB6IaG1Vqd3lHluqI/1GTMT6cY7134CQYBT7vivno81LxBOgC9OqJyKREnofjraWOP5r5wECi9+Sly3yXNVTHb/RYSTyf+cNiTFpVLk/J1g43OomTDDnZjVv3rFhHZ0PtcFWTlntg1/dC5+C0Y8PAPgG+brzAyoV1l9apr6ucLGM8bRpOecpidA1ssoW5Day0M+z29D1GFkaLbR2l7fg1UinGnVBGLfhEGqrdvK9cqJtvBASYS0EolJ0a63FN5+uKOsPlV58IolybWKZV/dre77CTACWpoh9XK8jo7a947K28LaYiOg1qa/B5H3AlZFte+WlrpaGZ8kJxjfio0/YAni9JpbtWhGesoIj6hW4fV8hi3BR/Yj0Ktg 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: From: Johannes Thumshirn The GFS superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 6de901c3b89b..e0cd0d43b12f 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -254,7 +254,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio = bio_alloc(sb->s_bdev, 1, REQ_OP_READ | REQ_META, GFP_NOFS); bio->bi_iter.bi_sector = sector * (sb->s_blocksize >> 9); - bio_add_page(bio, page, PAGE_SIZE, 0); + __bio_add_page(bio, page, PAGE_SIZE, 0); bio->bi_end_io = end_bio_io_page; bio->bi_private = page; From patchwork Wed Apr 19 14:09: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: 13216882 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 5B8AEC6FD18 for ; Wed, 19 Apr 2023 14:10:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 195ED90000A; Wed, 19 Apr 2023 10:10:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 121F2900007; Wed, 19 Apr 2023 10:10:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8CDD90000A; Wed, 19 Apr 2023 10:10:50 -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 D49E0900007 for ; Wed, 19 Apr 2023 10:10:50 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A113C160171 for ; Wed, 19 Apr 2023 14:10:50 +0000 (UTC) X-FDA: 80698326660.05.D9BCC9E Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by imf30.hostedemail.com (Postfix) with ESMTP id A604B8000D for ; Wed, 19 Apr 2023 14:10:48 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf30.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913448; 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; bh=JN1Y2bvJVpq6/q4dmcPnKZ0rBsOm/7Q8Ad5f4nAyRoc=; b=8ksO9kgtIx4/LLQ944uv3+R5sZEhGNkrPVmUYqHIpf0MNVtGq8LL4Et8IN5Tt2A0P2fV4N nWrziOJ6/bhIfmaSqWHjIOfVgyzfugwtE62UV/WH6d+oTb8HY2bhTXiw36tmXyDu8GgGW/ rhQUWR4AIwM4BSCFNMP7+zO0WGDiSGY= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf30.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913448; a=rsa-sha256; cv=none; b=LQ9QhB5beH+wi8rxlBWD4anYcGO8flXHWkBPq14lBASUwMy5RDuy05O/x1t9YFPzgGyunV Ga6WF5LtPCxTyYLtaTeXJ0TFuAQvoGjWkXkq5dV5Lq0j47DML2Ogu17TeMTd6VklVOpwEq BOPGrhrk4gD6xJCIbxF09dHM/lkB0+E= Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-2f27a9c7970so3015540f8f.2 for ; Wed, 19 Apr 2023 07:10:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913447; x=1684505447; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JN1Y2bvJVpq6/q4dmcPnKZ0rBsOm/7Q8Ad5f4nAyRoc=; b=RfofQquL01IG0dPCkrr+eIPV0z5eqbe3quhgrnMf10rvCUFu9/HT0334cOWwLIGo82 DVmQNjd2KYUdxxow29hNlo0FxxqDOUYGkpzV7TfIILKQn0/43LAhWgEhJX/JBFjipKvK H4agat4MyMo3TwFTv2BAs+uBQItI61DicB5BgeJ87aGyfxTPaPlxrzF/8EEEUdkHyIaW gKR77tT7RQqJkXXLf2cnxRxn2Nqzc4X3Oy5PCbyJMMt9EtNCYQxvGhkuRbW+PIQZFjMJ S2yzmI72haQtJNCyyYGFur/4TM6Oc8cfECvrzd5dNuH6JoLCVhzvmBgnp/k0tXuUWhm0 IEGA== X-Gm-Message-State: AAQBX9dFuPmOB3dwHKFNGHfGCMBl202YRNpAO11tIlLBBEdEjGXmZxUC alguhXL/fiTHubYsSG7sEw8= X-Google-Smtp-Source: AKy350Y02nCXtd9Ex2dTiMUqdMuZubY7+g/E9AAW5VIMPA7K0NU5P6NletE91Ad3MZoVtt3NEzGYVg== X-Received: by 2002:a5d:5546:0:b0:2f6:8ca4:a71e with SMTP id g6-20020a5d5546000000b002f68ca4a71emr4777763wrw.52.1681913447180; Wed, 19 Apr 2023 07:10:47 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:46 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 12/19] zonefs: use __bio_add_page for adding single page to bio Date: Wed, 19 Apr 2023 16:09:22 +0200 Message-Id: <20230419140929.5924-13-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A604B8000D X-Stat-Signature: 3t8xasf9iym5f4pq4cj94qf3bfyzijdx X-Rspam-User: X-HE-Tag: 1681913448-901154 X-HE-Meta: U2FsdGVkX1+1T37M1pH3sc+G4zvLVIp4bHe1DuRXOXrdECxtOpm7RQiuL0KZpWLd1n2+C/HEOhSDeJ5YlA3CKUMes4/lW7CrUC3bLEgRmpg6KT+8VwEpBJHyWGog//+SmP90kE+zBfqED68WrKzxPnBDI9u8NGlUHgNIAdzb/wsVcGr1eac2QWbBNu4UZX64HlwaOMHhrszDtQfErBqxNgtq7PNJLGWiHj5RtWTSGcRRid2LMddkYH6Uhe1lli1Aa/EmV06teHep+443RU5x9/J2lmPwrqKAhBNrgnDNgawPWRDshqPt5e25fEnzpLRl2fgrUYFiFW8j/7iQR+qdf71esDaeQrh1NpNMqwltH9WP7Cu7w6vSZdKs/CKqyMlhmkWiR+Oezlu+ufkDqq4WeXphOKnGYNbVFJux0KW2cbQEqfYcQhYDiPOd5qMi0m/CI6h6Tn8ETjbVC2X3RrIJlGx1nMV1P8r9u52k9uFRnZCo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ho54oOQ1SJIvLOtizUg1hr 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: From: Johannes Thumshirn The zonefs superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Acked-by: Damien Le Moal --- fs/zonefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 23b8b299c64e..9350221abfc5 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -1128,7 +1128,7 @@ static int zonefs_read_super(struct super_block *sb) bio_init(&bio, sb->s_bdev, &bio_vec, 1, REQ_OP_READ); bio.bi_iter.bi_sector = 0; - bio_add_page(&bio, page, PAGE_SIZE, 0); + __bio_add_page(&bio, page, PAGE_SIZE, 0); ret = submit_bio_wait(&bio); if (ret) From patchwork Wed Apr 19 14:09: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: 13216883 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 C37D1C77B7F for ; Wed, 19 Apr 2023 14:10:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D07D090000B; Wed, 19 Apr 2023 10:10:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C92F7900007; Wed, 19 Apr 2023 10:10:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABBBB90000B; Wed, 19 Apr 2023 10:10:52 -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 97B2E900007 for ; Wed, 19 Apr 2023 10:10:52 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2FB47C02AF for ; Wed, 19 Apr 2023 14:10:52 +0000 (UTC) X-FDA: 80698326744.12.F71BFAF Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf19.hostedemail.com (Postfix) with ESMTP id 60E8E1A001B for ; Wed, 19 Apr 2023 14:10:50 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf19.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913450; 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; bh=D58hy5/Cr3/DLqz8bPLF+cijdU1EeyUsaB6+w7+K1A4=; b=lRapsg9ZCdNToltvIb3vlRpCA5KQlkVH622xmh4M8qJqlxlBeXkwhuyc/II4NBnUZHSIHZ Or/OjwGLPWWdKy7sjkjzaWjMY88ONqWbDNzcI3P7R+9ryQ9fa+VQEYilqpl4iwyW8By+Uh y4FRyQh9VDhQ5+GmfXC6uAPpDlLzFek= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf19.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913450; a=rsa-sha256; cv=none; b=KI9bCZ/puQckSO6WXiC1sgcpMHM9yz72APgOSKTQ5ta+ncvtn8UnaoFiHgg5VhlqZioUZt 854KyU+Ym6ekc31nFS5stmtOUBjvwfnfzVHjuxrkSCuk6AxeoIgpfnfBVc36912g1KpnIj nxd/UkV0gqEgbKYI08L2PxkyORzIXmQ= Received: by mail-wm1-f46.google.com with SMTP id v3so4151997wml.0 for ; Wed, 19 Apr 2023 07:10:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913449; x=1684505449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D58hy5/Cr3/DLqz8bPLF+cijdU1EeyUsaB6+w7+K1A4=; b=KyZFjft5IgW7GpZ1Z+0LQP7QI5gYa8ptCzWHBLCjyBJnfIeAwIex3lMSlDUc6SrEx2 YFja9yhiCpgS0SVSczkt8v7VLIjUNlWxxQwzT6/NeqIh5CJ5zPmA1EBL0bjAd8eiWwcU 9uto8rtZ+iF1SzPWHWH+WgC8PG9qRVZa2OoaHFrC/LXlx/avf32aY2QiQjOSXeRntfYR DVXEQN0gBH12eRD9ZJjkS+24ZgOgBNlvFp/HSHCRxFTjEIxO4lX7eR7BMaOz0IPW6Ugf Bcd0mowVvPxs25XL3hfLQ7qbVYRC5gNQHpk7EJyxvurqvQWfhCHQDMdnZEeQBcnrdWup +fVg== X-Gm-Message-State: AAQBX9eSIVgoWb0tYrmDyboDIc4PepDhmNwKONkgatUFbFHwV+m2P7WJ hXyMofpPVxNHN4f3gXmeNR0= X-Google-Smtp-Source: AKy350YVGom4jRqLlz1SlZT1B3VxAH80TCdfTvTrIcrTBS48HRxL8jnx3ehntNMClr8C3qNVzqHCog== X-Received: by 2002:a05:600c:24d:b0:3f0:373d:780 with SMTP id 13-20020a05600c024d00b003f0373d0780mr16769739wmj.34.1681913448956; Wed, 19 Apr 2023 07:10:48 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:48 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 13/19] zram: use __bio_add_page for adding single page to bio Date: Wed, 19 Apr 2023 16:09:23 +0200 Message-Id: <20230419140929.5924-14-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 60E8E1A001B X-Rspam-User: X-Stat-Signature: kubytf3bptabezo1bee78ne9fbjsfhbx X-HE-Tag: 1681913450-80085 X-HE-Meta: U2FsdGVkX19r7fRKqWfovaBsK7LZ2+in4e1i/WlQtNO+r/ECvizCwUmCa5zNtDkuioxjW7UI3It406shpC8IJLa0inqA+5NVkrO5QFudGXB9+IZsjoEiJ5GJxEQzQ0T4jNwNJi9MC/Bffhej6DC/AVA9fsATI5JynMeqll2PbGyeJI07ey2WHmCjfJKyg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tF8nX4LAG1z7hS3+5jFczxK9R0OZGtaW/q0i97jrzl/C68Y1ajfg1q4cC8l1BBD2Q2Z5AA9vFgk9QBUkcEuSkAGLRJB+cOHkgbEdkfPtb/YBXw8WwKeFBEiNK7WqW60yGEGLe/841P4Q9/COYcVw1URNH6ZVuhbcBohdcMb99p0tP4dUzKqi5Mv/iX4Tl1N+V28s7UX8H5l/fn+vV+aGBDFfXWybm1MJVSAX4tNBRCNr0hYjzn9UGyqHjSxRt7RtSkbtKn73iDvq2nCgxHAAVnsECpoAXQ0cM8tD6/ewQLoImEBAI26VcC2N5EKjpjH 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: From: Johannes Thumshirn The zram writeback code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index aa490da3cef2..9179bd0f248c 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -760,7 +760,7 @@ static ssize_t writeback_store(struct device *dev, REQ_OP_WRITE | REQ_SYNC); bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); - bio_add_page(&bio, bvec.bv_page, bvec.bv_len, + __bio_add_page(&bio, bvec.bv_page, bvec.bv_len, bvec.bv_offset); /* * XXX: A single page IO would be inefficient for write From patchwork Wed Apr 19 14:09:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216884 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 60FDDC77B73 for ; Wed, 19 Apr 2023 14:10:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9CEB90000C; Wed, 19 Apr 2023 10:10:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D1A6900007; Wed, 19 Apr 2023 10:10:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84BC390000C; Wed, 19 Apr 2023 10:10:54 -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 71118900007 for ; Wed, 19 Apr 2023 10:10:54 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 15713A02E8 for ; Wed, 19 Apr 2023 14:10:54 +0000 (UTC) X-FDA: 80698326828.17.00A9780 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by imf29.hostedemail.com (Postfix) with ESMTP id 43110120010 for ; Wed, 19 Apr 2023 14:10:51 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913452; 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; bh=KLQcibH4QQVSvQQ/bVwiqZIZ4Gz6ywI38VTMDoqxjbc=; b=VEDRDoDTUPj8qTcnOMqFBc6oNzCljMpY9Qww7wi7CfCf1li49UiqKiyP8QKY7SICsjtyJ5 sYtfvPNA/Z6k4bOIWZizh9xAvhXcaqhBz3IefH1ljZXVI2At6+y9o4jq5B3P8a+AYlo8PA ErBtC5aYx22QmdE3ZfXRa0WH74aCuIU= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913452; a=rsa-sha256; cv=none; b=UGcqaKbfQZZIJdZpeJj1JaBePNILWHtewCZ2v7+LkTo8cDlkTfGdxp1BispYoLQZuakzNs chdtNzkqUxA0xhs+x4MbnSjLN8zC8py0GXrWx2DymueZ/LbyYaTh6slFzu0EHlzl2BSW/B 0CSD8OUKZVLGDFenhHtPeFPPZTFP31k= Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-2f9b9aa9d75so1759495f8f.0 for ; Wed, 19 Apr 2023 07:10:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913451; x=1684505451; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KLQcibH4QQVSvQQ/bVwiqZIZ4Gz6ywI38VTMDoqxjbc=; b=kCNzm2TfTHTszfPv6TaCA9a8W222u9+0fWA0U9bHPYCiOzBhHC+pd5Vy2HVr+e0/51 0Yr/GPB1IRrjTNRiG74EK7Ag6iGNhIBUf1PJ6bTE7o2Yh/QdK42ynsqixm5zB8phknFY 1gW3Z/qFNwi09cCUJO/RSSC1TEM7bAB4VnQetYINQ8LUwTucD2ouQlx9UU9935kJAfR0 OKo1m02HpO5dI5HixaHX0i2y/7EuA/0/RnqxVEPYZ5P3xzPSpFl9KWJk1CMp8u+bba1D 8J7PPoEPLmDkGZlEU0aoGccIMCCQju8Kf5/tcwFdqXp2r1/u0ilHvNdffJpamOMH1RP5 H1dg== X-Gm-Message-State: AAQBX9cqChB73ZF7NNfBilspPrpKXmQI2HWv2Abk4DJMiXX3RuZnwk3+ ih+nN3vICMA3fzHLyCq/0Ms= X-Google-Smtp-Source: AKy350a8pHXX4xoTqjmCp8VzLpP9Mr6nWBR11mzOBYZ2TpzRIUZcgG4OmK15TMBBeqCZ8wsfO4biJw== X-Received: by 2002:adf:df05:0:b0:2ce:9d06:58c6 with SMTP id y5-20020adfdf05000000b002ce9d0658c6mr4762888wrl.53.1681913450788; Wed, 19 Apr 2023 07:10:50 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:49 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 14/19] floppy: use __bio_add_page for adding single page to bio Date: Wed, 19 Apr 2023 16:09:24 +0200 Message-Id: <20230419140929.5924-15-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 5bkxjsqixpjeu5jqtqsonipgjd5xpr9j X-Rspamd-Queue-Id: 43110120010 X-HE-Tag: 1681913451-823519 X-HE-Meta: U2FsdGVkX18G2sF2Bo8gJm2gmkLodshJo8iFUmurQTViWkxN1MS57DEpAWFCZq0nL2zn7qL1Ae0gPXUVnMhbgUhJxxKArZ9PxGQf6FnrZMZlHjP4h+ICGir0KNC5UcuOQ7dyzAgo94mYpKWJ7c2W0j103pnYdUOQ93dInOvkR2cn1Wk5o5BsU6l5F5J9ATMpXqwcGr7NFQPtIN0zLNAIb6nobsE42KoWg3e4BzmBpkJPDf62DOux9XoyI2QQ124OVfCS3TZd0c++Cd+PHm9auln546499ouMScPsdaoHhcpnUHT4v3TszFPkxn5Mojqvm2kgWzyvF5En0IX7mZeDlVl1xLsUB+SLZM4+LIXPTEkrU2shOfWN/fjUviCHgz+iDSeGFUgeZMs/Z1h7QrRnBsNbc0LAzSoXGEyuywq6U2WTJmWMpa/gjP3MmxrcTc3+PVji5EBIdEXdSz3vZTCjK/6oDTSvhkHBP9KEsd3Ef7Zg/yg3nYFtnDlOYL7SlQ/W7HnFNSMEaXhTXF3N/QjXKzgNVtWH1leKXzKhlU3mzW2CbMxaPuXZsD6gimAELc9G+jqRDzyFBoewwQxSHn5++U7FxttMI2/Cg/w0/YnXELkWKHVGX9xD9NWpaxy2HRx+cK28CUvlVWvGQWGMtshLiwAzpcUbMIX+sWbNGcWOSNAOfNIgBmI9RGqT7IH5ouKTI9vCjqzHDpXYgc7cquiSQhIF6nbUH8r8G8D+gPrc6v/fWKL0GHNrevCdoYgUXfFxACnIGj6ZSSdRLFjcxMNVcuyxgxnZzYRhF5VT1OhJGu1/ShMlKCBi979ZoOCoF9jOY1tUydYWR3DxVcEwDoMVZoONt669k1ktVzDsPzRXsjW77AMLXd9RT34HnjEzkMGHAKJoIp+iGV9IY4JAwRLKLMMd4MjqTqgpiusGIA5PAUgNJLtce5sY5tNJuQhMMHVVHmYcXv8xdC0tfETKO2v PdUk8O2D Jaq3E95ehSqvPIhc4R1PuC48cQlAOVOaJ2P0YB9edgAxFreSp5vBLJ/R28alfaD/0/SpdU4JAqrDsJ8ZNB0Chh5Xd4D87KMaUQmReQJWlL3Jg3yTYQl43h5i66ARH2Te8WWRp/FQu2a81CguNPwSido7li1REib6DTEyfJ5JojtXA2fJwR58N2achJx98j0wrYxHwfrzgylNqr1vvazzfJJ1JCuGvXsSFah0fqghfiMyzqJeX25DwjksPk9RzjYRsbw2L3yHPKRt2s4Ko7/xGA0zD++XG8MeO104+RCc38iOZwcEzxA29/1abh0i8EydE5DoWzkadLqRErV3+E//cmW5Sx46VU93iVc0i5jsEcz3bD+HZ72txVQ2b4U1JLnp+4/L0s+9Ur0xvYx/2S86dxpX6fZkXptflodBHsCc7IpHcmwIAkqKzec90DuYu3tE1nsnsD2/t9UQePuk1G5uVonjM4Pl+xaJcgF0W9N5TeGz26MmSlhwhcKyXR1bhaYHCmtSPmr3ctgysWhn5w7KqpItMYgNPtovMZeb1j/W/u7JXVmFZygIBMbgouH0hOfszT7J1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn The floppy code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/floppy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 487840e3564d..6f46a30f7c36 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4147,7 +4147,7 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) cbdata.drive = drive; bio_init(&bio, bdev, &bio_vec, 1, REQ_OP_READ); - bio_add_page(&bio, page, block_size(bdev), 0); + __bio_add_page(&bio, page, block_size(bdev), 0); bio.bi_iter.bi_sector = 0; bio.bi_flags |= (1 << BIO_QUIET); From patchwork Wed Apr 19 14:09:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216885 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 57E14C77B75 for ; Wed, 19 Apr 2023 14:10:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D5A8590000D; Wed, 19 Apr 2023 10:10:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB911900007; Wed, 19 Apr 2023 10:10:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A6FEC90000D; Wed, 19 Apr 2023 10:10:56 -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 8B5B2900007 for ; Wed, 19 Apr 2023 10:10:56 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 666311C60FA for ; Wed, 19 Apr 2023 14:10:56 +0000 (UTC) X-FDA: 80698326912.20.FF1107F Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by imf12.hostedemail.com (Postfix) with ESMTP id 827404000E for ; Wed, 19 Apr 2023 14:10:54 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf12.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913454; 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; bh=u8TpFiJZXriCSIuX4H6qm/DmnDRMN3dAYFyNsYcZw7Y=; b=5HFrYsMKCGfLjo4wyxqcyqQeT7SgIoeNcrVwNHIkOXAuhwjnZnlW3W7O4B5XuO1RZUlTCv 6jD3Ic7O0oJsKDRt8TKU+qYeBhqcixcUSWgb1+CWXSDzhql799DBsuutyyPwzY8C4yZ8wK UlGpWRKI4DGs21BSml72UahwWTm3iI4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf12.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913454; a=rsa-sha256; cv=none; b=KD9xNiPiCJFInYd08W7RrlhHLdstAHG7pFdf3FOkoFIX81lRHWA12lkiUqGp12WdZPIByk vJ4bYKOdS00eXtCPthd74lRSEAj9/wyKQIFJT+ZlAlNqu2BYbpIpWuBhp2IMztzIz2MyEs +Ygus3WgM7Uk5ty+OKYzXA+zyr1jrds= Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3f0a00a5880so21531905e9.0 for ; Wed, 19 Apr 2023 07:10:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913453; x=1684505453; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u8TpFiJZXriCSIuX4H6qm/DmnDRMN3dAYFyNsYcZw7Y=; b=IA//vZBmDzt/4gRGZ5sF7eT6nn2KkdeC96ACx0U135m7MPdLEjpjkX+jzGApIb9ksO B27ngJ7To3WazHhEF8cgNenJGAJrV94PXC0LRH88F3ZtkJbturL/bXrNOaOnbUtKqCGZ zwis8F4cA4MksoqG5ZPwaTsSjlTQQfdKoeWsw8968AAynR2YvOAum3+aauD9bdU5Q35M gaIJk9x9As4nOqAGuITKgb08lN7Rpbjg4JqSeSvSsmLAcpXrmhDh/z5UqZc3f5DByzrj v6nM/koLT9UiuCwgACyuxKgJmyZp/zvDKx8iGCoJUb6yYnI9wzHSP2v8fg7gx1dRwLxg OnKA== X-Gm-Message-State: AAQBX9dUeIZT0gS7xZVCbiE5sE5YbQcslLGhVqHZvLE2yUFYTFO2amIv WSDppYt1aXnUWp4ovm0EAMo= X-Google-Smtp-Source: AKy350YTktz+btoYf/lfmIpjxtv9Fic8XsjroznIk6ubZ5/gLPCuphxcjC60RHARQGdGgdBUYUfVfA== X-Received: by 2002:adf:e58a:0:b0:2ef:1c8c:1113 with SMTP id l10-20020adfe58a000000b002ef1c8c1113mr5538098wrm.9.1681913453067; Wed, 19 Apr 2023 07:10:53 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:52 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 15/19] md: check for failure when adding pages in alloc_behind_master_bio Date: Wed, 19 Apr 2023 16:09:25 +0200 Message-Id: <20230419140929.5924-16-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 827404000E X-Stat-Signature: kddj38c7j3px8s78xxgxetyhfa7mk6i6 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1681913454-473472 X-HE-Meta: U2FsdGVkX1/hr6Ra4g+ImCiiJMUIC963CjION+SCblygugvO0lM4ljPwU7pMzaCn2RWH+yAEuQs31CJqcHLqt86PjgRig8zQaktHH4FDS5RbNJ1KeLwFLWRGlOq3b5gH+4G/sYTjy48z3/trloWvdUAXz+09Yh4PbtLzW92Uz1B3mZ9ZRgYdNv7TX0FenIpfU6SDGlZ14Yu/PqxfIME23TxSb22z0rMWYkuXkNfgjjVN/rMQRWLTBA/wrX6oSqlZwRghgDCaCAjs5EW5IcmM226LP8UCSnzBPSrF7oAvxqUjBmacEFiKDlvBTShvGkz7t2NhEZQdML/DEjEsVYv1N74FKQAQuScojZjF4JK/t8CZZ36YhZOg01w4C0PWmPVrPFEx867BeQmT3z74wa5gl8M5BMazj680DfdD8ueZz1dJ1bvCWlI2/eN6WOEx1aranCmnD2LqUgtJvQ/N0M4I0peO/ZYgFW3W/rXDSjeKfuTovqmINsTr+KYs4ME/kF/bxOPk3dp0UETqo/V/w8ny6jSKlC8YzVTCDdGAZPn0qtbPfN8YnBxRZGBG3dqHwHAG/nW6E7e3xwCm0abOXj2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owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn alloc_behind_master_bio() can possibly add multiple pages to a bio, but it is not checking for the return value of bio_add_page() if adding really succeeded. Check if the page adding succeeded and if not bail out. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/raid1.c | 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 Wed Apr 19 14:09:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216886 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 02650C77B73 for ; Wed, 19 Apr 2023 14:10:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C061190000E; Wed, 19 Apr 2023 10:10:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B332A900007; Wed, 19 Apr 2023 10:10:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 939EB90000E; Wed, 19 Apr 2023 10:10:58 -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 77B6E900007 for ; Wed, 19 Apr 2023 10:10:58 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 45A2E8023D for ; Wed, 19 Apr 2023 14:10:58 +0000 (UTC) X-FDA: 80698326996.17.AFA8684 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by imf23.hostedemail.com (Postfix) with ESMTP id 51A2A140023 for ; Wed, 19 Apr 2023 14:10:56 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf23.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913456; 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; bh=6vsuN/DXTgv6nXT8tixf/9v37orpsS/ZRMb3IsbWCsU=; b=7d+WXMv60gvEhEXEQZkfUlhRb2rl/l3zfIJ3GETFNS1f3RJjedRVVtg8et1FIBfkvSDkgh X2OmaMfM9MRBpI7XbOUILmBNIvhkI1OlXqd26j/b+zYxGsigjNw6Fd+EHhzzuJYcG7iMFx PqotTYhv+VFitWbNmyT5BHCG5fL/eQc= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf23.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913456; a=rsa-sha256; cv=none; b=tQ7FuhkG22/VlwYt/k1UP/mqIHe6sdXj8mPDHUf+yrk+Y+ERLXXLgRnpVs3N7iPfoI4ic8 pctSLGtpbrlNJO2HUkn415XOIw8H9Rv3DLviyDCH7pmv/K4kxHITGvCXZlbLJjU+IwPGZP gLqFVMt4mSNKHSsa1yW72LyGKWk0ZD8= Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-2fe3fb8e2f7so703044f8f.0 for ; Wed, 19 Apr 2023 07:10:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913455; x=1684505455; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6vsuN/DXTgv6nXT8tixf/9v37orpsS/ZRMb3IsbWCsU=; b=ENddoXLv1aexguRl8hXvudT4O9GHqNWbZhwTDeNZZHChqlLx4ViOBpk9V4gVTvLvh9 JMJee+unBX5Rb+G+22wZp+Lu7DXbAnK48UfzM1z6t/GTbkZXDBBma6W6qNZyfZiLoVjS RSaD+t/9UVi2l9vLByu6naPQ1ED/Df4mUNF2BBzXUji5RnGLbkBW/dzkhk8WQZ7+w3df 6d1uSVxGdWhJh/IscNANq32L+WzATJIoTLgcOhGMEIrpjLptP0IIHfHWk0hGEuFk/wm4 FbqLoef7gaYfjQB5JIDB6Fj6tqsI4rZZG5g+VO0N29XVPfP04IK8KeEKegCPHym1q4HA /U6w== X-Gm-Message-State: AAQBX9cIFvXOT4ZMCbm63qfWgrVAqXGx/+D/IikD6iBWJWreirMK3wtd jpG66HYlBgJChdGUUj9NqPA9J4/BLBOJItfk X-Google-Smtp-Source: AKy350ZtqTfiMh/3xTzWhxaqnfC6KE+V7qat1q3S3ZwFV6mDgq1XPDVNE2nS1h2LUGMDwyBUmS7crw== X-Received: by 2002:a5d:4a0b:0:b0:2fb:ca40:e42c with SMTP id m11-20020a5d4a0b000000b002fbca40e42cmr4564600wrq.6.1681913455062; Wed, 19 Apr 2023 07:10:55 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:54 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 16/19] md: raid1: use __bio_add_page for adding single page to bio Date: Wed, 19 Apr 2023 16:09:26 +0200 Message-Id: <20230419140929.5924-17-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 51A2A140023 X-Stat-Signature: wmzx1d99bwndgzb5jf769w1zjzhjkbt3 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1681913456-818385 X-HE-Meta: U2FsdGVkX19g9E8ko7X6y3gs9izBuM7fI9CqxtUY0dR8xp3upu809Xlcvf/Kz2aY0Ke24M7jWjdJhDz1DfI1rbeUwfCaaoeXuF7xlgl2BMXZPZP3ch+zjH5LNWo8e/x1SB5Nwi1/i+AeKzz5mjYPRsPN/fcOcPenc+Q4GLML48Njxg4bVVa1Lf4HW1hH8Ohwqd1odoNPRmVbR/J0dopXrtnT+nd9aSCj+T6TqGsdC7FHZ/EVV2ARRBoHIAuVJ4Oi97g91adMu8YiGa+ZL6Kj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ObFGNVD3UP8mN2Rh90Y772bGFEJVMl1coSpaOGSMLU0hFaVFYOlzJZlWa95aygSCcOQoI38w2IShEa+Bl30glPllSVIvEj2kBM4JyeMM9s5PbTSD2eWlmjA5TbDcyjAA65fI4X6xJf96zn4S4YBpJHJzi6TMQju2qnwZ4ec9M+lu3pUYbkqQSeJpAWW3jYKx720apJ7YgNtsndX6zdMJVDpumf2OdMDeCJgpU4tIS5AqJ36gbJMoppCyo4Rl5/K9gtwYgT/iznmYj8GNCNnCbs0r/tDviitSUr X-Bogosity: Ham, tests=bogofilter, spamicity=0.004579, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn The sync request code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/raid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 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 Wed Apr 19 14:09:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216887 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 B66B0C77B75 for ; Wed, 19 Apr 2023 14:11:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B328490000F; Wed, 19 Apr 2023 10:11:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A950C900007; Wed, 19 Apr 2023 10:11:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 90F9A90000F; Wed, 19 Apr 2023 10:11:00 -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 6D690900007 for ; Wed, 19 Apr 2023 10:11:00 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 356D5160171 for ; Wed, 19 Apr 2023 14:11:00 +0000 (UTC) X-FDA: 80698327080.25.51BB02D Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by imf30.hostedemail.com (Postfix) with ESMTP id 18DC080012 for ; Wed, 19 Apr 2023 14:10:57 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf30.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913458; 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; bh=C0hLQVWAy93GtM7oc6TpMOtkbIMql7YOXfxv+ovXyBI=; b=0HuJug44moPVXhOGWK7oeEcX09Z7e3ryhhMYLtTKGNOu3mG4F8n9AwW0iMnpBE5uOZfilk ag4HgDZQ80jBIXe3Lqe5Mr28N154eLQPq42W8dezwvm1fsCQ9JCAop6ZpS/qcuO617zXBw vBcbnbR96C/i43fNACowcp+EBMM9N9Q= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf30.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913458; a=rsa-sha256; cv=none; b=dGY/ux0QO9qZz5pd4KRd7y8sAysQ28ge6XQA6iZsKVz2XFTlWVfpTrMTFoF1m85HZWDVzx 5FevekhjuIM07wonw55NdZFUl1PpzLyMavYU57n5gsoz+ex3x9XulrwrJLMmVxhvUzZbw6 LccnnqQC+g0uz2J2DUvrD6qwFeXTbkk= Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-2fe3fb8e2f7so703059f8f.0 for ; Wed, 19 Apr 2023 07:10:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913457; x=1684505457; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C0hLQVWAy93GtM7oc6TpMOtkbIMql7YOXfxv+ovXyBI=; b=LKtRs68TwmfiEXFcb8UYvhBT6AQ0oxPloCKvnL0Pv/HA5F+poePAroEfe3HdEc6DVZ YOVxWl9hYyoSdLKqPPn+V7hvY5Lc6ItLC1I3JovGJzKMNSmlj9cBKZq5LEXcMKdzZHgS NM1dJfAdEK9KXJEFK50CppJ3A9Pl8dXmSIbK+k7j3B5pMIwUfp5FoIxZaBOHun7aF4da Bp7ibn5MEKmvjEVg/8CLet+7mv2ihG8rX6qJ4Q1J+wXCXX52Ki5cBcM7U9edhsKMUOZI 7dCe/uskKlGpVCiMaClAolKzOGUWQgBcJe+AKDxG0eoSIHqb4/MMY/sCc4m60OK9Fr8s N2uA== X-Gm-Message-State: AAQBX9flCKqWxGAh/TdAFPWgmqU+L6eXJMMxw7zGcH9FxNAlPWhV25c/ 3dZm+LMaej7eQeWjehhX+q4= X-Google-Smtp-Source: AKy350aVLE+txxcZm9LeX2yItutcTFI6YYsrFgCoIWHLD8EDS9H+yj3niCnWRjhD3VeCviDrTQZ6vw== X-Received: by 2002:a05:6000:1a47:b0:2ce:d84d:388f with SMTP id t7-20020a0560001a4700b002ced84d388fmr5447194wry.40.1681913456733; Wed, 19 Apr 2023 07:10:56 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:56 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 17/19] md: raid1: check if adding pages to resync bio fails Date: Wed, 19 Apr 2023 16:09:27 +0200 Message-Id: <20230419140929.5924-18-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 18DC080012 X-Stat-Signature: 4mh4zz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acYgq1hzzo8lN6EziDQftK/6V6XP21znhkrcNwww1MqhXKvU9p0BpC6gmww4wNN+aed3jKS42rrsXxQhmmp0+e5AVp533FOIbjLjKaat163zNTH7o+DP045d7iGflFl109alQxtpcZuaqSkThYER/qI2ISSsYX4NdzzD7fUAPcRa99LAqFiqz68dGuDPjVrbfUVOySeYOWBe9y6o91kVjwbdzyidpxHouMaE8IfZKokU0XlhoS3CWZLCDimBECQPUU3C+z7CgSuW4MZlrxUyTVA/rJSi+0+aZoq4VGyOsKIUUXgRpKnzEE40E2NFoaZsGD63gl5SBJkEVohwTLfgomwcBTGc+ToZg9O67/TNjWV8caB7yv3T7ogo+nfgXIOOWA4h+RrUscRRcuQOuZNo20YLJC6ELmupiPLuHsVVvK6GCtvkUxUIOAzee16ShvcTmfP0moy7XrDj+glU7AwlTKfTcbMi0U25LKvmFStFYJUvP0otm1ldCWRpQiOpMNaYIZd+vkA== 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: From: Johannes Thumshirn Check if adding pages to resync bio fails and if bail out. As the comment above suggests this cannot happen, WARN if it actually happens. This way we can mark bio_add_pages as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- 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 6c66357f92f5..59e52cf01569 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3804,11 +3804,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; @@ -4985,11 +4985,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 Wed Apr 19 14:09:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216888 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 874FDC6FD18 for ; Wed, 19 Apr 2023 14:11:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0FE43900010; Wed, 19 Apr 2023 10:11:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EDB00900007; Wed, 19 Apr 2023 10:11:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D7C9B900010; Wed, 19 Apr 2023 10:11:01 -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 B7D6B900007 for ; Wed, 19 Apr 2023 10:11:01 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7E2D81C5F7C for ; Wed, 19 Apr 2023 14:11:01 +0000 (UTC) X-FDA: 80698327122.04.6EAA1C6 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by imf21.hostedemail.com (Postfix) with ESMTP id A1A931C001D for ; Wed, 19 Apr 2023 14:10:59 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913459; 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; bh=/zlw+dyGlfnLYWyTWZyG7072cksvgegzTzOhlPnlIpY=; b=WpwGRRl/2eJ6bZ5yDs6WwgsWfsPDu3q+czJoVq+qHYkEojf/v0/MYb2+3lQje3aMFO+GPm rrFJgCTN8l8b8PeQjoLqNlHKxc5VJyExDRqfWUEMvI7rVMoZlrXnuxseRcKci+VcqdzKrg 9FqVtWtsGjbU09XUGqasA3G+LQuOFKM= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913459; a=rsa-sha256; cv=none; b=yj40bm8h99ntqmcfJJcow2qfQRfwBn6XiwDh+L1AgXAiphkMwe97eGB6/iuTt4Fgm0fifn uaKOcJA8KYrd95VVLKbo44lbsxfrXIVweuRlQnfxVr53qJtBnXAXGi5k4Pbfa3Ouq3zaZP UIlzf3iia7/1oG046X19pBzzLfbHGRU= Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-2f55ffdbaedso2092638f8f.2 for ; Wed, 19 Apr 2023 07:10:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913458; x=1684505458; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/zlw+dyGlfnLYWyTWZyG7072cksvgegzTzOhlPnlIpY=; b=OHd6A3VeS3fuYmak13O4lmKMp8LE/5Qx/l40LG+BFSvJu8Q14YgYxrICc4BkuTylc0 hLTSHvF4URuwCxwUulbySSoaWu0lj8gAmFWV30H07CosSubKYR2mQh7AY/ZQm107O05y qaWTYBhKbGrdwCVKBq+/uC3X9Wg1kAegcb1lAd3plB4v4j8t72Gc4rDJ6oAYPgTl3K10 Nyuw8yKAZfI1cjQfaLs6HFh+8XejNVGKtu6g+jdtVQfcA3xyL+4/W7C8m8AsEwmkcldR Y97JB9XLlEDAUrYckZ1b72jv+lixfcxj2ekoJPzUjudkFNW8r+kt9NXPbx8w+1wHWKsP Mv4g== X-Gm-Message-State: AAQBX9fe28gQ0bxjgrVMj+P+ATlUbfdQyQHx6+ymZCKSGTZYBU+z7TaO +0cVGjGROueTPhx2B8h8W6I= X-Google-Smtp-Source: AKy350ZBtxc/TGFor4lepp28gxjzMLtfR2kXHzHsofIAAqDJVDxt5jCQYZANHY4xZIooK/Ogo3z5tA== X-Received: by 2002:adf:f84c:0:b0:2f5:d0f:744a with SMTP id d12-20020adff84c000000b002f50d0f744amr4499259wrq.12.1681913458339; Wed, 19 Apr 2023 07:10:58 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:57 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 18/19] dm-crypt: check if adding pages to clone bio fails Date: Wed, 19 Apr 2023 16:09:28 +0200 Message-Id: <20230419140929.5924-19-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Stat-Signature: mrsz33zix518u8mx9sn3c6ziqbgou79x X-Rspam-User: X-Rspamd-Queue-Id: A1A931C001D X-Rspamd-Server: rspam06 X-HE-Tag: 1681913459-260574 X-HE-Meta: U2FsdGVkX1+Z+oEWWxhCdrlcCL48DS3SScPwqhYy14WlfbA2rbM2ne45wS/1KWUMPJ7M6YiuC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mih0XkefHrUaUIyCVjtuWzh+NtYH7Ius1cdn/elh7+CpxbPOBLTdSn9r/p1nDdqRsCy1G+DScTc0izNLkYjjOAVfNTc6oyeMZVYW4YoNkf8RctENp7zymliYmGWxwpdcpObKZfyWCM5gRK2Tq8TYhzGqzz0C/IBNlzYGsiOShj/tAhrLz535OmsfDyn4DQvJEMev6YomlNCmknGfXkbhDMSGTli+/O3lLJd11cfpBC1ri77fx5Sfns0dQia5IyM/CC6aPNc9/IDWy5ojOADg+skCXPAOHcAWNUN2PPQorpRxGNC+14x3odGGRssBakTUEFwOmXs0dxH34Fr7gA+fyLJbP4Mp1nrWtriceWyOxHaR66ekk0lOqjHTdpcfd/oqlOfb0+gVUlxXmcOpbBUxmZVk7x4A== 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: From: Johannes Thumshirn Check if adding pages to clone bio fails and if it does retry with reclaim. This mirrors the behaviour of page allocation in crypt_alloc_buffer(). This way we can mark bio_add_pages as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/dm-crypt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 3ba53dc3cc3f..19f7e087c6df 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1693,7 +1693,14 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned int size) len = (remaining_size > PAGE_SIZE) ? PAGE_SIZE : remaining_size; - bio_add_page(clone, page, len, 0); + if (!bio_add_page(clone, page, len, 0)) { + mempool_free(page, &cc->page_pool); + crypt_free_buffer_pages(cc, clone); + bio_put(clone); + gfp_mask |= __GFP_DIRECT_RECLAIM; + goto retry; + + } remaining_size -= len; } From patchwork Wed Apr 19 14:09:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216889 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 401BBC77B7F for ; Wed, 19 Apr 2023 14:11:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20D8B900011; Wed, 19 Apr 2023 10:11:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 083DA900007; Wed, 19 Apr 2023 10:11:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5859900011; Wed, 19 Apr 2023 10:11:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B286D900007 for ; Wed, 19 Apr 2023 10:11:03 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5C410A02ED for ; Wed, 19 Apr 2023 14:11:03 +0000 (UTC) X-FDA: 80698327206.17.59500CA Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by imf19.hostedemail.com (Postfix) with ESMTP id 6F47D1A001C for ; Wed, 19 Apr 2023 14:11:01 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913461; a=rsa-sha256; cv=none; b=o5wr6U/Z7Q5Vi6FNMWnfdOHQTKf/X6R4yBrcAqQp14+08MjbZteDhd5l2CXesOzobK6Kcj Vd8sayALxYFvVeT21ubW5B4XftB8e8r5pOFXnFIu7WviC+5Sk07R00/OFJp4cojgpsF3rq b7cTdMOSN7OKZd17aLh8Moq2srwtFQI= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913461; 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; bh=ExnlLXqiP3hLS8bpFiqaYIxJLAKQF5DCX5VPxtSPsPo=; b=pkyuR3n/cyAOLcSl0r3ppQzVHmYtNk950cm6kjABL5SifolXSHKA6z0+BPhS0JcvO670Fa mQ8o4dXeS6EnnbnkGSBFttdPbFbjfZn6ASIg3s+ic8nYAR/7F8shGT+s8OuA5tFJkgt99S KAfQQir8Utt5fe5AHv/4ciUvoVfs2K0= Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-3f17b967bfbso33329185e9.1 for ; Wed, 19 Apr 2023 07:11:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913460; x=1684505460; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ExnlLXqiP3hLS8bpFiqaYIxJLAKQF5DCX5VPxtSPsPo=; b=f5IchQJwtDyK4Ob9oDgBSnv/yuOTNaWLdHPFIXW98CTlvddUbIJGqraDRBZJ+lM8Xx 1QoQQXI4ATFYi+hotajwnrNFJnTDS3ptl2XB7m+tUdrNE2wF7/wMZYAI+V36bwA1CZqu dAxGX1/8D1P0ySE3MenntUdPw99i/oARI7DD/NEyYMB7YqjOJlk5ZHctQdzayUKj7TVI jWUC7nyjx+9xqMpOsgozRxlodiKSMVi6Biebr2fr92vNRARVzvKlYOBWk0fSupiVe2F6 qpO1ysaGNABhzX+/gyRB2yWhXmAmnBeIX+8sAbQqgzckGLtl2Ey9GO8QDn4qpxgyqtVd UHZA== X-Gm-Message-State: AAQBX9eZnNWG8Hus/bC/KpVQXmBvx4bbs84ucTEvFKMNekeV23uuRPtF Gv7GImuafe8Rh8nY/E0hNb8= X-Google-Smtp-Source: AKy350a8brYKmUYvrzlJUafn/qJwxJEsZNYSYhzDz8VqjHAs/A8j+oRFG+qGVgXdrE5NcZ5HHKx+1Q== X-Received: by 2002:adf:f111:0:b0:2fa:2f1e:c1a8 with SMTP id r17-20020adff111000000b002fa2f1ec1a8mr2109123wro.3.1681913460203; Wed, 19 Apr 2023 07:11:00 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:59 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 19/19] block: mark bio_add_page as __must_check Date: Wed, 19 Apr 2023 16:09:29 +0200 Message-Id: <20230419140929.5924-20-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 6F47D1A001C X-Rspamd-Server: rspam01 X-Stat-Signature: 4robdudtq4dw7554mji7um418ttopyz8 X-HE-Tag: 1681913461-600629 X-HE-Meta: U2FsdGVkX1/h5NvcqssmxKyyMudQ9FntuaTZb8Grwjsm9ItREELiD4RzFtQw3Cnl4jNwrsNHQgNvQphhzDEEZFROLrB6IBYjSeVLfArWi8tGh0GXPl37KkRWXGreDiLjlwL4sd0jpGJzhja+YMwLS4J5QGNCzq6unV6pP5i0hLTyavUgEpEpx0UurzeR1FJ0AylrYmBBwRIv3xCV224dBoGR8NBV90vt2rfGXCR9vbCHW2GLYYVFhFkBZ67Ptnwm9u/sRiDOxIy4d7plFaV39HsP0W/JgyIiYREcK5EsMjxnwjXifL/qw+O1Hsb0x/4jetqHK41blhY+WilDsPYs+KoWI3qdaOnqvAJRGC0+as8yLk6T08NoQoTZeRtCTL4iQy2GNGvLmgL1jJbZPSnqs2I3KHIGTDt4DUJru7OpHhTabKN68w7PxyFbUqPcTqhRDGHSF0gntrDueR1wXpNr4ZsR2BFvA1nj1zJ0DQFGsNOTY9ICt64O/RE4ZuA/0GhjShSlDRo71kL/fclaXoALH1u4Thp8/LK81Dfs9niCnMkNmMzbQvHa5CMsDDozZDoywhKjoOmEenUiENE7OSM6Tw6Xvrmy6fhR34dHjVLDPgsJWsgVN5vwOeZpUMLgOtauM+vIxZAmhuTNGpHhqWvFom4YhkSL3AWZTElwJD705bQzVu2vy8DYIO6RsBpeJ1V9fW+RbKGTy5cUvZkJLf1zu7RT6eNXrBdQ/MWzeIpLqTNFIJTxt7kwJAY+F/eoPmJSvulIrmK1V7dszjfZDqVeU+kiOt4OXw1p2cZeKKJ+3QoNgAkzf7TJOKX7UhP0mdTUJu4OsV1EVbdIYjXjD/i94Xv+1AzfnS8CCr/mj/e6lwpIUqArnnUyE/Y9GdFOs3y4xKFQB7divT1F1W785eVMecgLXUBKEWMiyiOtqwGEqpV5IEixDbARpzVHLuVaiIS5xlIjUfT9jxBrKJlSavy xuRkRXnN SycAXoWxk1PZDECN8/72ycGKId5IPyiFQ0SjszY+DitRK+akdgnaldUPDAu2a4kxQjl5z77DKmGMrhDSKlfdHfUGmkrnMQ2+pixsvdCdAWnjpzqZ7DD/HVuVq8qZIC+LgWo4OYimIsWJfRt4lDdeLrY98hhF7yvfvAyyWQu8m4kpbthQNFRUuss8kajPg13ewPgfBDdzg5ksF3gVt8b5Kzfd5yVh4k5Kf+prq0PMEe/10HgPL8uLyeG16rjdU3di1TWyFhhC5o8rgQGFb4EohU0IJgXLQcM//ke3cY8bafXFgEI7tpn1MqRMKs4p84HvXLvrp2GZwe2VuRgxG4sf2U6NYoTxv/zwlAl0ZXI6OBazwXkAyT7YSPYlgiWICF+OhEhMy2ptLeO53xUn5fO0OSUI9CCXIJyWmt2k4oMMmioVZPTBs8CXGQ/kLX0rAlKN2YapUanN0DAcLM+YP4q1/ee20ucc/LkzZkAdpz2966cQjUUznJi0hTR+2JmpSHZTiy2d0msbyWq5EFaa5plB0In/I72VQ+VdmPEisIHXbPH0Q/QAUCXXh8ajYOScjRKZ8/LnRgkmcFv9W0kulO3LKFR2w/roE40YqkQd2 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: From: Johannes Thumshirn Now that all users of bio_add_page check for the return value, mark bio_add_page as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index d766be7152e1..0f8a8d7a6384 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -465,7 +465,7 @@ extern void bio_uninit(struct bio *); void bio_reset(struct bio *bio, struct block_device *bdev, blk_opf_t opf); void bio_chain(struct bio *, struct bio *); -int bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); +int __must_check bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); bool bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int);