From patchwork Wed Mar 29 17:05:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192950 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 24092C761AF for ; Wed, 29 Mar 2023 17:06:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE3576B0075; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A24316B007B; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84432900002; Wed, 29 Mar 2023 13:06:29 -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 63BE46B0075 for ; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4D80740D6A for ; Wed, 29 Mar 2023 17:06:28 +0000 (UTC) X-FDA: 80622564456.28.5AAA6F5 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf01.hostedemail.com (Postfix) with ESMTP id 24E9F40008 for ; Wed, 29 Mar 2023 17:06:24 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=FOvoXjEE; spf=pass (imf01.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109585; a=rsa-sha256; cv=none; b=plYzrfHttILBehINnTZoic/krgFnVrhe4bUiS7E51HWyhZepsBSLpxsDafLfStzXv2cvnu zzijlfrasPiUv7gyq42VyDB0y87Mok2fkyY9OG7hUEcmdTvuTweJZWpK13rwlWAsmx/+m6 pTgAxmnOCmQ9o61858zjaFclQitBYEw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=FOvoXjEE; spf=pass (imf01.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109585; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kKJBTmnd2YIfpjD3AfeOKUtgOUUgwb/dhMYX9hb9VBw=; b=dv3IUMXG7A9U4YbrSl62IdVOmlvpfan/N8yMRwKJQoiL05kDMEQV1+Eh1l/lwmOEXCxc4+ nLUsh2WZHS+L1A6HMOqtkvovSAIAZ1lq3IrwRCuYKbVAtEIeZKqtNagjhWCWP2mYuI/mEO t3r7pVEfYXE1j6b9VFSeVE7JewQH+UQ= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109585; x=1711645585; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TM7IBzNT7/14xTwowvJHPkTQX8VqnD9S2m9y/nmGXPw=; b=FOvoXjEEUoF40fdaIzr4vZil9HFAqgyRvmSfONY0u7aOkW1KVGxk13EV 7/eGgkJE8rvxyHsvKrq6HteXB1FPX518krpRcRgh8QU5Lo/BAIhZB0A40 WD4SEpSdFviwJ2QUZP66qX2UEOi2UgdFr3lLi1s5JZHxqvviAPOnekMjg shKLQ6k7MT3p5iKcWEfPew7OKsqSv5VKiagKneeAeEi6xzHEzQNzkrfnE 2H6AjpTm5HPsDWf6PBJlQ7y1FM/Nc5nXNBXuMLi4cHYU9SiltqvELc+As K+sd0AKC0Gx/aqo3jQzwvRw6X36OTi7F4zkJr+dQsEj7fcopSxKXCkwDQ g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807000" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:23 +0800 IronPort-SDR: TPUgnMOchQmOtIemMAJYeoaANbw3O85noVF4yU1XbOdGVws2IfjSvEVpse5iHayL5FJk3ZDTVn R4RiyZJdJVkAJhSqqkl1lYYxrwL0mjp9UG/IAuKBs/3UkwYgPsLAShHjaDff3DljP8G/e0qs3h YmsL2IQVYPx4D5Nsm1mRC1ibboufP6ZXkrRFlEBoGGzZ6X2PVl3u2ijGjUK7AQl44IwfKCQM3W TSCRpE5QJlob+bWuYc05Xw2kOlY6QPKgJgDwm0wNCFDKOzYedoqcc97DhiSigHOnLUOkx0gOpl WA0= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:33 -0700 IronPort-SDR: yyFKbwfOEl8vOCdlm8o/aBoXRqrxQAe/juUDniPmOyA6KC3OO/1kAhsEUEEYLVsoCPHg44tswf U4/t+Eht43hkaug7Qk7+EHXBNakm9gxNEJ3L7TUTHnO6hgxDZl9fUBGyLmIxwdFu7eEHUBHXpO mDw2lAW7wlIEhS9KYrLKfz7UOp4cFL6JpgENGlPck777d5NCTl/Xpkpz9Aa9Jk2kPk7WtKRS1c WhXighkZnqtO4Hr42uzllq0JA5rZq58zNcIHYGF/y9POF5WRGYiU4StYBbSKeJu9G4+2PBGJBo br4= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:22 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 01/19] swap: use __bio_add_page to add page to bio Date: Wed, 29 Mar 2023 10:05:47 -0700 Message-Id: <7849b142e073b20f033e5124a39080f59e5f19d2.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 24E9F40008 X-Rspamd-Server: rspam01 X-Stat-Signature: 4nj5d7mi574hj4f8cjd4owr8qioiog4x X-HE-Tag: 1680109584-181895 X-HE-Meta: U2FsdGVkX19oQj95qGPDkCiUY37WSCLk7SHI9otgVEey4u3essynB60xhjLAOjiEUaMvjNmxNLJ688pJM4x7QNsz+Gcnn7bGYJwvd3+ra4MniJqND6AIQID9qIa9fP92r9Vr6DWC0NGo2VBw4ab6ZljHwQrEDKcYKSbhfRw9BC2SuS9IZpw8pThp54JO6kBf4j7MokikRs3vu4kOh2L2fPPZuC6pahNWQebJsOgQ3Tz4CUfGxOAu6k7Tjfe5u5W9RJ2hWEJR4sX7/CArGgOzisF4nmXoTNw5qq96ru/dd6EYHKUiRvacjDjqsW3Ry9Y/QaRvyueD0YdNCC5UAzrXKdnUUO0xKLk0pHrBJHVpSbrF9o32S39qJ4ACdhm+bCXy/GY3E7s0vt8Jl3PBNv5J5Lc+0zyqlYROcWgfoWPpuD/85FH6gWf4bnNpDhIAgJdtESHyD9HhzrBvJb5xTfRovC8DUIsTZTm0zNmnguf6DdFSDvXSFuM/ODMxOCxXoPrFxD5AbVgmU+WzoymDCbI+ywcXpUMbKKcW4fiBq+MZ4eC6wSv3FwPA/61nVRU2lJrTFPytu0ZgJRtuaGPOuNRZI1nL7y9R5Zx458RuSlAa09i+XiR1w67L8BaD9MwumHiKOegDky5WUAkxYGPT9t4egq7gUUW9H0rJvc0pMfLvl5L0yMEL1fSRwKU2OyyLmllCF3Tgf4j7yVlv/S7HIIRs74fmZFW2WyzvpNWRp3OwRqm+t6CDB9mpIbJPCKLhJgEfP+Epplu72bkCS13zo4Wpe76t2p3LqsGAoajRh5nW464yDDuI0ywqvGRsHZapswXMBcg+UK5CKw3MUAj96B9FLalAJ3PzhI1uRYq+JHW3hY+9Mjuc7P1NpHj/cb9Moc6NSQdy+26FpKHJ4siUREPcXenMtZ3uqGW/7+USKD3p8BBhZT9wypyH2GKUb0do8NbB0kzfob+3IQuN1dAySmT nSwCsESB Fg80yCJaReP6/luqdWk6+DtbE+XLBylWRZiacUyarObhK9mb8QXkvMO8fhI0qVTxU6fZw/m82cLIh1wSxlPSjcc1/BMf75MJT17cqe4aJj7LcubNtKv5DGz3iarthTCNvBx/MZFZ7tyJMeRiK9fZldpyH3TOLgoM5dFUaM9SYTI+HDhPVihFDqMcFlHHFfKyUhORtuvfB5atTC7EOEMAUlbdW1lIaZmajP3bhFjzhKhmBOfXZh6QnJrftBuChLk9hxXNFcM97JHqOhicCp+W6wqzm5tPGnNIyCJo6IZgFxfxw9v4UnCe5pMg2Sx9KoB71fDQPTGECwoeLrcm/N3ZV9vhQVciXIQ92EiDTM5+v5FvpDvEDkPgX8JbPNNB6yV6PzVXJs5U9vVumP+7KuNeMk7idtQb4fX/95vSU X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The swap code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Pankaj Raghav --- 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 Mar 29 17:05:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7C1EC77B61 for ; Wed, 29 Mar 2023 17:06:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED60C6B0078; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5E8B900002; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C882A6B007E; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A16F96B0078 for ; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 816C7AC18F for ; Wed, 29 Mar 2023 17:06:29 +0000 (UTC) X-FDA: 80622564498.11.C505727 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 806541C0018 for ; Wed, 29 Mar 2023 17:06:27 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=T1fWwoaG; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109587; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XBVoGOaxFjX7F249TlpPBZ0ayzeIHnTslvlScVx5NcE=; b=zy97YMsGjiUF9m+mR7bq65oWeH0V7MIyLMJtz9EN0wcavIMETUjpeUt5lNlqoO84som3iB +IB28tegfO5LNPrgOznFQ+M0MEbHjihBq4ubVZ66EzdyIJZ7wu7C7Gu3KKUGnDT5eAIN9W J5cv6WAA+PyEiLUP+52ThAmWi40pmQU= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=T1fWwoaG; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109587; a=rsa-sha256; cv=none; b=Dri3Xe/wzkY0jWRqNCXJwcQ/KGfSGnS3fRQluPwLvgbt2oWGxynqm6Xsb/pXgL4ePlV6g2 x2dKW5kRu2m2PssETe/qe6JZ9zxAL7Oieb/ByoHOePCiipDg3yuYttTg8ZhuxNdFqmcIWu uEjRsk2V7bjALU9y61oKkjWPgeuzODY= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109587; x=1711645587; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=b2tfkQJHOoMo9xPMUAirVs15MwxpHItWsELh86gGl5g=; b=T1fWwoaGgBPETNaXBBMUA2zmRldhXq2nugPm+SjR9I4cUIdoBF7EH4oq VYBNlX2JgUb0fTSiyBbrp9UfynknhbvvUM8rJQkqg+QVqIr1muvUOxs8l D116NjjxGvEsq1c4z74meB5o+/f3NKnJYJ2g136FGxcOFllzY5MVapcHX x7d8WAExT3ZXOmwdNydXz+Y9pmw7UM2UO42zrR7pVTEevAQsVQDiukZuR 0WZMKmUFeyynQb9ktNrZaluPH9J4w1fJZwoH5pgTOSwRkXM54IifmHiby RJjrrHTw34dLM6Z8X2WBKAD+MYANZsJRe8wlyY5jQruU9eOCnVA99xYOm g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807010" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:26 +0800 IronPort-SDR: Vc6WtQuI/zHTDp0LCrbdADaGwmqp1eT56StGm5+eGY0trm5C8ads6Eoe+Wn4g4IXuFhw8t+eFQ w37aiF1+/oN6+KkfDM7ujxjhRniRDbziYqsaj4EG1jIRAH/1+KSd+grDSA4SUt2+3ODJlGy274 7QIUzjDcBRhYk/XthV9OyfBoxKTctXDr1cF1dmBzygG12gsjmAwrLbWoHQ1Jrmcdkk+0aHz/FB 381LYU12IJYMQ2uKNHQU4PvFWV4TJ5eizdv+sxr4+geWOTov2x5ApSYD/ecXcA5ODT1HrIfIwj tHs= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:36 -0700 IronPort-SDR: oN2UR0L9Ic/bC5ZlKdub2hL2B3WzSMNwWPaTts8Go9tRNUBzKiBjVMXtPb1MCBqH30XhfX5VFK r3o3y5lK4V0syF4FJkhuPmKVn0NSvYTqzCGIASu7aUGIjtgkWZfbeiTvlj5dp1GTJ+SAbWxEQ1 bH84aK1rLSnMEBKGsMwYaHXGhkfZPfTCuxZYs+HVziD2+k4Bdwtx3+/JcWFce+mApOYNcNV45r 3t5a5tYLJENitHpxBEddwdCKeyJVZy3OKiWBV7xOctdwFhAm4r3Z/fd+xkk6SD/0qdXQzGwmhy sn0= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:25 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 02/19] drbd: use __bio_add_page to add page to bio Date: Wed, 29 Mar 2023 10:05:48 -0700 Message-Id: <87d0bf7d65cb7c64a0010524e5b39466f2b79870.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 806541C0018 X-Stat-Signature: 1pdacbxw877ozy7zdh9qa4y8ubzjmwy9 X-Rspam-User: X-HE-Tag: 1680109587-765351 X-HE-Meta: U2FsdGVkX1/frrmu9Dovl2obtXxcJAzox+VvEDmmy94lFkkMsRA8akZTHJH8OZpMWglsXE3Y4Mi2lPI3nobQszSfsZSSODsFQ8DUn2EtScyagqJCLVYQALwZOpMXwUD9DmwQ6gVKXn8XB0aAtw86+aVJnN4cqsXAd+lVbn0JXpxxS4GTUxv9OTeTKwn2YIgGq5opz30pOPh2xf/3MrS2h4EJDqSuFMMWCPVPdmdo1zKG7mZq7SsyBYAg5wM0qYzvA+RFGJ2GzOgBk3DBgNIRKEdfgTGuU1OVnFEgYCyrk048P7+Y481cJLevKE7IFmbycUQeK+yi+9I3eavq9JaH4HFGSAB1YN1AxsiMU4YJVLldS15wVbOGZY57lt1AntgpC+/YYALC0te56R8ngkeigNoghBBxY3r1u4vZUxDp/ZCLTZTdIqD0T5wRSoYejkaF1qcygO290kYppLhN7kDxQPKPMwX3+gH4n5xllXY+v/qCOruqFFLtvaDP3nhD6kf5WKEeuj+g+bO7DHRMevWpYCJ1KI3UrSg8SPVr9Gsk++K747rNiHg/VpTdy8UUfw4V7Xad1xD+jApndLvIdm0/MtIRwVBWNI6FDCfxamzO6JrCD/2cnxkayQCYIanMdUtzDUj1gUkTAfGMM2Us4w8m/GnV77ViPp2S3Yrgjo0ydFKZgGITY8SyRrdgEff2Nmc6bDIhDfvUQCVZ+5GyNJBhmNoPBWcZBnta5eBE8IUVg9a1XO3f/8vz66SqcaAmsLgb+Y3VRG74soxlQDS9weibPCoeTpbeZgpFMFrb1sviC/dUibLhSOU2wYHM+ZJkfoh7FXvmUO4/XvV5EhTDY1/wz/z+CIysKj1YvVJTFRtMcGenH0eYtO3HZK8DVFz2VY2A289mU9gTvfTxsjHfSneClxusp8YmujPAklWvxE1D84Smsf6Q2nqVQUgq9pkcsJ1+FhMGTb+0cpdBf4OVMn5 NRM9Ivpa PAq1ApVmW2qYGP4z532s7k0rWGwMFYh3owUdlnWrZnNrCWwFPQw/OrB5jnXpPeasJQA0n7ot6E4X55JPmJVibNJEt318Y/IwRv9t4MNV5mmianTZJEj+CMPG8kAJyCVN8Wn2uXz/4nPuQ4P3rE9LsiK+Hak9W2VmC30bYTJCYKY/CGPP/b7KeQoY+fBoQRHf925quJgE8XDMTyXnCB+oVnr1nDV6iPMApEvptczerM5pbDmO9yVlOvFpanKuvfvh6gOFC0c4XWwZGzOsjBqAz5ys/2krJw2VC+oxVBA7FlhlKQk7XwkxBZQ/M9+m1LuD0X4/D4NXJxz0NVz6PslwyQIpPWzi9tsH8ufflzQWR7EItxrQzjA8swa8tYhlyt0+UPogEggVotU1yZXIvss0vHQ9i+4bEdS5kgdi/ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The drbd code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/drbd/drbd_bitmap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 289876ffbc31..c542dcf8c457 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1043,9 +1043,11 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO, &drbd_md_io_bio_set); bio->bi_iter.bi_sector = on_disk_sector; - /* bio_add_page of a single page to an empty bio will always succeed, - * according to api. Do we want to assert that? */ - bio_add_page(bio, page, len, 0); + /* + * __bio_add_page of a single page to an empty bio will always succeed, + * according to api. Do we want to assert that? + */ + __bio_add_page(bio, page, len, 0); bio->bi_private = ctx; bio->bi_end_io = drbd_bm_endio; From patchwork Wed Mar 29 17:05:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192952 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 7A095C6FD18 for ; Wed, 29 Mar 2023 17:06:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A19756B007B; Wed, 29 Mar 2023 13:06:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 954536B007D; Wed, 29 Mar 2023 13:06:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75ACC6B007E; Wed, 29 Mar 2023 13:06:32 -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 4E8356B007B for ; Wed, 29 Mar 2023 13:06:32 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 204A3A06DB for ; Wed, 29 Mar 2023 17:06:32 +0000 (UTC) X-FDA: 80622564624.09.33375ED Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id E6EDD1C0024 for ; Wed, 29 Mar 2023 17:06:29 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=DhrCeAwl; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109590; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Wr4TqYIoyZgSPEHCC6VAhbvy7XhcXyGwh96krkcqiG4=; b=qA6ga53UfzsJVJXxN2WteIYxZsrMajUmnesl/2eZ77xpf2IKdr7FG0V/qp0+Tmg5beFTeR dvbNkmGkK44UHY4rn1fmi6Ocr4Ctd14GJhV38FNQ5MOQIh6SY9KEGSOFaQnOmc0jJMsweE p0ryyGqu7oDf15aHFt7xA0znuVziy8g= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=DhrCeAwl; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109590; a=rsa-sha256; cv=none; b=gdgoQsbsFAYxOoVrCcKGYatXxFMWlJpp+92INbhArntqQaMdsW3iqs0dI6/83VRSS/gNAg Fp7ckfkmQibyC3m0sN/TOYypQt2WB4XJt3fqjNgNrvGt6yNj8s2/jfrKzKkuuYKikDl9vH aStmmK7Jtqy8hm0hNPQPkuuTrr1LNiI= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109589; x=1711645589; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KyIfu3zY47yLy6bRdPbtwNMrj/lN6bI3KAvSZ3cykmU=; b=DhrCeAwlS5eOC/gU8LIw0jtUsxlzZgf5uP/H5FAY2HmOxEdv0uvGNl3X p6NKSTB9s/nXiM4nX9eJZpX2kbOtzJFQiohB72QlZ6ie/JVNLE/f+hPB7 FOfCYBjOMsrgbMeKKl+IudKGpgvNmIg9O2Less4gjNlnGgil3yyGdBYqv vrAU5nzFQIZ/gk8HsEgeGUJtSg95jMcEAxa0DNWPezEeQVQnr779BKJ4N re8sN0QqTJdXMXtKo7bh24KpfYn00u1nynkfKnVeVVFZnnsq5bXDg8mrV LDS5tqNGAvBO3bPZAy1qtIVdMsvLHbaLxmtzG86ymbYDoHFlrCdECt3YR Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807019" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:29 +0800 IronPort-SDR: c3etZ7MhgFs8mtOozCTjnXDRxe20PffioaFS4a9g/EFYFscKvRO3SBHxxInnvBkDd6UCgaEXee gs4Tzr+oo0C/mLlqxgwRTsLNCzqMD/kmqVQ0IiKV5riGVrS49zsplN5lnPkpCOi7yyuEuhFAOu 1PEb4KXpoYv0qFOkc+CTRhNFh61Htg7/KO9gVvppqfeuAbNb7aWUHLxw7mNGVVyyvXV5pnK2Kj BJ6Dvm7zb+pVRkdCyp0LCl1tDMEgPqXE/J/nDO+0VHLs7BQN9A2Gk5P9be4uG28rGiTbhLgB+7 WRo= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:39 -0700 IronPort-SDR: 1njdf8/CpG2wu7Qu8ihT3x7xLc8wy22vSSqYOwPugiiyw2WXLX0xfwIb3ruUPKyie2J2TxJ6mO +mzM95UW16s8gPzsDG1+pgyKiYXVlP9/tknr6cMK/tmdwWp7FCAsb3dZSwA6t2tkrLYbMDJ4dl bgA4utwx7/yRV+ji/32tVB37ULrzfKvgsiu8yqho+w5+nRwPLVEASsAGm4YRFVvD4TrkbhHNYK 1UF/NdCIe6OXs5RI9Vq2tALxfVuzSQv5O5wnGhlKPenDTHlLVNZ37DGNgNgv7q9K0mL6gtkYkx JH4= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:28 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 03/19] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Wed, 29 Mar 2023 10:05:49 -0700 Message-Id: <4a2c46dc0e217a9fb6b9f32d460498a5feb8b67b.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E6EDD1C0024 X-Stat-Signature: cmmqas8z8r8ai9675kmrk7i8kuedn5rn X-Rspam-User: X-HE-Tag: 1680109589-806873 X-HE-Meta: U2FsdGVkX18ljIOPJbeNDTonEAed/TPI/ZWvkjNZexr+t3IZXG6OZldODbyAxU9oS3I3psIAOF4lODfK7ReBtDubJC/rERy5QS3nHl8lhDSsG0TPk7eQbXth52+//2vuCxf1jm6LqRfamG2DJdf8WGCyHpWdmuseZLRTqMXU9EONqgiS91v82+MqVKou7ETi5lEekoY4vazpBrKca5ms1GyLHMdi0/gO3CQ6O56baxXm1Cb0p4a1Jnd9ZftADM7S5vWzmRDpj7zJBGmMUSjuh+GSHrJjMbkg2tOHQyzLRBcjTarYWYVNm2lvBGAcixLBpIxYKxqVB+d6ukrm0tSIuATeXQ9n4zphc664sbr0VXProcZt17ryXqLdDQz1XurwtesKVelNikqACfmMtgKOUfQjU5X0wZdDDOsm/AF4hv0xTvDbCQDRj/3PfO0/uHZ5aehMbbicLshoB7mDZE7qczp0hQ7u7b4p7kmT9IegJ9z+wo2dDnNK+7lzIfSQmuMhsZG7juhfDmvwz5gdmgNd6ZHOWchzMjiD7zveX6+oQHH57IWDbd/sRPpxo3dFMMEbYaisk0kz7p5+/wNjoUMXA246A39XWPMXKcvK2ZZCkWapgWUtga2iySO0J460aydAW0uZxSvgI+VuyPrYw8JppWSc9LI2TXpb8Fv3g7HE6AfS6vah7FEd9UQfinFCpnsV6SXPJTNiklxBwQQPe8+AcOkJF+inP2WstjBdkXFZKgE0Ntyr1v4tGR3EwqrW8VlXQpj3wO1gNge42oy6QWCP6FoF6jGWTP7Vz3BstYtOED3AN7veUz3h6n9Pw5Pcigl8beno96UvHPw9zyui8reQHCnG5IbobLS6//YlexhL5e8r6wUOO6XqRfVEoiX70uCNBydpj3dT8d493xYYycsb4Oyydlsh3vDUJ7Qww6O6JhzktJzg9H5fH71x6EBHqHfRHBeH+WdyRNN814F1das a8lIHnNP 92QXiwvy0URbATO64Bl9MWqmW8RAk9S8OvREEz8TW7L/UziuLGy+OC6x99f7ucr1LtxJ0piwlr6+FdRRkiJO8zPTZwLgIR3Ydob31TJuKihh2xisc7Q/mNYTihdtrIMnXY66bTsh42Hd2qP9fSnb1HL/HoFLFid8ORczdxdk82Hxhf1Jtnx4O6cV2PPygPnOAGTCRw2uetQT8gKKTZNPJvuGKzdSIMDHcmdZh5J6YoyYrje59Y2TMl9xDQqgQv8mm6FxlQpsXkPko1Ohj/aSy0Z74iUAbkziRr1fq0LJ1lvs5JDkU7+Mpi0rv74SMFlCyRHpidSlQQoRZoQ26OUyHs9+eXDLWdILuq2npzXJz9p0PaGLgQ1Bq74p+B101O26lkt4+HYQdGzcrSDw4vtjyCKtomasKfhVIWyi/ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dm-zoned uses bio_add_page() for adding a single page to a freshly created metadata bio. Use __bio_add_page() instead as adding a single page to a new bio is always guaranteed to succeed. This brings us a step closer to marking bio_add_page() __must_check Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/dm-zoned-metadata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index cf9402064aba..8dbe102ab271 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -577,7 +577,7 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return mblk; @@ -728,7 +728,7 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return 0; @@ -752,7 +752,7 @@ static int dmz_rdwr_block(struct dmz_dev *dev, enum req_op op, bio = bio_alloc(dev->bdev, 1, op | REQ_SYNC | REQ_META | REQ_PRIO, GFP_NOIO); bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); ret = submit_bio_wait(bio); bio_put(bio); From patchwork Wed Mar 29 17:05:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192953 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 BFF13C761AF for ; Wed, 29 Mar 2023 17:06:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5FA3C6B007D; Wed, 29 Mar 2023 13:06:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 55CC4900002; Wed, 29 Mar 2023 13:06:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D6BE6B0080; Wed, 29 Mar 2023 13:06: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 21D536B007D for ; Wed, 29 Mar 2023 13:06:35 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EAB051C624F for ; Wed, 29 Mar 2023 17:06:34 +0000 (UTC) X-FDA: 80622564708.03.54885A3 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id C4E791C0013 for ; Wed, 29 Mar 2023 17:06:32 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=duqTnaPt; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109593; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rasp905dSQTJPw1S7wJBQPjV4Dpg0Zhy7IvXBhZnf/g=; b=P0WrdznHOIiM+awrGj+m2dcreHfzvjt+HHUB0tmk0jLEcl1h3EKMomR75zVaa5pIxS7lF8 5zaB7Q2K8zX7GRlXb0IVcGvzm5ixptKsUHDuCWP+u/Oi1IxM96Rjp3MebcQXdGlmlbFEzL RvX87baOdRx9vhFUwSsBJ6tJGNg3P20= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=duqTnaPt; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109593; a=rsa-sha256; cv=none; b=jEbxJvo8iJeLr16ucvMX22QZnStqt27Wistu9+nuYfwBBI7hbT0YFbxZwIY7W3Lrd/mzh5 QrOHCk59W05FYIHe6woUs55gHECbIEVmgJkdZWMljomuuWqxqAuTwd1DHJGMcVrC6TMTWf pFZmxvOnwCeShFkGGqu2I+CAJc+eca8= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109592; x=1711645592; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w7ULCTtwVmRs76XZxrCBBgDjRvqinAOmkneoFyK+NvA=; b=duqTnaPtzkLL98plrZ66TzJ4SALNmFKX3I14A0s59SS47hUb7HxzLp26 lwMNlJ8qLt1X9vM9LLoHB/BMT6G1Z284thEo8LwdAHVc9c/oqgZv7kVUw Jy9PCojGWKBceAZjJFwh0LIuG5hyATLnkO9GcaZpaQB6bn2Hn/TTf41xn KceTLeNjVDVCd/hHWw0DtZvDopdzNcg7/QerWJU7Kd2EMRVUpOq6ij4MR P39rrzME+W+4R6mr8A4Vio0vDGuytu9pxZLNf98V9itD305x4H5xR0e8T yvrqAzUFSlsnFLCWIgyqB2KXafSwsGTRGodkb56A3a3NJCJ1knrrme/VP Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807027" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:32 +0800 IronPort-SDR: 5sWxfJad9DoJAjhUpSzMNwSVa1diasb2erVRa5Gu/TQw9lyBM7IspDwFo3eTHNl7pLRgz5BGJw q62UbOnYxL+nKdolEu1XieScKikfx3OzY7T4FQWkThF5ZAiyElGfAz3fGJHSuqpzOVIMSaNRcH /hwAUH2jkcZtCN9ozAvPd9R8jRmHpHkgPKHROY1zdPRiokW3fYf2QCYi+I8/3iEesBNkUhabyA 1/+3R6+94GAiGLIAti6Sg0InmMt0s9rLuclydTN0E7pALJ1JwryfDoxUxAuakPgPArOn+ruHtM wQc= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:41 -0700 IronPort-SDR: HxoeR2ZiwSifjLJAm4GM6J9SbigI8oViKXc7BCkcshpggE9TOaZcyDqhVSgcBLgj4CeCbAetZI +UtoI8hvcC0aeY4gXAT+WWBWHXSNAnTXctf9VPJWFomeAXHReYsBRLLfqTSsStRS6jxBLp1674 vgvEKqUZp9f6u7w4Gk4HVPSF59cBQy2yyUeoHZgaezaaXfhXfpLpfF7TyUmHcjLZzHv3zOPW/B mD5ohyDY4XjUiEY10JRmTnJm3UatvjKaPFVIROi629lwjbNdQVKZlCgN+4RJr2LXT9esfOlGAy MBk= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:31 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 04/19] fs: buffer: use __bio_add_page to add single page to bio Date: Wed, 29 Mar 2023 10:05:50 -0700 Message-Id: <56321f8ef1e70e9e541074593575b74d3e25ade2.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C4E791C0013 X-Stat-Signature: 5nb6bxgsrwjdjetwuat1su6bjqht6aqt X-Rspam-User: X-HE-Tag: 1680109592-258213 X-HE-Meta: U2FsdGVkX18Nv2AjfgLSX+kUK3PKc3c2ygL4muCkhDUD9X2TVc/ltjFf4US46KL32Bfi0lYMlXF8Uj69cl2J1ACt2QtvvI+20+ZS7AGDwjrd02nr8J66VUFkz84bC23ieKIRo74I21uX5na7cGzYosXDFBBg7/pSnzf/jxN3Dmq0ga9hbpZqPgX6rNHpKMWAmfFLDPuwzBu93x9H6/wm+7WBWdGnMHg2OhXJQBlhQT85iPh4hqM+LhppbtU+J4aI0w1YHQevq4ZsfRhmUeLuS2C9e6XSEh5LXnCg3hyK0WeCDO00myBFHBZsab4KlvGgXBsZ8sj/1UV2p/PFyvdjuoDf2D16sGD5Q0E7iD570+NFj+Wm4e8dkALDnthAVYo6CGsZCkJGWt178Gs8aIVxdauO6Q1LDZKaCSwZftHO3niJCdexAK/UkwVlOS/bU2VSyQ7wBfhFYk/9U7ZphfL4Y8n6N8h0nmCZK8T8lagBSmrn+FRI7U+fzfgaina9a1py6jljatTO+N7Y43ivRHZayqkSmgpvjuVAsqfOsiwb7Jy+nOkopsfmLkAiLxqNIEjB4wEuaUBvwWrxb68MQJvdV26PCYbI0lKSaH9aYN2iE0rWMatPMuZ7gW7gVyTa+c/te1MDJVpI0L6UOrAIdzGygLLzTVv1Bgs3Wxp+VpBnA2AZL29TeUQXwIAHlEWk/EgHXgPFHbC/YHMZHyviJMu/iNYJlt1TSpWqQZrEUTFc21AW6+W0dOFRH/NykQwhSFK2M1KHBpBMGl/AwusSs/P+uiCzoRuDrAPxmisbZWGjkjzXAp6OfLryLL3n3EC39utaHUMZE16LpN2NEA9579+nkotb97+RhP4wPdUNx7mhQMx+qfwNKmHIj9VcgjGMQiq9n3W0Rp7lMfDqtTS6bJyw2fq+3yOYGIG21GP0wbj/WXsswZ07HJKao44lYN7PyYVHk87IecVR3/rOuouwkxa D6HqU8J2 oQ0b+RX0oTm3FT/o97x83k7BOVkpOJu0HSt62yznHqd1WTFb2VViYBnn1+PaQGGqPJ0feQ8NM/rr+Jh0aHD6DUSCYqAC/zIHVHwcwIkFWeJ6YpVv6asGs/H7MkVUMXqr3QnmZNU67t3S2/EaaZFUFblKL08/zW/Q0BV7QmFML3LzaQH/nIA0FoNGq8BXK1EClsZg7VUP3gOt4pGrygcMRy/wFCexJsKmuSIZKxDe9ErXXnZUnV6YUiLbhD/kk647HtZ3otta4ceYH7D7H8PgCrJlx5z54oK0duruUE85allpptFnga40nf1F6bKWh7P4+epOW8ICG3GjBj4RwekiIU4eB30lSi5Y/TYcN5HkVmAIuxDyZDZjCytBUUpxpCneUSAR6wD7atYDUntjpwutKs1mDAIDS5lkXRU5I X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The buffer_head submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Pankaj Raghav --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 9e1e2add541e..855dc41fe162 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2733,7 +2733,7 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); - bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); + __bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); BUG_ON(bio->bi_iter.bi_size != bh->b_size); bio->bi_end_io = end_bio_bh_io_sync; From patchwork Wed Mar 29 17:05:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192954 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 E0731C761AF for ; Wed, 29 Mar 2023 17:06:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F6C0900003; Wed, 29 Mar 2023 13:06:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77FEE900002; Wed, 29 Mar 2023 13:06:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AB77900003; Wed, 29 Mar 2023 13:06:38 -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 44398900002 for ; Wed, 29 Mar 2023 13:06:38 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 222FA80DBE for ; Wed, 29 Mar 2023 17:06:38 +0000 (UTC) X-FDA: 80622564876.16.1553D3C Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 9CC9D1C000F for ; Wed, 29 Mar 2023 17:06:35 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=NpfBoHuL; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109595; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PxVbBeSzmaWluu7SLf5jTi3u6gFyXMToz/k4OS16d80=; b=u9S5UmBe3Rq3SJgVfInLNuuvDtcbQvI6qxBWUr3ZdcYXI3R8IPjXUvKIWzCdHdQy1YsSNc OH1FKs+4RZwHLZlsP0N6qgITHvksXFhuq1SGN7Lc5q6irH/VrwfeJjpWcW+kosAIUkDG0O +eMnJPB+DkEq8qVEmkGKkG2KHzCqib8= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=NpfBoHuL; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109595; a=rsa-sha256; cv=none; b=nxQt/iGoZ5lqgJbvk+cGvrdvcwS9go23i4J8ur1MamhJBPoBfqU5NgpWauz32WVEUbcXDA YDQHHx/aY7QIxrB2X3K+ToqVeEr2USHRsepQvc9vHjw5RqZvJfjrBwKwEYIYfv7ACabD0B rcULB1CIc7+sbSOUcPBmKQihEGZIvzY= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109595; x=1711645595; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z0WRD7PSxT1MI9gFHxfmzZuO828C1XYh8k3AzLzoH+A=; b=NpfBoHuL3XAkv8dI3dL+X0d02PMW6pMsMfIphw0BUZ58DzwzqVpYUBYY JbRNT2eMyKj4ENdkLOwb7oOoVrwSb2kw/E6fe2JdlGhJMVGShb0nbxxXB 26VYoFETtND2fMUbFWUDDYDI4HGvUCVaYGfAfCOAD7vKHM9dq2H6CgMus MDKROKsIfdi0nFHwMesbFzMzZ8RnmRj+V6lyP0yzJ0taVMgzg+cGBS5A0 LhbgORjH2NfeN+jg4+oQLBw86JnoOfFKHQpQM+hE/fcdi4C4XpQrSN5NO N03ZBXE/UjdvlMLw/CxwjYvvkvcK9InjU8yr+hy61TzHCTAd/479nV1E5 Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807030" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:35 +0800 IronPort-SDR: gsoMA/4jvP6I9zHtEXCvz8C0Tpti7B4wM6a2SRCgknmLtDhc1MAh6V13OryTopUx6I5oFI4qqN za9shvV1rEybqBjDRzbCzOJJVilK1+08Z8V4CVd9j0ltb9PJ+7rpeOmuHPgpH7PqjfCOp6H56R QftvodeqpHKIKR89QL3tddMXsORHrWjSN0AFO/MUffQXbYEcj7F10Bx7e2ye46Bqd1izSZhlI+ WCk1eaqYbajAymZU5zRmCzao562BWkWQpt7XyJ6cI0hJZoW8APiGaDx6VGG3UG7txZZhztPrNw D48= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:44 -0700 IronPort-SDR: LCzDjMY5FJ5sr8pIsHJapmUnHR/HrhUl79JV22sYdEO2rzY0+ynCU/VuOjv7ZALoaIA05uNHnA KLRyUMuwlt12IwC+VHi4otXGnYicO4UmHegZ9Kplvajn0f/LaNS4Vr15N4xbFpRBJEti4HjRX1 Bvit1PEiowY0ep8DeA0czhvEoDRP3Kll86DnbETpHg8w4X4G9iHJmSKb1l58xWudqk0JK6OIZ/ BvTjCmaxL3mPyUI1B6gKVzuL8y2j4E/ZHPehNYyHvH3JipeuiATzGUF76GOIcEtetNffS4rAKx brQ= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:34 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 05/19] md: use __bio_add_page to add single page Date: Wed, 29 Mar 2023 10:05:51 -0700 Message-Id: <55ec6659d861fd13e8e4f46d3e5a7fbad07e3721.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9CC9D1C000F X-Stat-Signature: tiyyuj54r9snbiqf55dku617ojgdytby X-Rspam-User: X-HE-Tag: 1680109595-954198 X-HE-Meta: U2FsdGVkX1/prm26UnG6V2+G31kjTSFsVvAIjrnvpbi1dcU7mIDyYs+7aArwcM/CIE8o26+1yL5QmLOFkr5+dHl4xrLfeLsO5xZSKj7v/9rvKcMdmr8r13jt3HRozLkuWMgOCpINGOiCEUtYU7E7SA1MkeFpMvkxMY5j7h6sxiAmWOzzzevoAntW64oWknoB7QsHp/NOTnbgS34deTCHdF4LBniZaFRqY2WbCrE27jPPiCyC5uieiHvUPdMe1ULNBUqyZDKsV8Y+Er+gJNiQMKrciSHSxqp+6eP5QIocFMFf0sFFK8Ie0fhyrimFk2I7UYO46crdQ2m+jHzehNIflLVZlq4MsjG3q2o1nboYcsvHDiNHNuVs8pFhzV84pa0lmlGL+F+hAM2aq5vkft6bszeK+eIDiPlV6MIpKUyPpg2i0ymKm75Notr6K2z1rokqSpSnkSokyp/xWsNrSOofnDu561zqhoOekdKT/xgOfrUhArw7MqYwzsxjqJOUZbUrXrnTelDh++1SDKxeLh9hnuMGifFv6TpJCaJu7JiLn3DeOC6c/TwQxpwQ3Xeq7y86hgaIRKcI1251Kpn/s8GHBpRzeZQIUpxD5HpNkaYowR3ShKm3CXaK6QwLG1DJm6ljMF9+bSa67eSSO56eIzmXpELMC53QMEhBVNXGmTAuPq4i9dywcv6MP/kUcG0FI3+THPrwqm10v2Z3OGZJZsDQZqrBtDyFt6fKBKCJMzTPKXs5vu9SlqjyfpiI+glSMmdSry4O45fIc5KmupDlvoRiGJtLuj/GWO39l7fYN09zq7gxPx9c90n5R95XQ2PMjEvt1cBnuxnnQqc6NmerC4pzfdrTgkOHoBhdSNpNBRbP75AhIr936eGCOXdB6b3TVZsKm+Pytay6bODhKQ1M8evC8p7oyl/Aa8wE6ilNL+8LYEClM1lPJpW6wJIid0ZnCqhgt5rsyPo+0NlREcs5MI/ 6+DwRcmz Bk3srzIUzZtqs0i+0LSEg3Jt5ghXAUHfCRxjk9K5aYBcuDgeSPxz0p6EqD58/4vtebT/lOPF+IGK1wxUkOnqW6N+Oh2n3r4PAtGEXSjmEs4awBMPOHJB8OA9aa9erLpgS/hjM5o3ebbgiTASfsLHtxwfQmL3C0rwKO7ec8Q303RBc+RuyeyXfVmI+tlpBIvl9beNz0CAB1UqO8KHL6Uqm6sN/u7N9dIYLB9foDKvKZQbeH8gM4CitfLCZwNGNufSJh0lD/fkC9Eo4BKUgLugJiR99YGmTKNOakLTMxjdbw+lvWVJJQapnAm8iHRybnx6W4cbVHucqPo4UToGxmTazWx1xNof4Rs6hQJyUXMnDzrXSHioQJnp5V39/ktQ2qS7p8Yb6M1bmlrJYtndfMpJJxo7U1RVB77oYdy6y X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The md-raid superblock writing code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-of_-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 39e49e5d7182..e730c3627d00 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -958,7 +958,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, atomic_inc(&rdev->nr_pending); bio->bi_iter.bi_sector = sector; - bio_add_page(bio, page, size, 0); + __bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; @@ -999,7 +999,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio.bi_iter.bi_sector = sector + rdev->new_data_offset; else bio.bi_iter.bi_sector = sector + rdev->data_offset; - bio_add_page(&bio, page, size, 0); + __bio_add_page(&bio, page, size, 0); submit_bio_wait(&bio); From patchwork Wed Mar 29 17:05:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192955 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 A2AEAC77B61 for ; Wed, 29 Mar 2023 17:06:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 36186900004; Wed, 29 Mar 2023 13:06:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2EBD1900002; Wed, 29 Mar 2023 13:06:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1646F900004; Wed, 29 Mar 2023 13:06:41 -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 EEC18900002 for ; Wed, 29 Mar 2023 13:06:40 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C164BAC36C for ; Wed, 29 Mar 2023 17:06:40 +0000 (UTC) X-FDA: 80622564960.13.46C9F38 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 882E51C0013 for ; Wed, 29 Mar 2023 17:06:38 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=GEYxYKyv; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109598; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gmg/nEFoDT2KcvdVtETEfPsUn5bcYaHKrbnC5/isn6o=; b=LCAR7LF34vK+d2BtuAHOFwpL6f9pNIA2QJ2gaRnGAZB/jRwQYBzWXbqtqBZRcJKq94YyA/ hVsqCpp4M0suXtC7OG/vjh2jPwPYVyf7qry/YZ8W4ahObbT+z/NgTrk5kpDW/ofZTvTqie rgwnmWfX9RF5aKFy1E7Iw2Hhhnvce2M= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=GEYxYKyv; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109598; a=rsa-sha256; cv=none; b=zrbYXsH5sRp5SYUalnGTbnAng4RT6rMcovt9mT8G864MMP1rx8UsxNTupWGOvLQz9olla4 vleI1r3bs8svJSgXwdALgShNsZiPapEeibT+qHatIk/XIBJaHHAC2sT2JU7e9xZPFVf37v bBQjbFhoXSFrKBCgyRv/lUBTdNIBI+s= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109598; x=1711645598; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tehGgAgqd6Ug1q0ulEduzG6BKUhY0WsPTR6+2QwYTdw=; b=GEYxYKyvrWiwTG/EQHkW409uZx5P1VP8TnxJRwRD0DOXr3ES9Qnwu2WD W4WYCrKVoSMyArm+SN8gSeKWTvre43iNR7vLX/JoP0jbI5rbXHE0z70gR qz6e4Hgg34iFpqlt0Cst7M1mm20+TqDmDKi64ziLyiUUAb6v9UUxWEgBO X129GPRGlOFuiKoEYBzgD0xktRoFT0a5ez5uQI0HMagbb949Z8+f1kepA EK9qXwW/cWeaNhuSNmQgPrSKkU4/Ata+OVtfrVG662d4XmBFgRpGMcptB Purb8Qt8X8r3JTGSX6XdL7emAeev1YLG6pBlScL4WdENno8pEClE2Hs/5 g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807038" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:38 +0800 IronPort-SDR: Gj5tAQ+8XFGv0w41zj+aCTDxoKxQrvpzLEtId4oTrZhERVMbUklvKd54YstYrpXFK/uDC97+50 GJ6KHo2HGKUhAk8eSAONjkCWT7bQOvz/D998aVGFXQOgTrKpj6Oi44MotQcajvoaiGJIcD+4jO OzTi8QseiIyy4N2pC+9dHVDJ2FBTRF+Qy6xYcnM02HrndgiUFrmFdacLT8hVxpqY/Bx+DYhjO8 bC+DsCRPIivArFz3hcy8bdhXZUC2IaIjlG3/QtNOhAivWw1j/klkKZrfMMY3CKrWPGqdM7s9mI KxI= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:47 -0700 IronPort-SDR: 6+prpYoraSp9aFA1hXlXHyHu40E7L/eCAIlzO1/as7m+QuTtwlfLU6oRqm+u0ktT4yW4nPXxtO EVWWCSi0KFouza9iXBVKHiWfRjRCi3K8NXAjcFmNFaydHoskQ0l37e1TsmHPRtc6H6IjsIJnWc qpv27cTnKw5/oXlPKjLCcoz7fE/btbZpL05CDoXEXYjFbavUThVFCHI6KRsWesZV0+mBsx4ofC KwsVDJikGzCScu3CFwSWTYXEDPvbMWFR+EaLM1F8AZskQ1sONkyddBy6iSLZ2oemLVljH3RxOv qao= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:37 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 06/19] md: raid5-log: use __bio_add_page to add single page Date: Wed, 29 Mar 2023 10:05:52 -0700 Message-Id: <492cbaf4225065838d25e04f8488528e50a52e3e.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 882E51C0013 X-Stat-Signature: zat8164gwdeup3baqs47at44gqds4pyc X-Rspam-User: X-HE-Tag: 1680109598-934136 X-HE-Meta: U2FsdGVkX1/8WgXDL34NBV3xtYfk4gRsNcB2iPGGUnXUeD99Fc7Yxk/bsrKuzKHawLUc7zGWMOnrpGHViRMKxQw9cLVnrlxsst9CIFYvdThF7hcCo43sQ2kzr5e+cQw2wFjdoRQn0HKMTFzgy3tW871fNxTzb3UkUVMqa7PAKCpPuvQp173SJZF2/1Mn1TyE1V15bdMxm5pz32K51zmNNF04MduVPzCUzGv6GPmIoNuZ6AZuSrTSfwc50xyVoOvkcyP8G+2/g0KTRB0fWv0z9YVbfa03oRlLr44PE6GgAiUIa5VxOd0Vl1BbnADBXc8zuvyE6bWp9obSyRs9VMYuw7Qk0/5MIOxJqscT7Td1tAA0aYWE9OrDaXdw2rh1K42ONPGOZKBL/f08T9KHZt6htgLllUoNkduF7yKjpo1eBimKHrj52rF8cW5tkFvkYrvLmBvRfU35wd5R+m1nOoYh1x+IeX6818ZZNxx7EoBGUrAlF7jZqSzsXMoGswoHw3cSR6PRB7ti82Q4/Gqt4hujL4mW0qXpKyIMb3g1pvNbzYNCNGBqMDWLBEdaHW9bC77UZ15/VlR3l9vnWrQAbdhY6PupPeNx4azusgXfqUlupNr92XzVXfuA6Bd0WzIfNw1hh2V8VeV8c9/+s4ng4T+91BbxGrzPTO7qXWJki+yx+ECc42a+XosZF5XEux/fDNgF/qKodrFJ93lqaTaM2iyqIY7yAzguP6mc1WSOEonwf+JnvQN1AxuFwYVV4JuXm2/MQPpwFjVFkKNTe0BbjLDaZ33QJwkWdphRdv8d+qTz7wTADO6Z1plWjd2TknMUXnVNnebkArLgRJkxSCzdB+AzxIIaQV68/AxPnK7/0aHi+hyQ5hbiTuLGb/PaQoIp3z3MKoJb1Y88Y2PkuBW094Kl2S3ApK91KU9KwhfRMAWt7JB8xk7Xx6J/veqFvecnDWUYvpq5J1X3odMOD0JOG88 gVnlOuOn lYCbzkRx8o41kd6Wj0QC2N4prm5Z3vCXPjm7+IE01AZye8ouW+Ur8yaexxA8F1lGKnVTdF8yOSR+0pwZWlIabAxDHIjDpIBXnmh1hOb5yEZdgKdoe0m1woKP3bw8YS1oOdDHxDs0GhP/p7cca+x9fgyyIyCiwHLZ5KZ8qA3kqSMSy2la4WgfqzQULibHTz9vGaDGDksbIPhJPceAFk73ttwTU8r7oPKq/YQlvsYkhbDtyiszmc9dVLSEqFvbtQXCVwIjMA6AQthcoebz75ncKgoMJmmzFGmSS8rWAIz+8ODOXukgCyRwG49aw4ysvsLxNNKJ1qOQ6uCqFtWuTvlsc88EWcfked33hiCbwcVLor0//nD6tKSClAOeEPURhTEF8f6DsKk+w7kh5fkjiNsd3nBLCwZ1TSzH5tDGS X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The raid5 log metadata submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- 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 Mar 29 17:05:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192956 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 95189C6FD18 for ; Wed, 29 Mar 2023 17:06:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ED7E900005; Wed, 29 Mar 2023 13:06:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27644900002; Wed, 29 Mar 2023 13:06:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1162B900005; Wed, 29 Mar 2023 13:06:44 -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 EFE6A900002 for ; Wed, 29 Mar 2023 13:06:43 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AF9931C62E7 for ; Wed, 29 Mar 2023 17:06:43 +0000 (UTC) X-FDA: 80622565086.05.899F4B6 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 57AD11C0018 for ; Wed, 29 Mar 2023 17:06:41 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=VXfIha9g; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109601; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ffTON0Kh+3rXjuVpsfT7Vu3uoqtPOS/kkdvUs5WLrAY=; b=jomjGWWrNQRD6M8pqEM7GwTYYmKf3J68ZFDRU36IpbM93s1hu3nUXaG35b6z2xKCzNCua+ ZHTuyd8ZrheZZPLPcfoN0qNAeaUaMQmHb8jMiv7uSMeGgZsA50H6z+QUVexuF4f2qu70oN jaFgBif5ozlov/Ye+J5CyrjnIzypAQU= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=VXfIha9g; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109601; a=rsa-sha256; cv=none; b=Sn5Be/sBIHNQVIbaWuIbb511AtH6GzBIWxKsvTJMtuUQgr2VXCkHF8Lp9C8DIhjGNwGjUA h5/6X98ol9iRwgTFv4ikE+bfQ76ILSeP5o95gHTrsa1Vwnqb2Y1HRcW9AiY6ND9ExGt91+ u3Qx7ffE29PEFlDcjHtnsUq0DD0oOUI= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109601; x=1711645601; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q/MP05JbL9vu4bkJls/w75JhMUACKtyWcGW84ceCR9w=; b=VXfIha9g01T508W8Yz0QixXmDqP/5MjDLtF0U1yi+QKYtftkpf2E/SPC /mUD8jjWLkSC63MPSUoHzITQDVStylx870mtx7dKowxZbOQH5ycWUSyNi O+NIP8VXhuftUShr/P1PknMi07Da46qQoMx8jIieKwzkYi0WAQEigNjBT uHRDD6UF3ABzqax4p99yrk8qojh7pkojZ7JiADEooKIOm4tpegmbZ1sFn PqWDznOeYHCntQJxilvRWUaX10FebmTh2USv8t/wY4xaVuBIahZZE6sD6 9MewX0edjrcYTGWuyWwDEg95a7M4Ljhg9CIcm59Ik+ck4GT/h9B7+Dq2M g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807045" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:40 +0800 IronPort-SDR: nTGL5sw50T8NTE+6MoIqH1/ovLCuT6fzXRywRe9Qh5ySn81lH60yfx23m0iDfa9YOdVyV2Y+si k2tsdpOkKMa0zsUWe7pETOlwXV/vb8hZf39iQ85u93/L0lJH7azY+TYCmTQYqnxyeAwyGYaGKu +bcgc4lON2N5Qm6+qzWeFwd1QUOtW1uqQqiHK9BH1lbL7KkGP+p11LvIB1d/9f/+GCc6UBzXs7 nlP/9QICJI5U+4FcSxHTt5CqQyZ9RcPSO+/5cCsckrbgZmGen2VzcAtQO0QQ4eMsGlPJkd4bXU vqQ= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:50 -0700 IronPort-SDR: 0NfE3MwgkRGnbsEfrD3apWVDkRRWW7BpA7q/3BVNoCtKDaOSbe5GU28nZB2Z0Nd+ot/O74I4+M JfSMorqce3BJ99gveZBSA3tXb3rtCze2wGqglc96V0F4bjY5VAmksMNFrMU4tQ8Fio4zpCh3pF xACTb67zGAy8FiCgshGR/AfPrmuBbIYsQe+Z+dl2z3ZWIDuzh9xoVO70zJS6Sz3VA9bGxsm9+b US/RqUK/CXiZRj0Wy3gVSwcyo5L73qLzC9KscH/xn/Y+hWXc2XyYuRcML08nlwTplE7o58ytpj uSI= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:40 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 07/19] md: raid5: use __bio_add_page to add single page to new bio Date: Wed, 29 Mar 2023 10:05:53 -0700 Message-Id: <7ba6247aa9f7a7d6f73361386cc7df5395436c33.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 57AD11C0018 X-Stat-Signature: epckmtk1k6b8wzxce4aqbedb1x6e9793 X-Rspam-User: X-HE-Tag: 1680109601-486623 X-HE-Meta: U2FsdGVkX180Oat655Z3svpLzvIfVEn98FJ2VAWCzyHIDgQvYBxkMsnj9HgcjqDKAg6nSYTcjxEPpfVfGX5iteD0MjQigEzObj8+R92UAgqU0/g8njALYuLmljXvn/CaodXqhA7oKsFOY9IcoTfbq5RI1n1DsVAjcmlat3N39Ziri5LvQI29oMGPzAJf4oobcrWdiG+4ScTDDOjkmGBOziTibSCddAMk2lwFdvvc7oAn9HlNWyS4NgvjGIp8Y8hzKGRAaxiiXHdUfEEvZc2zwRJXK5QIq4hGnYEto29ysDWMCd4XTC9wZmYrNbIXAssmA/V9+g+5JhtBXxV2J/bDGjJcVL8xMf+NZBMIf9avVjmwV7zqUdbIY5n91X4/kjKGmFnF8rU1bdK2gb8aLLpql/j7Bkph8i5sj6a5ylwS7mEknifd88GF4/f0mgWH74K5qyOW+EpLgNvElZq3w3pX2/VZ9Wt7KvrhZuIUqJdhHNYH2avu7Piad4Q8T0Gs7vClcvBMLAC5pj/hrhhw8O6qXYW3Q12KDhFKqNhwrZFb+5XvflJFNcHQ2YE5wkpAEBFwb511ekJtd0Fe7ixgt7xHaph92j/tXYqMgDyvc9Wmh8zJ15fAi7/EoJm+IMfkvBLkS9abYg46OV6lvy84jCF+pOctCWNb0+fAEQwYl6T5o3dJzUUjLb/yEF5qwz2wPc3XAgaBV0t3mA44mTOB0fgp4tSv/JHKKwWyXw1T0KE6ghkBfi386YzQZzycapAD7FvnW3H2eWR1B44rOP5R39vKhLvy68GKdqCqnJpBvopHtR+Un+P7tfERM8AAPrxH8jiZr2lPe2gMeN8TFTSFGrNn2EiXujvEZt4rxFD/PkNlDVJXirJwlWfG2vmEBfC0cUcdvfZr9ebyGoQt4bRpY/LYduwmAh/4KGQIdsWuLgVPqZipr9QujNonZBqcxE0swE3reQgrmiI+QorNAvCKkFH YOiWDnpI xvh+peMthZ+SpvS/d0CueBu923Rh7e8ucVJzm7bbCobjRuAL7gmlGXjh3PxbTDUU7vV29IElyhy0pXXNTdoq7n+yKPSfKll8sYzxp4IPV4wMm7yXdzi97Sp0FO4N0Iz9O3DaBQHN8buL0s8uSMGbRnKH1OD/xyoeNVjSnUMwKMokrrAD1DAj3UCrUKfgnCkS2SovhlF6xBtN92Rt00yZRMyvuLdMs3BtUW/0a2rOiBP4aFVhICrOvSIPQg7V1hMLhP+5b5jTRgeUmcm9CNrWsr/v6eAz2xUlaFLSBa9OLnJfr9IVawRbshXmvW3oDzuVsZy3Lp7hdeTN7N8HScQsfdvtDTbwtRXVCtFK5Pjk8Q9I0g3R6b+zUay1wkU3C3f+mewWZzSYkXbsPjjE6R4XZKJ+AP5CecoLhyYVz X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The raid5-ppl submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. For adding consecutive pages, the return is actually checked and a new bio is allocated if adding the page fails. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- 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 Mar 29 17:05:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192957 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 35409C74A5B for ; Wed, 29 Mar 2023 17:06:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C3B08900002; Wed, 29 Mar 2023 13:06:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC48A280001; Wed, 29 Mar 2023 13:06:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3E03900006; Wed, 29 Mar 2023 13:06: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 917C5900002 for ; Wed, 29 Mar 2023 13:06:46 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6CD831C6125 for ; Wed, 29 Mar 2023 17:06:46 +0000 (UTC) X-FDA: 80622565212.28.F1ACA65 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 39E8D1C0021 for ; Wed, 29 Mar 2023 17:06:44 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="K7XVsA/2"; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109604; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZAZJI3cszmYVH87/ojs4mDfrFkC7lyCVrVL/gBZqQsA=; b=mHA8dH4h7FH2r+oTtDCEeyaa0TTs5Y28ddSOvuvn8ZmMDA3gsMil12RBqz9MXFYyjvVOKK l5IZyZw96Fn95IxsvHxWvIPVFj8NaQKOL3dOt2R9SKVGd+73zAPYGAHyrUEReJUQ+/I7ti JhPEAVlz6QYv2aqnJQaAPAgfyuSosqE= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="K7XVsA/2"; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109604; a=rsa-sha256; cv=none; b=YQG+DP5fgjN22ACqkYHgWOPfWEPlZDoGCP+02mkaomqSuYS3hZ0dOn7bKb8+R7Bd8l4003 MhBqD5YdCS87/88+4dfFb1P6N9BN7k6HQDSgm3w2592XJHNfRV/Ega/3dvdtR+KXz04gDB yyLyiQ4FdCED6puaP6iEdTN36YYlpDc= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109604; x=1711645604; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wcbMmuj5KLOp188zkhhO4UTGZgDj+uEBsLMZXWyJQ1M=; b=K7XVsA/2NxqdQH5vTfQuGTF4pGJhS78m75kOkfTUu3e8bB8OXUVW0kaf U5kgoXQWKgYvrklPoXnP3pZ2F5bpmXjkQzvtnzEryzJaaPYcSzGf1NnbY pvkaSUqdqm/GiJuNhPMYOC6Q8HZeIXV8qBaRDINPTkUnXdv6wZcM9gXNw dTo7dhX98KVIzqhdBezQvhHh7apg4omcvHqu/BcLgFQHvj8NmAN59yUsY 0GFxhkIF/Huuj2di8gweqPoZu6415gKGAwHTkgiThJezYoHBDVId5Em6K 9uPA10cflq0kndujxTR8KYXENTVqnZOWtRrG7PWwnoFQO5ApS8yHpqD6W Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807053" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:43 +0800 IronPort-SDR: JWshrd1masj2QSXSAhKcpnZCZXMIXbkjpipewwhV0ltDOCabYOIRC2+kIK8icqanCRztInhcAs /0LsDJ28Tv2e64dCcCyNu7aRxzkDOPUSCiVbe34Byt2U9m5hZQ09au0TlDihweynQZtNTCa4K1 9cfdZmRBBCa71pgdaqTn7c4qKnSwsafR7zyhEWXz/8rJtltzMPLp/BHDQ261NwfoJMkLpAIZpf QzNDMCeuc87I8+KvN4sO83nDlam71sDR7/xghOvjEREYibbpcH/T3vSCbwrH4RoOmNcrgdKDGl E+E= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:53 -0700 IronPort-SDR: K3LvTn2mgS4z3aUZiHti9nEkM7pjvbBH6ZS/kYcx3E/VzjPdX+tted0ood1vYEc+vc7pbp55fL 71ZnHrIDtp/LZ0g7xWSsFjKZVDSjmWu1MIOcddLaQ0QQ8DiFvqGt1SHDGt+30EdZYwUUss3ZJ5 KHpYJp5gqdZMg4wYwQ+fxuyfJ4v5Ag1shD0OnVsp1Xt+MyUCPRAm3nfZVTezAdIkfloHRGP7Kb R4SjVt0dhflNVTvL7W5jpm1ArkajddHLuecePRmkHp+nFFOhkLEqvaqFM/RyBRB4b76XC4/FNz P4E= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:42 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 08/19] btrfs: repair: use __bio_add_page for adding single page Date: Wed, 29 Mar 2023 10:05:54 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 39E8D1C0021 X-Stat-Signature: w9pt5kstb95d88861cyy53nmyu9cwy1a X-Rspam-User: X-HE-Tag: 1680109604-919631 X-HE-Meta: U2FsdGVkX18ZHB/U9axTBeKU32de67nfWdx2fcB2bFDFuJxuicX36kNWIVt+9syarh22/Tqv3DZBVoi5VBgDpszO+a+jUCw0wZ6IvF/H7Rft4aX+MvJzUGy3pzUzl/w+c/zM4sCrgCe8TaEB9VLagS49HV+LOl/OpTbVeFpSBAEh4jwczJoE0sAXZqVQYA5F5WtA04HNZ7o2bo5CG05MYH1/Z5XAukREAfLspX1bojMA5uPj6S5WPhJirU6+ww4/BDbAxINKTIAcyERxEFuCf2gp+RojDJMncjUEEGEtbIYIWEB9DhNEVAKnA5VNx4mvcgIHrqUsB+Q0gmzk3i9uA3lQn9COmqnvIkVPumFI2KerDgUlrixM5rrVvuY+DizqwK9b7noC2LsgGQWVBd+lAJOn+xxZBhF0XWvhCstDNUtMDraujCG4F2YfCxGTRmskrzSopW6oZk/1Pph8DwiAlvgnHMWCKq2YJraW8bjMAfqc2qvdaAS7se+u/fnfWfRUXKkvhiBH9bLpsn5G4BlihD4K2vlbzoRPnk26lRL2bIqiRwIm8dljddAmqiiZhHSo226Qd0fORDQ+2O8pXuaWk+h1Sob0ar3dcJRcsWDHnfWBkRROI4TkHXkiSojDejd9QTBZWCCaPdlaIFMJcJiDhyFt22/xQ05lUibUy8AyylybNWdaxNoIx3zcul9njvL23AshGlBTsflcWzo1l5n1AMlYZJzKJYNJpN2USQLCpDOUC6r5lGm8DCO9efiY1BnC5lsQUxRXnnUKUt2xhJhhb/+C1iyy73iew6ufxiJVTWky1WqId3YBXyvXlWXkGQuZ2L1IbxqrzMraTcJUWwacubpKt4aH+VOHK6WmJFZED9Krd48QZWA0NNGDjPKyelnVA20rxOZrgR2ujPs8snYXftljeuP9YFDg/28NHU17gcFi7zlicoHFdOdMb0nI5rFq1JGQfmftloeHI3Cts/+ ZTmcAXRR FM2wdkxAPWaqos4PWxuiyDZjFVn9IFfKKI7JSg2Sewl2ui52/s1ET6xMlKhtzOWEjlhFRk1S88X26t0/BsYUF1RfDPXrqyfpPEpvG4LjpUXocuRKlAqXnneC/7lbu3rJCmSh4cMJZCt167g/H/qdrbhoKcfIuhErKOIz3T5oFgQytXxJb3BleEVZWi8tt/LeZ6wmP/O9mttX/LBp/e41SejzZMuVB5GP8F+sa3Dvt0YJYNMC15/5IvAzjYdQ0Aq0bNUr7U4xaeadLF7efzhqzR1LN+0RwCOhY8zXp7RurdyXsabwxWm7duKv1NRicPNZUovF6t2+hMmCQhoL3j0neHhkqFpvlbXEhs+VNuM99zlRySB1g/hBt4xmlC/MXIBNN6vNQFy806bxs4p8VT8B/ELok4N/ZNJtJj/lA X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The btrfs repair bio submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/btrfs/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index 726592868e9c..73220a219c91 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -224,7 +224,7 @@ static struct btrfs_failed_bio *repair_one_sector(struct btrfs_bio *failed_bbio, repair_bio = bio_alloc_bioset(NULL, 1, REQ_OP_READ, GFP_NOFS, &btrfs_repair_bioset); repair_bio->bi_iter.bi_sector = failed_bbio->saved_iter.bi_sector; - bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); + __bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); repair_bbio = btrfs_bio(repair_bio); btrfs_bio_init(repair_bbio, failed_bbio->inode, NULL, fbio); From patchwork Wed Mar 29 17:05:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192958 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 0800FC74A5B for ; Wed, 29 Mar 2023 17:06:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89202280002; Wed, 29 Mar 2023 13:06:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 81B42280001; Wed, 29 Mar 2023 13:06:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66DFC280002; Wed, 29 Mar 2023 13:06:49 -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 52090280001 for ; Wed, 29 Mar 2023 13:06:49 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 31630140C24 for ; Wed, 29 Mar 2023 17:06:49 +0000 (UTC) X-FDA: 80622565338.22.29A7ABB Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 18F5D1C0023 for ; Wed, 29 Mar 2023 17:06:46 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=UaUUt+qB; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109607; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=x02oUNjO7QJjWY1PXTXGuNFM/HVTI0Li9/Hh3mHsQyc=; b=URM/clGoZkAxWFeLlFSoza5y/zffar3NJdGaQZXOTgy7NapXdV3TZrjNJzJaHet2xa3eUW 2/rK8PMPnkgnxqFoHKB/I8M0FunwsIRGisF6G9/8rR65pHFupMSertdHacWnINN8vx1sbT hbdBu6Kcl89+vBVrK2LMQy3ewXdjzlU= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=UaUUt+qB; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109607; a=rsa-sha256; cv=none; b=Oz+aFlakSIzEKl7IBqXpmto1dmJVuJpyvXmo7/70LvBUpr5fM3YaBQH+43Z2YpO6mEwiZQ D2wEQd/inSgyxouCt6b02+SgNuEnzIJJPQZPGDwB25kxunk1aPNq6+CYCuzSpGH6xnskrw VJg1i+YI1R5bJkkBapicaYUwkUUEhjI= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109607; x=1711645607; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=k8CT487ce4SSO54vpXkhaUXbrl//N6dfoaIHSNrZXSc=; b=UaUUt+qBOdJCMMeUUf5gl9XP6Ls1GfDEHcYGL/grmoGQ+F+U85kTqyR0 lEjmbZuHFbCl6aJIcSCa3li8jm/geUjgX6J+gyw695Xg5WUFP9Pj0cKoo pBVh0wjcb9WMsIrlYUYDIMubavilKSFOANFmPZ2Q5lRiOhCW+peXLk114 mKPSO7rVljXu6A4EJgtz3AENMgaODexdL3X6oaof8rzeIPSbB37IeZX8a OmRMWP+C5OJCBFkq6dUbVN4YOqDcohBQMz7rn/5Lz6fI19jhXvH5QPyje 4n95Cq0aYnxhR9TAltjpSNE+dbtetqYiGWouIhM+/M9hWRMKGtFv3ddFN w==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807058" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:46 +0800 IronPort-SDR: 2eWV0nFau6TQACNIViYQSsNiI7hUafHcncA9rl3+CAHgq4cebv7Xj4KkgHVxRH3czQFziPiKZ/ KjJMNTvcGUJIq7C/zHtbiODXRyJRQOZcPD2S4I/bG8wz9t8fw8o8ZfUfYFkkcZshVbsVgawPYi VyUsvkw8v8aFsJmtiVBmWUpr8AoAZZ/7cYFvEG/azOKly0AD0eH1j3c3t67iXe4Ur9xJWfvWP6 sObwj08uJiHigMwe+pykz2wyfcbO8ARF3zaGOSgZcnCEEVO92fGKv7hZXrQPUqUl5pBQbjOGRi TgM= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:56 -0700 IronPort-SDR: MOOXixcYEV1/J4lyBRhkoD3BrfkuwpVTjAnSNbGauDrQItggC4QoQ11Hy/5dh8cwJqG4TR0IkO Lnow8+4PjvklzXGKvuMnewjdhwfoe2RXCWLLrlvUTUex+DEDozd3vEEbQbLHW3vObVIOGbX5+L 9twd+og8XKgLZTmhzd7AQK5yODOqOEQMLfsU73Gxn69Zp7ZgBbmVcFqWvAs2LM4xS7ajmwhg/x f+DcHorKiciGGPhCff17T/c0ZTt7hWf/JGR8UxngNwnUUQ1TMJefX0ET3IFIG0c8MJgSPEpX7y R+E= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:45 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 09/19] btrfs: raid56: use __bio_add_page to add single page Date: Wed, 29 Mar 2023 10:05:55 -0700 Message-Id: <5ce38530bc488f9d4f1692d701ca7ad5ea8ca3e9.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 18F5D1C0023 X-Stat-Signature: yjd9qsmao4c1cygaojz7auq8muc6x63m X-Rspam-User: X-HE-Tag: 1680109606-685504 X-HE-Meta: U2FsdGVkX1+kAPzGL7UiaPZXH1emiPY3+pZnVL4qx95YbD9qmse8j1xb5BZbCdY6bIAf7cUrkyKeYyMSlKSIg7XewTEKTUCcRkLfTzGkhfhIPgT3yf61HqJHFUB5tPWXmApjPiLlp5JOIl02AMxXM5sOJ2I9xqOm6sdJto750UMxELcc+OEBaYXx0HinnXEx5pu5VnFXyRTmc+mJ9edARUHjlxdEQcGOAACjgULBOq/KeEM2ZdPX1WK1qALEhqiZivrQ9rEwT7icm5aIgOybofxubU17x+sT8E90FGMuqDVnD+AnztYJq1pfgeGZ959SeO7Og6VDzE+naO3tSaa0a22zCuoUUD9okPwqzdl25lCH+qQE1AC0g2IHY3EbQqKY8ceuUvBpLSeCyy8RRfzRAP7opX2D/Dw3eIpMM02KC3lD130H4vH/4je4BF7DsAYrk/CL6bzez1VoCXXodJ0F7nviKnXDFn4mEM9ruyl0n+BytjQALBIhjZcY1iINqr0qoQS3RRUmlVfuZmVSDkZfd7w+Sx9PrB7kwW8DAs8Bm403PT3kXx9ZewTXai4U+Xfg8ov3mERhSiEJ7vv9/Ny0p+jbsFsOfJbYGGJM0eHYHp/1haw2Vg7b+LuTZa0HCWiSlv9Zt2pS2PAd6iKHLRP9zbGbXvUaidSwLQtx5WXpNAyFwTSNwCxYC/pzw+e+UvpWgX/zq27mgDhRB00XPmj4cuoIpNtIYbnbJbOPhAqrJkZA7ysqB49UZOVSnvSR7o3TzEG3Z5y6xItjR79NiKMf1SNYncV3jLEnx4WMJqCDyyWVL89lIkuAfxYpFiayqhPoRQcLtvapu/BwrsJpqjrWg9/hpARNcgXX4PV7ExLTZVgaFKrBayva3LGdLDtdsu9FhuU7/lTgcThRUC4uGZ8bPt0eY//JNxl8TPdhHnpnVopSYyGhXLpK8ykAuaQMRkRV1wyw0YVcH2MvLxUuV4i fsmQwwEw z2o4kM4ghWq4aKfMRZ/EWc6Z/jIfayHGw+MbLnb++iJ+YQ6SORugcZPsU0s49ppLPcw+J54hRBUDy9CC+DZ2JT23FHps1q98Yu3krnVYvNl6W9IxbD7HyAwoPQKay6rdgPUw13diQ722MWnUIy9qxNNDintyURg4e8CIjo9CK5V2pSEkwrDAiKY7oW3gm6EbhDd/RF+67D6AuoslmekMeoBO/KJ7p6p+IFN/VD84+EUQ9AWy0foZEPYr1VVAI+nWRc50JEJRvW7nsfADrVH7Dt3JMuaxYMAXjes0DYqCAKeWNZSKqRlbf9tlXmUpPP34xHPkNDjJdxDvyS1bnDjO7noY20Tyz4GmS/3Q1UQPCs8pfy98ZO5sQOhcALwmUD5+0Bg4Td3iC0KrioUauDfoRl7A0AILt4so45SJi X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The btrfs raid58 sector submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/btrfs/raid56.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 642828c1b299..c8173e003df6 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1108,7 +1108,7 @@ static int rbio_add_io_sector(struct btrfs_raid_bio *rbio, bio->bi_iter.bi_sector = disk_start >> 9; bio->bi_private = rbio; - bio_add_page(bio, sector->page, sectorsize, sector->pgoff); + __bio_add_page(bio, sector->page, sectorsize, sector->pgoff); bio_list_add(bio_list, bio); return 0; } From patchwork Wed Mar 29 17:05:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192959 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 C6C1CC6FD18 for ; Wed, 29 Mar 2023 17:06:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 64788280003; Wed, 29 Mar 2023 13:06:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D17E280001; Wed, 29 Mar 2023 13:06:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44ADE280003; Wed, 29 Mar 2023 13:06:52 -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 2E0C5280001 for ; Wed, 29 Mar 2023 13:06:52 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 103FF1206CA for ; Wed, 29 Mar 2023 17:06:52 +0000 (UTC) X-FDA: 80622565464.24.03E91A0 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id D785D1C0013 for ; Wed, 29 Mar 2023 17:06:49 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=o9st69p7; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109610; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RODw3ACWKxAOhmw0RScWTNQz4RGJcUvFm1DA3dH/iMs=; b=mzYmYJaMFmk6IBDODNoGTk8+fDJ8Ft8HJvOgiTwVFXAg9ur42q/jrhHw7MHAgSsvsShSm/ 5bd5S0agJbjB2uDWEj1g4DwtoSpqqEoekn2mlp7swvQkMosBzhcGBItYDprkqUrn38Utmp BaWdLev+z4g664frvCRNffsgAfjUlwI= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=o9st69p7; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109610; a=rsa-sha256; cv=none; b=WQVGdleWp1HStQ2tGbCd3HfknSqNgtHsfZxRYPTyAvXVY97RY1rma76NtZsYGi9AoL54OX gJJTSslsdbPdFYFRukCemp4vSoRjcmaC1p5Pw0YL7T1ZH9wOxjmiuSXCAhQdSMT+f4RbTy CW2A5igELZ9htgYCKbra7V+RfYqPMhc= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109609; x=1711645609; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i7JyUij1Ub1O7HqbOeYPQInyJM26bTtTnu0sfac9RNQ=; b=o9st69p7Dg4LhIisrR0KMlF4T3pKg1mLJTQnMEw7XGrK8wtPxrVE5RdB y+cJWXOw3IaFNYC7v15BFKxMBlX9UWoe1JExdG18DG0xbABfr14Au5DHL 943NSJutG766/22SkIGFXmkAQID9AWq4ASd5X2YWlreb99bZPBh8BOLVI xT8YF1ySHtGWdgYHvBQv64oR0/8OLDgVDJtHF83C33UWp9nDnuCkr7Ekz 04GomKGyqj4Rbvp36bkEdiyCdVBaMfnEyofv3KoZlZnPzDdcszsgkckV8 AyFt2yDA4/GE84tOwxYHrsiFo3cyjTPA9CbK39V3jS3rQbV+IAoe/622p w==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807065" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:49 +0800 IronPort-SDR: Mfo+4HftnKW2z7BrZAshLj80QV7Ivg8yoXT3TfpfOH09MguaXqXMHm6FV/UeqpoHc61PnHKWHy QYExNg5htyTfJvybZDc0wlabDROvLif4AkR3h5fL9Td40CDN7SDfdu7H09zNKb8HyJwJVIl/Cf VUxZ5HNUm3JyIQN9RNMwKywf3rCTpxoa7PAHXRt5Ctt6d7cicmHrPNRvv8mV3T7nGj51bRAGvg p+JCvTGCe2Yw436+6iGS+D3dyHlDCRB0a2K67OpoqKwVGpKds3r9uUkN8C55zYyN2he6wqjXKx ST8= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:58 -0700 IronPort-SDR: qYm/yHxdWsn4PdNU7In0p9zW29uqLpM/KDDhaShYGqmgAouVltU23pwtiDrLcUkxqLoKGpWanX KdIaI00A9Tcxh5akMv0Mg9mzy1VnQEctwuee7xO/j/DPrFAHW8t1jmq6JmwNycdN5GKOwv9LqD EwWq9gZmEVjS+Nt+UWUBK3vepfteneMD0hPTTSlwc9wqo7tnmscJXQAHH1TYXa775C3cNxwC/g gWNbfWYibYW6ZAMQvInFb5YgbQ/DLueK88vnvV9kIxEJhKmn5O2bRK+Mb1jpC7O7+PM6IArPK7 iYU= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:48 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 10/19] jfs: logmgr: use __bio_add_page to add single page to bio Date: Wed, 29 Mar 2023 10:05:56 -0700 Message-Id: <902f83de56c67b333959d8b8b4cf37a25414e927.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D785D1C0013 X-Stat-Signature: sfi3b7a7jzkqffwz6947ndphq8ure4m8 X-Rspam-User: X-HE-Tag: 1680109609-553159 X-HE-Meta: U2FsdGVkX18yNkG7nIz6yysgWJ9IH6LvWq6j77xMjLvwbQ+wdCX8L3W8WLuqvnhs+k8wn85jBO/K56sc15xr6r9vDc3Yhehol72YCce8j3GNAUwAoo+9e7NcOvnhaDfE0T5H5MWckbz0eizuGXICwns9+7AQLPFP5QSrx0NW6yNrdToXU20/uC1uWuAOpuAaC2OcJ1wdE5p8LSe+Ahwq8XoX4GwlXDuoOJQKt4Rj7Uuw0X9+w/gSg3A1JD21dqnz5Q65uVUZlOhoEMxkbXvCLuFkCwoR1WSB504KXvJdrZbfoTv7aJSGc2EMuGwLkrn2Jmz0TanVCCOh25GLeXKIG9o8k4DqMpCChBEHOQF3aIkvzXS8MiWAdqeNfkYnWtOz9XPGurzmm7mmDeHTCuliZhm6qIsIsAeglmZdirOB/4CPAXdyIg9FJxEJ/XpEjhvEjgA4G18Gp3JNjhmouWGySQasY3BaRRoGqqlmQZN0bLPdMwGc0w+Qjt4kBZmEx+Gb1+UyTFEKyVZIxTMKNFvfnmEDuWFm6RxjXykallH/g5R0REnIsqjpgtM1lPhguDxmHlquKyJdNIIRUBmRzaugaKiT32iLpGe1ovXLClepikzYF40rBKC2LoD0nbia+frZvv9iFxLpXdtfeWMyQHmUDK0lXTaaFJnkCt+v/MbiWosw/eW28UcuCQWle0BQdKHbEwyKFHYfUDINkP11B5lz2HqzhP4IWmwDUhoAsZN5/CDq9VQIjN0ftPoRb34Mf3TskMZzj8Bzio+LC03CmGjk/M9vueurFvC3IAD0OAufhQqYpxpbkcKFYPjeupsP24pUs1x4yWM4WiFU+FG7rrcLLMcLESXv8IK/gxv1MQR//DJRfxC7Ri201ZRio8LOy6mpgyMpd4q2KRR+cbKsYSc86oKHLjXkjYCI418A2YXX21KB5OtvlMnmUjnKEIF98e0vrFi04QFTdZEAE2wH6mk UrSdsfrI T8OOBBX/XMVpFyMfVbYbny49HxzDHLKNpKJANzknnHzKmnjqgSkb96H9gQ1CzPdGbFNnjVM+J2ELut8rZTaDtLQTYok0qJHuZJcpEj69+ZwXsARcLvefVZDE9M1TK/H0Q0AbiZnEMNtM177kPpaSWI1+C7T2RzehIaRlS4jz5p1Ft6QlNlax8/cVdJ7fSyx7CgyMGz4eGAJG6cmzidLgOZz56DR17lyXT5234uPoSx1Q4aJKr/ESNqSJz1EEz/q7t7anaJZrsWL+KCVlTujMm726ZYdKg+Cw18STxCGX4RhX4cxwb5VmByGmsgVXjavkJdBk05EAo3ntDkgArPr8H5AiZQfypXusZ1CSCV8wHiab4bbqYwaRsM/+zdmByjqP1LYSEePN0QXoT2sWRC6DRO+oo3XW5yEMp3c2/ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The JFS IO code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- 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 Mar 29 17:05:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192960 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 07072C6FD18 for ; Wed, 29 Mar 2023 17:06:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97F2B280004; Wed, 29 Mar 2023 13:06:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9054E280001; Wed, 29 Mar 2023 13:06:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 77EDD280004; Wed, 29 Mar 2023 13:06:55 -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 62B81280001 for ; Wed, 29 Mar 2023 13:06:55 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 01097C0C5C for ; Wed, 29 Mar 2023 17:06:54 +0000 (UTC) X-FDA: 80622565548.16.3E6D119 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id BB7341C001D for ; Wed, 29 Mar 2023 17:06:52 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=gx56qiXJ; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109613; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5iM0jkMwf+j1C5SPj7cNdROueGq/ObRXRJctwpKvjL8=; b=UowfMzCNoPIfKHIqloRHzyJZL7PeAvv6eGtL/qWE0CB4qxuzQe+QnaV6EHkpWI0TGI0OUG jvCJArickMv10iW97x7MjKmLTRs+5nS7Pd+41vepxpgD8Pz+vAHjyMomtnk9ypLPlNUaTV o7OmexkdTgVkUZgiiVLshwuIuCIHims= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=gx56qiXJ; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109613; a=rsa-sha256; cv=none; b=VyH80GSTCHZTt/NdqblC2fiQFi7rXzYx1jQ2ICqPPJgLjVnL9Ru1LWYz2kl39YX5WJbQjO GhRU/MKT5L8i3TZBOn5AWVRj99nBRPfB29BXBGPyGjh0f7C3CHIZYuTT9U4SRVM23DuKvi d9F5kVeRckyHTwqM0FiuOAxm7pVRRQE= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109612; x=1711645612; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HVSOyDSmhD70Nv/fkBkDeTGlq4JItHI/qNc4UYNza9Y=; b=gx56qiXJSUySh/uF5RXIflgjm+kw2mHS+lFpozEyx13tZx2bnTQABsW2 pDLglHbp4/a4mHBG8BV+9YiuXLsuA9cVATGj9DYSS/DA4jIlYo4cL5XIP rkx1YH4bf8dCsz6Hp5rJqhgr53W5x1zkNeGAUDgg6HDA0XvQ6S4xw9Q3d egBuHTRBFIFTnzbTwkC4Jkg0reTXmcDT7z4c1eSWkThauZhc5HgRhLM94 WI78+252C81DwJPzImwuPFHeSwOFV7USYSw0vKzP6FOzx/n+u9ATMwKhv Sw7xKy0oXPoqsvYlsPyABMoOyRKKakLVRynwIseJs5WRAFFbF8GB+TS3k w==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807071" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:52 +0800 IronPort-SDR: JP9Gm8ywVMaiEvr/a9f2fQfZtgMbSMlBlWI3ob5WFjAPE2tovFPPROOlpP7k1+xC1ZC0FpSyHB P8CKDIluIaTUep4xXRZ2l/TqFKV+HdnRCmDX4+ukn++2tB10rDO55FImOMwhARH3b78eAWHHSG /frFJKC1Pi09I0hfQPvguDQjqk1Gxe4E1qqdAQm8lVEDA3o8QKD8nFDQhwADtAfPpUzfyfkZQv Z9ox6S2jR7zHw3Q7xjyiqzHNIwaCI8UKNxotBcbjKSiSXy+30tIqviP9ARfccqZOZfFnRnHbEp hNA= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:01 -0700 IronPort-SDR: BQgCe592q5M7/+hA4h11/kqfHityq5CvcyPS2rBc00hC4byMFoMSONh7xRqYNa59BKcDsROUUt MTkgPvmq53Jx71bmK390FtI6XSqL4/k6hBD0d81URBbk3Tt/Bm6YA0CRTta2rw15YqZZnZQclD 83BsLqej3Hs6EnxH5F5Dgte4ie6E3NSwc71KxqXcfciRA6bA8kvbBkRQZrz0pjrsGYBhyfiXmH Sm7ISx3Sy7yOK8htnsoXxQlu9j3TpCWlBVFzghrqQFDWQ1hiGWMf+dYL6Bi+aoFos5RsnY2nEB 30k= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:51 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 11/19] gfs: use __bio_add_page for adding single page to bio Date: Wed, 29 Mar 2023 10:05:57 -0700 Message-Id: <51e47d746d16221473851e06f86b5d90a904f41d.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: BB7341C001D X-Stat-Signature: r387uhicehdni1pj6qadc9je6opmkzaj X-Rspam-User: X-HE-Tag: 1680109612-95409 X-HE-Meta: U2FsdGVkX1+770vej5HvNRlSF+bvTYKI0e9DUY3yVZYVx3f3ojsXwBUA3KX4DQ+mA5ficl0PCC1B80nuZk3LrthHflgu+8TSNhKUdcuB5NxgwoxGOBBObooQe0Ws5wGbDHtr0RcxBDDxsddlb0ZjtJ3II75teqtaC1INYLc2alLUdryBQj4F4lQdipHmUAAZvomWV+BZrKI3eJIYfZeqHW0HfM9aSVr4aE+v4CUb+neSgEOv8Wg9NEbW6GmtDjciufH+b47++LDLwGnr+1+SINL27QstSu3Cs77hq1SNkAy2mGusTXmeg0VBTh+cv4t98CC1xOKavR00n2z95w/CWtq1kzOhXgri4DiuStu7gkIi1NicyEEVCzqgQP9bpqHisCqvyjnyy/E4vB4Rq7r83HvRttKIBmHLR2JS7U8bADFh/+SbjWz5kpfX9Y5JkJPzgiUGeGqQ1fJiGPxEFCUKa+1m6tKFeUTQ2WyLEKMcm4JCmfspuFgpBvJIEYcyXjc18FY2mDBgYRdrJlfLdHoIdvFomjYYzOqFOfLP7hso+kydMyAhRVXPA6FDt1WJzbilRL1PpFo8rY3e7ezymFTZ1k0qCexdAAIFH0ysT9sZSrj/IUGn850LNmVquLGTMmf/n4/5Vnxj2VrDVrI0PecuTj/5okNXqRb9dDWtiascMr4Fj7EckgQWARDwGA7pLTbm8cRpwNnSW81WExNRHYjz/tXtvMKqG6U35NWQMnFz8ODNsXtASyIgsiQufIYc/N8pXBWdBYvABGHaW81NE8aDndKsNzHNQRGm3a/7+/+7oBkCca6tcn33xMd9Vg5GV6qa1rp4PkShozfd+awoGeInmRU1PwiIZ4+8jOc+qv2PWZa6aeYQhv1J54BIQ02GQ4jGOnuEd/L0gn1ZCeCYLYo2KlPbipnfwhZnOY0RFuTMyv0EkgtSV4iBY8W1kSu7wpa2JpXP49r8C2yRB9zxFzq +kjhkXaU d8c3K3JXsbAf5yqSOi2qAUvhdK6s+a8eWYSfNK/K1yQJOFIEAMRC4u95WN8slDMqm0GoXm9jJgxSJpepe4jTzO3Yo9TS4lVjHqT/MRb04yd6IwhQ89FzsKKOjRJbUcLwtY8pOj7aNwzqhBCA3u16A5eMPNlU76UlbiiisNPnfq0RfcjhQwQKkSCDLHWEoK3WpKwUeoNK+dIAuuPBkq9gvtUeytBMNmSgp+SwAmNgteXlpEk+Lv3PvU0lu9uh8ijOVpQOCI8ra6sp7iK0jYTtR1100W/jQodAJ1zdCYEh19TuWegYW25slDE5MTqlZfyUEDPzMAcZZCwBk/plS02XyzNl2rCs71i+lF0BPaxyRUrDSKxDhq17Wm+5Y2EuQlBhMdX7MO/me8cvr28xvg1DCBoUXF2o+b8G1A3L9 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The GFS superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 6de901c3b89b..e0cd0d43b12f 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -254,7 +254,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio = bio_alloc(sb->s_bdev, 1, REQ_OP_READ | REQ_META, GFP_NOFS); bio->bi_iter.bi_sector = sector * (sb->s_blocksize >> 9); - bio_add_page(bio, page, PAGE_SIZE, 0); + __bio_add_page(bio, page, PAGE_SIZE, 0); bio->bi_end_io = end_bio_io_page; bio->bi_private = page; From patchwork Wed Mar 29 17:05:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192961 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 9740EC74A5B for ; Wed, 29 Mar 2023 17:06:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ECF5280005; Wed, 29 Mar 2023 13:06:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27573280001; Wed, 29 Mar 2023 13:06:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C966280005; Wed, 29 Mar 2023 13:06:58 -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 E365A280001 for ; Wed, 29 Mar 2023 13:06:57 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C22BC140DAF for ; Wed, 29 Mar 2023 17:06:57 +0000 (UTC) X-FDA: 80622565674.06.31EACF1 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id A14AC1C0004 for ; Wed, 29 Mar 2023 17:06:55 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=LQqaE53g; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109615; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=S+BFwWLZNY+XTztAeZgIYhwSmFf4miqDC5Fj3p8mNDo=; b=LieddOw3BwZfkbPrMkqqWcff7rd+CZpdRFv7ARgE5w27RbxzOMlpFw5jVn4mhgnG3Th0jH ifOm7ctaDn9muLkTBkrYg90ThhuzEwM76GNPyb1BWQvlH62wieXhUbWAILK1imPUZqcV22 cUN03duOoep01LMHIpmMW+9silPHmQM= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=LQqaE53g; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109615; a=rsa-sha256; cv=none; b=vp7PEvIkxm/d2P2+Lu2fsANm351VnzkowKq3bFYN55wpmB1pQveoHGxxw6idXECsx3XbLH Pg6/guT4J6Z9N5tflAbw9QP3jrheEbTmf+4NoDwBYhoMSSJLN9G7sqmAeLq/lkCbFdOwbE N5kcPFg1pGIgOp564ajxShd71W6utYE= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109615; x=1711645615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M6quq1m4TWQi9osOf7yGXSERsZmThGo4OIw78ZEc0Rk=; b=LQqaE53g6gBGm9E4XjDUtfwMdoznSgky+mtx1L5Dt1HRfVcejyqaxgZy GJMY4eFv3pVbsh+OpMi+H93/iJphTrJ5k6ATxnJuqPEofzB21XTuSkgIf CBqlZXzD1MmMJw6fdt9i6Aj0Qd41/eMgVp3OOzqmELT4slUDadiPiTSu9 IExTpvtzKDWqgAI7AJwIVqEo5cTA1wp43mgyqUr1gPYrLpgtVZx8dKTeY Mu9tTWvu0xKsHMrL+tlNrmtqSzVz47VYRTHm/fV5kWBftHrKVn3IfVMrS otwm9RUd7Jed2G4gik+mLz93XPRU6pv7VQogQoWvPkg+429yK4D+SKn+V g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807075" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:55 +0800 IronPort-SDR: V8E1WUFU2BZv20JPVHB9A2cwqijqdyqzF2gNd6qVZKFmOkAvY2u2MXIAT4Z9Sh2tQiX137FIkV 2FrGeOo/NDw6jPgQJXMv0BR5HypvkN+2w1t8c4t1ckx+1JMb38m6CRlgZgnFrkGS5czV2Pj8Pu pcEhxwptlfGZR9skKL79mYF9UgpTtEytmVLGOLiAHKs1Nwh8rAsp6VoJZGNJvq+Q3enMfQIcdM jakui3iw6eAf1GAedW+dntkA9SRxc7qwPrB9NAI0PyX1KCipBkmRcWdV7rjRb6x3mgFI4BQyRV /Go= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:04 -0700 IronPort-SDR: EfB1mid7Yp3/W8x0cv1xCvTqB4tmpDb7gKC20U950XR4Kv25uQEBdHD2sX3z0ZSLxA8GI0cOXU jE1Ay6UJMQxVqHXD8lvWm2TZROkyzsfKMaMopjdSYaXULQyEClmuQw9VtaHAuYJDBQyPZUJCRQ vKqkM9YtA+Ksasx1R3ikQB7dJRHIW5dQWGWw/GmsLQGP/xKSrev88U8DdNIM9yoEmWmnU6huII pnzvTC1RT/B69S+Qs3+2aJU0lcD20LvjPRlcXyQ/bpLKfriwZ9RZdJzOSPmCY3zHV4Gxs0dMBD Qdk= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:54 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 12/19] zonefs: use __bio_add_page for adding single page to bio Date: Wed, 29 Mar 2023 10:05:58 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A14AC1C0004 X-Stat-Signature: 3jzwseewkmhuibk7rjpzeagshkoh4xmq X-Rspam-User: X-HE-Tag: 1680109615-851249 X-HE-Meta: U2FsdGVkX1/2aDXWzCeFSUXLk0JN416Eq0AI+BGTeTUKWCqfeoilXhSKRRR3i4D9xtPOuyqwzTXiqyBL8qmhldZc80QHgMF+T04zadZmJ24BRlCcydxt0+0TDv1Id2UI/mEZ78ye8y6L1/y4jX6/I7tPYg/SqidDl0MDPP/mi3xwujx228Pc1aLbdFDnL6oJ7YyoIE1DbsqphC7whi39AHGIzIxa3uKhx+6etDT2DhmqWs7r3/0nFQMZR25gFA7VfX9kL0EYhkTJ1+vF5nV5HhldrT67XALVzhasSzFHFaJdgf1FZh9sJCbgOu47BPOeMo4TLISDNin9WjuKYPQ/WslaZpEoYjVUjCNFmFn9x6qHonpXnIKKHb+I5Y+z41Y17kPWYK4xd0LbWyzlI2AoAN1Z1CaS8seAB480mlpeY9TOZbhaAkbMBWpzhoZytqZWAle0h6O0BeooWiGAxPba/agUL22rYxKQouZtFd20CiDCguQCoJ5gyBJHp+ccQZSfOFFmhu2XOsTpfwkHbpzKaAB8q4101rUz4OlpYyjexwEwIcQjTs2ojgVnup99XDdJLvqhGbj7b1g+/ytlgRF8olSG6K8+eoVuJ5n3TY/bR8zZmrh3zqEhYwyVJs5dXe58qOgkwJ73RJZxm882824JBK7jTSebBWffp38qPlx/MIiDPZeaFzzO64KQ0S81taYI3QraQkyNCnr1VMuL/eX+HSobrnAd89eO35kpb5Vu7WzGkpJTcRKhd6WiO8Hr4xSCxY3VF3WcsMXfQE38mYWweSJjQvhXKtmWozUdneOEpKJ1/uvOEloTxtjYImULj/lZg7JxwtwKG9M/KxQIT8Al0y0z8oGy+2OwJ6mNT7O7QPRzIvZmEGEcSjnXk/R8aAjErBfcFnCVR5GlaUttdCyIam99iQc2L1NaU/bZKGwkWDZXu4Zl6TgcxhIbBdrUxsZD4qxqdx1Y6IkKr+TZC4L eT0eMGit ZsluFjNGZYxbWcRPmXZZxZMSR4FojEdU3oNJiMkBjHemBrzkUS0dsm9IFbC0BaBlKnh0tcMRR8acvtz0T48FCcV3EiatiRV+03K93I+Fm5kUFqcL8LVQde2T5x7+xCqB1OWmRb0/tWKGlyFCbdrLw7diDPqz5Vq4jdNCAihlPMRopsPZ/W22gd3AoDQeHPzldd0v1lBNKt+8Zg4XuaL8qRiHRK55n4+s81cJT0XGzcDuBGVAYU4AxaXwpXmw1C+ktsTaIh7RU1NEeZ6n/1duaW5l6xwvuklJNOQAlrNIUA1M9fJyhofc8l6nrMiT2yobUx+9GNGntyXB3K1MRH8LmO3GFfgeE5DKaDGDopzPC3NR/iFYYzebLFKMMSJVktnng1p0R+i4RAc6GtQmlPFTG2HrJPW2JDLGGxMpg X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The zonefs superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Acked-by: Damien Le Moal --- fs/zonefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 23b8b299c64e..9350221abfc5 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -1128,7 +1128,7 @@ static int zonefs_read_super(struct super_block *sb) bio_init(&bio, sb->s_bdev, &bio_vec, 1, REQ_OP_READ); bio.bi_iter.bi_sector = 0; - bio_add_page(&bio, page, PAGE_SIZE, 0); + __bio_add_page(&bio, page, PAGE_SIZE, 0); ret = submit_bio_wait(&bio); if (ret) From patchwork Wed Mar 29 17:05:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192962 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 43A47C74A5B for ; Wed, 29 Mar 2023 17:07:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D733C280006; Wed, 29 Mar 2023 13:07:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CFC6F280001; Wed, 29 Mar 2023 13:07:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B76E9280006; Wed, 29 Mar 2023 13:07:00 -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 A3138280001 for ; Wed, 29 Mar 2023 13:07:00 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7F97E1A0606 for ; Wed, 29 Mar 2023 17:07:00 +0000 (UTC) X-FDA: 80622565800.01.1068005 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 7C0621C002D for ; Wed, 29 Mar 2023 17:06:58 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=XJmPUuOP; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109618; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tXV1PUgRIrS3GQAiD+TC29vg3vg2nyy1N34usulwziI=; b=boGY28xZh29n8lTFDVOB1G+bSvjJeokLDTbl/FGxTB74HaGai5Th7peSFpKpbiYVzeVONb F6C1+rQqeCtTppSlcgBCA6P2A76h4/cTWae54kDcc3Qu2Mdlcm36OZA6AHCnCYGwVH9QWT moG2hOGIycq3iisYiuTGlKrd8CR6OCk= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=XJmPUuOP; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109618; a=rsa-sha256; cv=none; b=EmXWH1FkSpVsE/6o/8vwsKBz/FpHec9N7cRKWLVM0ZL5ywsm2DB5jLlQPhgIDdUrGI5zxv hmLwIwiXDJakr4jG4zZ/insO6/5evPs89PZe4bPUhwB6AINh9kysCRFcmQ5yAR+7lxwhNQ NBZ8t+diq4WhbdEdgHwsHSHAYivxzVg= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109618; x=1711645618; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OE8E56I6ppzvZpWL9ourgo+ma9SYticUs78Dn5RisJY=; b=XJmPUuOPabEiOHraauHB1lIOew/tARlVZPAD7+u9RluFUFKq4/6rfmqP LbRX4FohflpRfhX8omU+cZCtizYXGNfWvFsVP/J9235RTBV2p0JARtUCt WGXvedRAWaEYTMCo9v3l/DEFk494rcWiB09wzF5WIqhmr2JBsW9mAP7bL 17lZPELzNQHoJJpc0LuTqnG+P1jvmSwgqEikzIAnYbjTKprP5pCm6m7dC 3M8OCrmnyM+0UF1SG7YsnwU6HsepZWPgflq3cCQ+fyEmlObpjutKlwZsw 59YbjPf8PQg3amRNdzKkzE57ml7jifcva75W9067trH0C2kA6fKtdXYCN Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807084" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:58 +0800 IronPort-SDR: eh13xZcdQLQ7eLZR+bRZMn6m3Kjo03ZlY2D3XE+OgYy4cQKng366Sjsp79gBqgvvrLifFiwBXr vUKOfRc/iE1bgtOiYC7mYAiR13+wjUMKmcSmb9LwW4mSpgOwy/IcZDho5mm/V4q1gfdK+hj/2b vTkWL2+h9jdLIIv6xhBS0vy+0e0NuJwg9DXXXHp+8urLJVjNioXjg6oIPbNDJ/5QFknhd71Zno C3O/CBMh6jgom1jBW+KbxPfCcKy+xf5Kg5KuEpRwdtSKsMPPZtgDMGnD8Ndm81XYr7t6KUKctX /yw= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:07 -0700 IronPort-SDR: ciCGYrvEid1OWmTvYsKE9LmMoYXjBdNIDVHp7EEL3ugMQVAD8oiGyKQfXP4pYoV2q7+QBMlQDo 1RsU5Av/PLFMD/vk6LCXNuUcQdAkJoBUKZWl3B3KaNdEDeDAYfT/Xuet1ErBvWVzn4ReZCi6WZ 2tTbl4q+GT70HS8/O6AHUfSoleBf84i/l1JKzfYad7cBsXNtl7QFlQAHRj2CC4pi7SD6n4Katp jEWbuwgpWbRYo0gFrtFVkgDJiiBju+mZl9IO/VVqg+QMlS6vkxNs8qZeLGPjVwt4OicZWkznI4 o+w= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:57 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 13/19] zram: use __bio_add_page for adding single page to bio Date: Wed, 29 Mar 2023 10:05:59 -0700 Message-Id: <339841b3b7ce6b2faf56bcaf9d92e298d878ef64.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7C0621C002D X-Stat-Signature: zqrmu5sf9mgpm4h4b4g1rct8dmp35cog X-Rspam-User: X-HE-Tag: 1680109618-274073 X-HE-Meta: U2FsdGVkX1/dL5BMYrg8zXMG/PB59B/yzvZPgubpMuImfcJV1RL8ZV7r/1TAiVSVidWt6O3v519xrWRqmotX7dlYrEZ6CZKdZ51eSEGFyWDcDREq/Fj0T9+5IEUvt+wcLU/O8QfHfD8+z6DfZo2E3ptJJn3CHPFSTe3Iypa5vAE6280pT+mwUhsTtZH6yD8EcT/adLC9vCinZLFvtMI+7qACEzvBLcu/8U4ffG8OVpblDMnwrfE7v9WWzyhZ/tGLaoLHsjs5Pl8kyBG0a8Z54hXahSWsU/V1GpEJpw66tjb9onehrKdvRo5dQq2t/CQXm6L23HSnNn6fTAbdSc0YmJ/lqluV9BXNBYI+L2kmt490J3v4Uf72PFjL4Et9FnjiHCNUxo8ob5HZqIMrzdEgZn2bXFTE/kC/K3OtEJrdie2npYr7YFbLnqNBy+z8pOWZRRqRkUjC8e4UOns0y6lxKAJ92F0tHosWvIPWwRBRTG0xJMq2FpfczAtOD13VH+asHBpBaQY/vTXxSVuSZTiRtPfi6soh2vABB2XLxbRb6lKY7HPm9/K+3f74fjFftgaSxdDuEn5kn3ifvarhL/HEBQjgmvozH5ciAKnCofDSIiAScFYFlhrMfZju3OtGc/iu/+pTcU/mQmS8uHRGblMBq8u6otHhzMsBlhUdVxa8k5Vpp9jHZEmPDslIdYFYNmXUhWMDhis015HEImLkCvBitDqzdnmcSKq7KA8TqY155VxeMznFlPr1tpk/ixmoFzsHmqziyKt8/bxwfI1EeLGIUO7lsUJEuq/zupt+Qn8V2DOisNx/i1TYKwB7Rvj323Hfpxbxc1MzjtGJreKmsQbwdkH5BZtaMPoj9RzIs8zs1cJaHYTsox9SwzJBTJZrov0bedQFM+0DieNXcEJIhK/ZoiI/5txgWFR2cPw0IyWIz3dNu7Un4NoJoNsmVn2hHaIaiTo4aAa4v3cpBkdC012 VcmqPOxk Ryybb9cVm+nGaO+6FdEUiH9fQaanC96OJ/D6dx7XmCVVtIdwW2w5UITH7GizS8S0Tp9HPqHWUB3msxix/+Zn94CKEWkBuTedQpTQB56vIIQSlfvwaiPKEX4YgosjUw6hr598T9URalawAwYIb42uRILg3Y7xy7EGhCRBVSlifykDfzOx3oHKcK3E5JDVVq7NhNWKbMFb/D0OXBe5sdM8UZu+RhO2SYsOtLSSPKwwj/MgkZJu6CDUwPVHzAJppNyX8vaDBJKy2khJqCsxhYkktH04Q+ydxWDNJYEy/YlXpMKCQz8cdOHoNssWCxI5wbpHZ+WaC9DItRNd57bt9dqg3PunM+1U0r+4tQZ7QSKHqIyCKCr4zTsKtQE7svPT2MusZy26Jb+52fqK3tHq9HfrLdkvkjqBudC83/gVv X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The zram writeback code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Pankaj Raghav --- 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 Mar 29 17:06:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192963 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 215FDC77B61 for ; Wed, 29 Mar 2023 17:07:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB484280007; Wed, 29 Mar 2023 13:07:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A1694280001; Wed, 29 Mar 2023 13:07:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8903E280007; Wed, 29 Mar 2023 13:07:03 -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 74A3E280001 for ; Wed, 29 Mar 2023 13:07:03 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 546EC80D4A for ; Wed, 29 Mar 2023 17:07:03 +0000 (UTC) X-FDA: 80622565926.30.AFFCD53 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 46CC41C001D for ; Wed, 29 Mar 2023 17:07:01 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="kXLB/kNC"; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109621; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=v9JYsFFh+6NfyNyVYGuW1Txk804ur9V9DJTJVqHfYm0=; b=QgtPgBUe3MqrvfRrFWLj1m2HDgl9+bdoPqyxvPiYke15X+nbHhpIlh5w5e4bCvLAOMhadP GWpJYPzFSQmahPV9sDiJoqYoa1aQHdxCfkoQJqRxGX2DmbsrOhpymcEQdm8vRg2VdsE1Nl D+f1DmsS/OlGqvJdyPJcfa1afhHsUJQ= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="kXLB/kNC"; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109621; a=rsa-sha256; cv=none; b=U7BdI7511Ju8NYs/SXWk+q5rkhjAPxqSeJP1nLrjbioC//xRHGs8OGJowJCxKyNb1e4VRw YvbKY7zKgH+yy7FRbliYTwwm1ZL+8WHdb+yF10ajmlxtU3KFylSch1i+0t9Mi3eUqI5sse hbKk6XgdUQf5imJaHanupbmHrd0npQo= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109621; x=1711645621; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aE/Ow89gy2yLxstCkn4viK+sWgyzq7OT7iYTFC2IcIM=; b=kXLB/kNCChkwkoR4jQ9Q2t2+4L6xEXJ8Vcb8pp0eys8x2yi/hJzhRwmT +vffJL2XWKPXabcNsB9haBvHv/k1Tn1PPwcBKm9Lk7Ml+j/27kqBtQZd9 w2LzCOfd6ay+HE0/pMLyqejNsVXxKHP6py8Z6864K6oWZ+mEsU03G5xvS 7pGafJmBkEfEl5kisTR4j5P+UaYvhQlOi8wzFByUtjKuvp3rIMJczingF aGa2ELIOPJI7QSlgVZivY8rQ++RyNs68ZjyNHrwLClPOmKCmwG7wNy3SG 3fZ0uYzlRJ6hfdqJmjToSEMohBdvr+hWJRlvTPyKrbO4GpIIWjZnzYHFG Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807089" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:07:00 +0800 IronPort-SDR: HgHr8TOO8pxRq7AgzO173/R/FRS4yMO/IenjksMKFVGFrJ7+MMYbo2ybnk33qf1xEs05HP3dsP I15mV2HW6xaMLC0C1uumPVRIBXsBqso8/9ZP8m3LrYN7b9X9E29+qf9nJDGddR5M1QmLmViCT4 k/75MQvh5RsHKYsvMpSuDasfR7dWf/Uyp3UQv0KAcgJB0qKrg3CN+s0sT/hM/didRDxn9Z3Ubm TfTbxut3CTCl2trHFZGSbeaHyBDxPuMRnyy/7szCwEdm+X3Dmr1LUKI/jtrvHUqMfc3+kJCe/2 dkQ= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:10 -0700 IronPort-SDR: U5CGYwW7Mew4WMH5XhHkS/wuvmKwsV1daJfGn7mZ+KLy/D/2KzvAdqeW79QUzxkDDWCslNWS+3 hfvcVA5xa6rhSLDzb3KfH/lUhdr07i4tMiJaXo9yDb7M099aYD7m8SSm1/TGzyiWeuthdMo6G4 1dqWHhFwukM6o56/rWlCzBDM8Yn4tgV0RKs3pHn6poLpoeq6m4TkzOJgNZqdXwKHDt6xdkbOI+ GotM7nHfSGcs2b2MrRQzeYXxRBWgESDZAFW7lZj9grqtdnnN4x1FPIawAtJPMCytnEQx+jwiWl t5c= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:07:00 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 14/19] floppy: use __bio_add_page for adding single page to bio Date: Wed, 29 Mar 2023 10:06:00 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 46CC41C001D X-Stat-Signature: u8yfz99bwb398nryewrt7zyxh7sss4sj X-Rspam-User: X-HE-Tag: 1680109621-50363 X-HE-Meta: U2FsdGVkX1/oKQ/vhRkQrUIOIbcGFcEMx886/h4t+FJVAZ+bAfeh469HujImiYKvgQkRcxSDgs0Erp1rk6NWLVsw79N8hwVbP/ijH5we9FAAyAYhcutASGkq5RoquqvMyXCm6n6Gpv/Ig00NiZLwV8pvgRn2VK3ZTqBEkR4ZYea82z2p83D3W1cl8hiIgqEi/RUidrCKO4bjfxQSm5dcUg4CFiUH9Uw7xOsdO4fz23/eiwAVqM1u5cQ1mjVTF9mRU4gIsKEmfbXaGh04WANsK4WDcCt+3AGid1URdwUCmRpSvgPjXhWydzc3+AVwEo9TnaQq0OgbjRwjK/IPUyNtn6Px6TBRrSD1aUuAiA4DUzsnRUjfl1k+e9AYwOYiL4HZ3BKgmiBog5DGf3bWY92ZOHkBD3jJbIoarO8I2Cg9Y66jclmJq1M/m0ANPBc/GPC+szyAYLhcPa9joawCREvz60nCvNLb8FS3aGuwpSZYrwyhrx8bh1VkmmH8NTVl7Puni+yGwHuq9SS73NczcsamdX5IKtzwkfkOiBBYDSTXBEiKpXQJ2jCawC2brLDQWxJoLwCw3Wyr532YwcgTHu8xe0/iHP/08/qZ1DZK2yuZtpHe+7ECH3QnbfKaCsydRH3F95UQasRKOdUm8MzVQCirspJtBSCKoWK7b60Y2mbVWzOv/FfCmMvUGqAh74h3SX/sKLpWJ4HRYAlKERjHnlTzP1gG7K5drw+NfPKYXM+LX1m0U9ClTMVxYCa5Mi3G963xNUmw7Bk8jRve+wbm/CptNqO2sslcUvS5xpme5BLiSYXIYhessaHM1QgZKyLdboQgzCW/R8Wr+KX3oCthWiR6yJB1nCFqzj2e6ScJVMyqIoi+uftKIj7HpdhyuXbsPaCIa+mkM+m7+Bs1YpRkG7WXj4DyPq5AKGHxQ2hNFpaaJbDWZO4c83W4E9i3KKIo72x3tKs3ClyTovkO8l1KJzF rjtHQQ9k geBoJhL10Co3+2TvQpmFT6GmopDu7zE7/DBqlywJBprByOEj1kMHpW49VDp8WUgzcOetXWZlkrZ+HpU5DmI2o/hOUWwitjpKfOh31iDCLo8QYia6jbcGA/e5NEkxNlIh9kIBlJOCfNIxuddgVb3OkR1WYbNCW/hRjl2WmUyaXU8jLufgprLKC/JBcO8OGw+XF3w38StWf4kRlggvqvbf5mYpIUzjHY//OZ9RbuuUxU/7kDg3LaXIUdSOcn9b840EqPy10CK5IUsYxFLTCwPBf07Ea8QYUFikAtt0zGZcWcOExa4ZCtqwOzCz3a959r0xrM9++JBDz4eFpy1pTK1QrteJgjcXYxTm2Rfi5kzPhapZON38b+1be38UE2xe9NXBkR7k/1al7wQx368eTw6PskcmLXwOPLhAX9+IJ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The floppy code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/floppy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 487840e3564d..6f46a30f7c36 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4147,7 +4147,7 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) cbdata.drive = drive; bio_init(&bio, bdev, &bio_vec, 1, REQ_OP_READ); - bio_add_page(&bio, page, block_size(bdev), 0); + __bio_add_page(&bio, page, block_size(bdev), 0); bio.bi_iter.bi_sector = 0; bio.bi_flags |= (1 << BIO_QUIET); From patchwork Wed Mar 29 17:06:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192964 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 2E7BBC6FD18 for ; Wed, 29 Mar 2023 17:07:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC5C4280008; Wed, 29 Mar 2023 13:07:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B4F45280001; Wed, 29 Mar 2023 13:07:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A1AA280008; Wed, 29 Mar 2023 13:07:06 -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 8581D280001 for ; Wed, 29 Mar 2023 13:07:06 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 657781C5FCA for ; Wed, 29 Mar 2023 17:07:06 +0000 (UTC) X-FDA: 80622566052.25.94DDE25 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 26B941C0023 for ; Wed, 29 Mar 2023 17:07:03 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=EgCBgxyM; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109624; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7+bIXF2fTdL9cWuJDdsLfpimmTL4CGHXMEA6wqfKprk=; b=ZrgziG+boz3wzJxTXhcTyTfxDy4l/d0AQ9tTNiUB8ngL7Cw+IDTO+jVKt+5/OMiN17v2lb k8uYousODQbPYpdM0QtY0o4EY3lNsQ4de2JP7LT3NbxsmxaK7Q1AdN9vYylT97pA8rAjQN Gvgv91RrYT6H3564qsOiBC4xUPhHpvg= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=EgCBgxyM; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109624; a=rsa-sha256; cv=none; b=7w0fu85VGuOLa5UFY8QGtfHUgt7flvvkw5KfaS5bgqtFdAtViF78ZBms/RgtRJGutfQwcB JMSDeSijz02eAAsBeyBq0D90izOPQy56X6jVG94HYfN/iIoE5d3TxD6ZMhrEcdEvlfqh9k cPonwpPyNrowIP7vDRV8Y0ca4Zdxfns= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109624; x=1711645624; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iZ22wN2mWRIC3IC0ve2ktcoeKHTOmDQMcv9pQZAGU1o=; b=EgCBgxyMlR4FYs0ukJJSuddfO6RaDKuG7lf6849jDs9tnqcjFsz7TwKG TrZTkTRP9uEnoQxMpig3Go+XjhkRKdBfVhpMlUkuV9BXFM/ZVM+OVsUjw gVYUpShwjJxJb/6PWQSSPY2lSYzpAWCiGZJqLQB79N9KskFKaEugSCWq5 0Q2bHUPJRHVIpVAC7MRszt9IMPS+ySZz949lkklMIOCixdQnCdK2MMZTX C4BubeApmq8golWZHXjlOZnOYuXNKETgnWQ8Wau+eSOMPwnbfnzktWD6M 6IW0fVfPc1V/mW6ahXICrGQevAqIrqY02Aa8s14dNSE80B3zzttzzGMWV w==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807095" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:07:03 +0800 IronPort-SDR: CUw4RwikyCOGiyorA97RhV8Uxj9M3K7WrRlJNKAyMy/YrkKVh80qU0OVX0StaxZQbzuMj550mB N9nxoq1zfoPtWsSyI2sElNVxtvol/w8nPBvYvtfGoO0wA/uj6OyxbRVetsXziCIxYUvO2aMyZu rIKCC8seHzcRciFX+BFnkcxRCLkyn5m8aiKcjO0StPPPjNHc/t+HASXhQlQJRA5tpFzWyrbpx9 nHOlHTcJaRcgD+wQqVYXgyMmNKMKfzlm4l0pA8NMsD2tlNlnrYLzSt4JEoZ8O7aAnJJIKJBYlV AAQ= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:13 -0700 IronPort-SDR: QenhUoCI4gCJokChYIRTxR/AmeR3KMt0i9Ax1ZUEuOE55BQNPmd9r5SN16Ch8MkiJkIpZRNt6I qUqUWECToDJ2WJWUpGDVQEaikqB6uT7pLfViFCRAcappfhtVNCd/noIg/ffVrtgTFQXaHZa2+9 qvf0zarO4BdnnsxEfFyvXa+MLW55EgGw+iqxyMy9lk11OGTrZhPXyK+RBxeQV8dZU6/1rjQcdM 2AqTxj/IU9pm/2z5SJvCrEd9J0iojU5OMLtUdmwaC41nSBL3uay8UbzV0sr/esbq/6zIeGVC7M m7k= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:07:02 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 15/19] md: check for failure when adding pages in alloc_behind_master_bio Date: Wed, 29 Mar 2023 10:06:01 -0700 Message-Id: <76f5748e386870c034b46e919101a878b87a79bf.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 26B941C0023 X-Stat-Signature: e9bq955numjchqa15rie5m3p64sj6a4i X-Rspam-User: X-HE-Tag: 1680109623-778320 X-HE-Meta: U2FsdGVkX18ldf2ql+p3IguCl19nufe25ifTTFQQ+gv+mATHV3z+dYjNhSl3J7VrjaRG4ZZCb0zK3ea61mLkZd9JYBekb4gcT4cpPJfDNV8yweneL1O1gEN582JDoxba+/OI+07wL4xh1L5tssPTwxWhiscwtHHMPysL71EnAo0QQ2qmeoxPzR6Ha93ZzaQ4O6QPfNIKgXd7xsI2dVKwTpADYFg3hWHgxT5iOG5krNAGDDRLeR5/XQHRNjPM1LThS+x8Eiq2tDsGicG++3E5R0gau5pcOQvqlNxIObFtqf6MuIGDA4qEehqX0M2WDA8k8bB3mnafTdzkCTlr90lBdtHnQsVq+TT/zQgHEcJV3oUcS7lKmVpCnnCOYXB48Q8N77wkv/bb8zfeH6RdaVwjYgRCV2TgHoMlLB9o6XRwYmYESE3o9J+UANiefp+alowOXAZebpn42mUD1tWDkMDrxNWFngUexXpo6gM2DLWCX4s4aS+yBqzbcyUsgMqJqj5IcjEZBWJmOUTsJHtK/r0P4nYMMHEKsVve4g+Hro03D26regNoRaszoD53o7pdzmTIMzG4OyV4x1oEXchVp9poDXV/gcInqyMDX+RrMncdWOSLNB9/4d3vf3c16murQAB0kbf5G032kUrmX+NJ3/vXjumjzSsmi/Y/5XHM/pI6SgUVh68RlT3J4jtFkFICIjngqeHodFW+q1AQ4NDN0iNPsnqFXUw6zkn2a9jE3fAo3bv01eH6vYCROqo6CzDo/Elco4P00eDtws4B/lQjDdrQ35fKcdeXr0yK4UD8ubP+q/OEujfb3JecMdNouQvuQAiqgQKKKiSWyOnGKurFC4NIEzFqgBpeoyfxdKGLbKNrLS3O9pIwhqh9A16BIyt88Grrb8ZdOk+JiEJqMyADBT37uLr8Dz2+kQBEhHsThOWM487U7IZdcZDprYh527bGqvL17UNJJvM9yL9fuYGBBv9 2nqg1Ys6 Oq7my1qovRuzsbkXaSJ2qOIzbJjQy0I/qG+gmN6SLkL4wUnzQVU6f9+f9cr7p0YTz3PzOWn6349tiOI9jMQmcdhoXmzQUA2/oKl9OPmgdlTfW/Laja/ifVRaHOffTZc5FP68s5SPNs9AkOIYvCtOFhe8AKEuzvr89i0DMhDY+sQ9LE1HzAj2u3ticIQmu2ODm/Bh/NMkAWsmSa1TmNDwir8te+Xyw9y1PPhyFqxbmoE2N0yTSvTxYhwm4itTmE589+l1LfHY3tqaf05drqyOz+pokLQrxbT9bDCEDlaD38k6wU2rdKcm5au6Hw+OPxODFiXd8lqdbyWSiB8fYcLlxC1j/jd9V+w2IQHZDKn1QEMSu+R0aWbK0rd27f8i7J5VeO44VriOfdVo2pjGkDP9sA61emqr2occ8oFqIbbXjCszDSuGsW4x4aB7okAundHdBbV1V X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: alloc_behind_master_bio() can possibly add multiple pages to a bio, but it is not checking for the return value of bio_add_page() if adding really succeeded. Check if the page adding succeeded and if not bail out. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/raid1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 68a9e2d9985b..bd7c339a84a1 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1147,7 +1147,8 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio, if (unlikely(!page)) goto free_pages; - bio_add_page(behind_bio, page, len, 0); + if (!bio_add_page(behind_bio, page, len, 0)) + goto free_pages; size -= len; i++; From patchwork Wed Mar 29 17:06:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192965 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 BCB7DC74A5B for ; Wed, 29 Mar 2023 17:07:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5841D280009; Wed, 29 Mar 2023 13:07:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 50D28280001; Wed, 29 Mar 2023 13:07:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38744280009; Wed, 29 Mar 2023 13:07:10 -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 2394F280001 for ; Wed, 29 Mar 2023 13:07:10 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DF17B160DD1 for ; Wed, 29 Mar 2023 17:07:09 +0000 (UTC) X-FDA: 80622566178.08.090DA64 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 1D4311C0004 for ; Wed, 29 Mar 2023 17:07:06 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="g09kJni/"; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109627; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=wOSVNAp03D6yJbEXU5lvzsL+Loo8YVcL8MPqkfE/PTM=; b=yxbKKqKVAZQvD+a/j2ynZBSHHPnodIfoEFOmb5LzoO7Yg33TeaeoJW7/jwhp4vif94C9CT sUjsiui7N5J+ILGnvVW6ptUI+3Hp3uB/1CgegYVejapHzSMiur4Y3snQKsj2Dr7i1j7bKn EPFGZijOzN+qB57z+8sC5Tg0P03bGJY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="g09kJni/"; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109627; a=rsa-sha256; cv=none; b=ZdTxnDM/GrztaFRC0Tc71uP9B1m/yt6ef7J4yRTiqkpbHX2qIv+VydE98cb3lxuhw1mYJd N8hhUvAy/XW36Ydq+azQgGDaQzCD2sqTDJayzrQN1wSgL4dv2RsHaRWn/0ZL3U54YUgwL5 JgIN7Z+LXBql8O4uIRpBfKHsbUvfH8c= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109627; x=1711645627; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tkkYPg8owa+F6WBdgLFEdkckQq2ouOP6tkr56Y/Y4Vc=; b=g09kJni/YGMkXouPWjIhn7p1pnauVUNpzryO3UTByDCmvfatlq+fvOxd WUBkYOsxY1PSUc9LrWHcuTAuOV0QJgNsAdu+1jiWnKuKfwwE+qSmtcBMP r9r7Oz1gOglFz0a40sa7dJO2c3xsnnmnGO6Ycou8ATc8hdO1/3UYOAcko JkqxJ5dFsNoNosK8J5lKfqLFdaoFi4/ks9AdINW0zW4RgVyUNY1P2GfI+ I1UVseaSbRfRGoPhDCKADt1NuoTYp7gMXYEFrKNc0ED0NadzWc561tTxZ iSPz1Xj85FHI4dqzL0YmAFRKwMUBhshzPmC7bMTWxBncXiPaZbysv64DH w==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807102" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:07:06 +0800 IronPort-SDR: nV5jH3HwWhUHTm5AEWplH39qP1D1y+wFxMMFbVrYOApvC2BXJK0JYFWpfGTzF3PEWvPxff5Bge Ajc129xQX1um+DPmE+AYtLdI0cMo9ncFpzqM2bqsiTpkYeg24zSkYGVuF66mZ1HrFR08MPrxBU wPa3APlUVdhEba6DW6i73wslkE17+kHDGq4+TFEO3JvISBJq1MbAWI16oapToE1FzMEDD/ZoRW HmIf9wxz8uoaDugV8eMStZ4JKvSfSa6bCxSU0Sf9chgKEcNGxNBl7woZUJzk84kr1oe9/w5OOd WJw= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:16 -0700 IronPort-SDR: BtjkC8ComN1O7uUI2Q3Yo6aG1eA7nqScdNM5LexHUYipB8t3szY5zi2i62F3kkpHkyVnHuIOGM Ek1ZitEwQvILodyDt/DD/P+4JSQ4FfZCzk5nYQwqhwhLdGUxHoidj3oHzHVwykM3dzMqWELiYj t3kpcItSpp4K3NBCUe8+FOUVxWGvOPb+JBxKANt7O1k/TIuS3Ep1qDEGkSLpmmBcrzqjxJn4El 2r0OJA5Y8NchSO4KSKjNHUAPoqdlwW5gG7Yff3aztbuLDzUEUgexB49y05wzoFymc9aBcG688l mnM= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:07:05 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 16/19] md: raid1: use __bio_add_page for adding single page to bio Date: Wed, 29 Mar 2023 10:06:02 -0700 Message-Id: <8758569c543389604d8a6a9460de086246fabe89.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1D4311C0004 X-Stat-Signature: azf19mcenu7sowye4kck3b5aanmehygq X-Rspam-User: X-HE-Tag: 1680109626-53508 X-HE-Meta: U2FsdGVkX18XjdQ8h58SIs4Rv+IE7GG2P4uw3edBmwIiGLQCfm4+KU4oz5HW2aJkXHcJ0TK6vXQs1ZcdpmIrRDNlhn0vqNz98UWQSdaffDg9ZHZFWK5Cg7hpEOGwNfb6+GdSxzs24WGJioMUfhjqdqE9zfZdMQMLxU7oLoxMswX/2SVcBrqYgXDa+AzJXJ58FDA9CkdvW7R++bAEwY46V+leslWMoxwg206IWAfUTuWbrIkoOxW0GNaCRPXIvBXTm/hf1so8XAQiXFZFTD9tvuZZFcqGxAB4RtL8lrinooMJkUayQn1ZSNru707miRQB3vReHwlHRvZK1SyYNC2FsdEbB8DnWDZLRsJ+aPUI1xGnTli4e2Hexc3x9sHGn+PGMFzTMmKb+jt0aroiakHpzvRhpxbljC43S34IIF2GWVPz5c/fOFiNAfeuEx+Wt/BrspaJVncB6deFmtW+FPgmRWu7pp83EUK5f3qfBUjrHoovLykHfaVLMIQp68Sf9eEdLOIMHpIKx+/pwNQSSxoJaqgZmiNyKuyAulMz8lrXlUYAfFZqwmLGgLhU9xrpD55YkuFjAHCorZram61CkrfRKFfKgPQ8YRAj+ybvaJnDWfTG2k/QxGO5ezQe2yfVdkU9J+EJX4xpAMERtdEAgdNWYN6qqT0AESxIei/KAJB9zje7YG/HXk5NJLEuAhfEH+zvufhRlaoWB0YFqNeKKvIFW9UXuz1N3pwMdnACNkDvOomrSxfUfYhaA/pk1K1pjzPYu1yd4ct09LYkOE1A6enqxzwZDow9Eo/9BUM5Omtq/u2yjuTEI8JEyf4YKDdwndo9w3/lG//wsjLgL98qpGAGRCb6zw2Iv4b5m/E0QeAXObmqDNAP5Ub3RQCr7fExuYc4cQCcU0YvL7Sj8Mi4jI10FEdGZ35C7UkO0SGKapAKRb4qJY4JLgaWfzCu3CDZwDFsCYuNQ8mmYNN6Iz7CEsl Gi802JOG 26P2HkMLkCQUOQdYFFEwg/hJNSzQbHc0w1/I+OzMnqH+RJGpK1B9e3s9MdedGkNJLg4mUegJhxvz+/xlC1Wv4b7HIw/PvDY6f1k0Whm2IhU8ngrW263N860wY56qES9CvIPur3JRxT35HQatkYBM+8u+cmDQJr3v2FMcSWWxPacP4O6BG0svs2AV9zyhCYDzTe8wnDhMHn9xmaD9acl+Rm3Tq0vw5/hzDM4pY3KEjrjqmczsEVOLczjD1f7gZKOvSWHpvnl+WjWdBTMryKVEpAkbuTb1CjYopV5a6O8JuOR0blGh1WoccGMeiO4m9Y9UUjXIit4ASkiFIRcZ/k8L+wV98oEFA8hrZmPYsdSlCCEh+dJZuEU7CR06Mv1jx3JNfmA308WpgbsoKalYQa21msjgqXHyIVTW6XSZPMe8Dw2h7bJj9HSmhN4QikT2yAJBZSz0U X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The sync request code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/raid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index bd7c339a84a1..c226d293992f 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2915,7 +2915,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big * enough to hold all these pages */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); } } nr_sectors += len>>9; From patchwork Wed Mar 29 17:06:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192966 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 09983C6FD18 for ; Wed, 29 Mar 2023 17:07:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 906B428000A; Wed, 29 Mar 2023 13:07:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8428B280001; Wed, 29 Mar 2023 13:07:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BBB728000A; Wed, 29 Mar 2023 13:07:12 -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 5513F280001 for ; Wed, 29 Mar 2023 13:07:12 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 04C6FAC327 for ; Wed, 29 Mar 2023 17:07:11 +0000 (UTC) X-FDA: 80622566304.08.0347A87 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id D42361C002B for ; Wed, 29 Mar 2023 17:07:09 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ZIrosxpG; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109630; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BpRyH3T+b0hPPGGNCaeUc0CsD3++4ChCfoIiS/mbSiI=; b=ypiYYuvas7g2Q/RaQOlyIRQzD3seeGI7DSUafwS7S3wMtlHFRAfyhvl6sNl6K9A+MCADZ+ yD4/TUiQTsDWYbcGnP19tEfz4jtkQNceDPfJjUWIPirkRSg6eoYvp9glve9tx+3JvDPNBN 2EScuZQJo6ToYqKJFKJEZCawPVfJsFc= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ZIrosxpG; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109630; a=rsa-sha256; cv=none; b=vx4EzkO6lig5uflixw8us5YEM+nFEObn7RZUsuP3t5T2jEYn+QXtBX8x3VpZYys+Rt0H1E Jl11yASQ7Ta3xz5MsPNyZk9p+RRZocVWMP+yeCpa7Z143YatRvt5yLVA1eYxa9pOXeaivq tapPx2+/cYWUpWLns4v65y8c9Fqx9NY= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109629; x=1711645629; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I1IOtKJu7Qm2q7N0lw4Ylfd8zAyg7sJl8PUDn+a8a0Q=; b=ZIrosxpGG7V5WkgkT5DqWcZVQyJFRK7chxbgT8bC7CgOVtNtu8lWSq4W MSoRZJ4cx0+NIfk/O09nYoWU+YhbGhryswF2I4W6IYdOgisZqmrE5s5dG onH+xMe+RBBlfCblZbIA88dcIyxf761apdzqMvz5g9yAIw1IasDeeesYa Qf1EClgN3XFVw1cgm+WSdnkk3p2bdqwEDZOl32Xnt0TwemRGqD+HKfgpW 4rKNqpQV7BZvInMA4fzycYmV6c6YijrDUBOAYWLHq0Rkejp151nJnljca uoviX8IKM3dj4FJHWzRAPp/KYTL860zNkRsQZK3gFMRpKiYMJt7jjfKCo g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807106" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:07:09 +0800 IronPort-SDR: XUrHDAOl+hVDwOhm/UdyQmgt7MOB5bvbRY0w7gaIc4PtiKEMq7HNTQg2AtPSLfjlgSt5y8/VCx fhGWXBIoTSeJzZNEjdMH3T4K2lOmOb+OSWN6atrT4KqWIxW8dCqUkatmrnuPPNC1JJ8rtCuQbE eU2vE9exIfREON5wV7BRTtDB1YXGb7pFDa09X42/G2bz6SHgvFgD28ujEGsEdwKnCODJ8l9pfs LQ1dOKT+1hiZmvoSEteB4jKACeRBqzb6QGCzr1cA4qPVr4WLYvcXfvFc9U8e4/0k2RP47VRUe4 HYA= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:18 -0700 IronPort-SDR: viCEK69jTCbLVPYfSPHd/6CBJALlqph49HjUR1colbGaK0Lgbfrebvo8dwmNEmOHMHTZRkfRQB vvHWoJpYznlCku1pvW+JJdGG7HzrUkK08/8VC9+32lQr+nLMcEMoNPch20WVqgI3us1Vxa+4Ca C6Ko1isbeJ080GTeYV4qNaRBsBV8XLQ6lMr+xyFq9eqWcHMYCbmZbt6NVCkNrT5F3zDoUBT4ZW fFd3cyh6qwWEcmkuDYxsFiuAvwvdEKoHMo6Gz1nS4Cl/UXPxkpMxZvew6C33popOLndwg3upAA xww= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:07:08 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 17/19] md: raid1: check if adding pages to resync bio fails Date: Wed, 29 Mar 2023 10:06:03 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D42361C002B X-Stat-Signature: m3tsucoymizua6167zknhtoy89ed3ffb X-Rspam-User: X-HE-Tag: 1680109629-263853 X-HE-Meta: U2FsdGVkX1+n6y6FqSaWepIGlLFGR+QW+jVSeHSpIhd/5vN8jI3n9Tf830gSsuqrA9zV8OYdwZilwxFiB5wL9vUu5VPE8a+SUF+M1aK6LM326DBDw9rqwPNrMaujGpdySPlGszbiTJ78va4m4NpY/7sRaBDK5QFDsNHi3J+K++AfoU0HRcAl6WlUdZsQxYpIGsoLQZJxUVPZNkiEAmroBLA1/8mLMRTOxoq5STvFRifin3Fx8FWCMuC0h4T2Ot889Y7pj5Pg0A1g+yEVLj2k79gQmZmLvj9A4eflWZdiy7IHw+6LjRCk18PkmdJ09x9UofmZxiz8FUd+7Im2K48HQ2l39JF6Hd7WldU6jYjX4AFdpRc81FdKsru96fUC0h0ssfolyeiawHSP8k4G0lQJsaL7g/VnG+Fo1/6PZnAs/1baGAHycwNbVlI9aCltaVA40Gh7zTws4RwiUIDlHc2MyN5MoCJumbUkrTv3cLmd/h+8YuAhqQOC8YtCFkUyDwrUo3pFCFaSoNUiJ6Wr+kNTIquGRDn62dGQB83NBgNgGrUzZcJmGAVwp5333/2DVCaSC7cJa1B6YCotPJwde82e25WL3HWt4rOC2SUVMZaCNjPZ6cXmjmq9I4G5meJKYz3SULpPharMdJEuOmAAS/2gnY3huvgVBU9H/vx+Pa8XNLEkpuwiuwhCI7/y1ZzTC+bxGj6WvrqEbjinZTmEPTitgBZz+IIzdjjj+qwWP1mUjGLiBEovAiO3Oc8NMZHQhDECtopjZ2DhsXdK1J9C63N8Vt9CSpryVyTzKtUYsQf2L3al3qywyFnf8sIi6PHedE9FH21jXu7jdI81oR5wY3WW9vHjKP0xdl8/H87wHH6KHRq4HPwfjs4R1NXwDDeUA2priRjbQkcrYfOOeXackM81sMD4APpQIrEzbuR9p0K0rL0hCHS5Sraa4aYHpQug2l8Dfht7Q5FqzXI/ll4atpD 19ZyhzCC GrsKvQQetWvMttPIhB9VUbxBjvFe5M8osk2CHj54dXEkVsOfqCKujuYSeCU3E/XWpf9d1n4XFXFbDNsO8b0ntIcs75P3lO+bNKdWJpddm8cM90NrUGVjIronTH8aKUvTu/x0QNVd8AUE68ZzpMfT3fk5hwN6+Gf0N0VPuP5/qMhUq4brGqWHpDXM2wWPGYD0kDQgoUG6aFmO9W0N8IDwdaPk7BgSOf8G8k5gImCKhAMRnrCLNopFUF9hei6OSsaZ3MnCkIh6L4R2J+O4BMUcpv8NIf0Iu2F9uLqeUG3yVUNH1R0wTrnszS9ntNI16rRHGWNcm+IooHF5TaQh87Ns75mpMZlJfrY2aEDHNqpPvQ44PXRe+lOKd1uS7KQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Check if adding pages to resync bio fails and if bail out. As the comment above suggests this cannot happen, WARN if it actually happens. This way we can mark bio_add_pages as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/raid1-10.c | 7 ++++++- drivers/md/raid10.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index e61f6cad4e08..c21b6c168751 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -105,7 +105,12 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, * won't fail because the vec table is big * enough to hold all these pages */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return; + } + size -= len; } while (idx++ < RESYNC_PAGES && size > 0); } diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 6c66357f92f5..5682dba52fd3 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3808,7 +3808,11 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big enough * to hold all these pages */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + goto giveup; + } } nr_sectors += len>>9; sector_nr += len>>9; @@ -4989,7 +4993,11 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big enough * to hold all these pages */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return sectors_done; /* XXX: is this correct? */ + } } sector_nr += len >> 9; nr_sectors += len >> 9; From patchwork Wed Mar 29 17:06:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192967 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 5D408C761AF for ; Wed, 29 Mar 2023 17:07:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED2FC28000B; Wed, 29 Mar 2023 13:07:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5C25280001; Wed, 29 Mar 2023 13:07:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD5A328000B; Wed, 29 Mar 2023 13:07:15 -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 B9A2A280001 for ; Wed, 29 Mar 2023 13:07:15 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 95E8FC0B8F for ; Wed, 29 Mar 2023 17:07:15 +0000 (UTC) X-FDA: 80622566430.14.3679CB9 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 613E81C002A for ; Wed, 29 Mar 2023 17:07:13 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=Yr1xDxNL; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109633; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=upu32c8Yqy1t899K4t0IfOcHUkkaZO+LrWd5EvSYkRw=; b=EuplyVrgnTGu/7NbBeryh5DxcEh+pKUY/cLZuc1LCHXM6fMdH6WtAgWu4RywP1JhP1O9kI oYYDBw4folManJ7KarJEpkiXrhlW3hFTufCLRHLQOr2OiuRt/NOUeC/H1BGQg/C75ch9ps ctez7GLqRQKlbI8GXTcG6j2taN38sm8= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=Yr1xDxNL; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109633; a=rsa-sha256; cv=none; b=B42o3Hib+FnYSR80263SBjvjFFJWJkwkbYFhwkmSCIJ/9ihgJWiiW0hFZCWT9SDbr/nACP GeyLZ7PEwQVqJN7+r4X8L9qWFE+H0BWAP2Bkl/HdS8Wu5v9JJ7kb4/o02S+62BBkiwLFRO AHVmSxbePZiHCDqGJP3SRl7UqaslGic= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109633; x=1711645633; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=813zYQzJ3ygRpxAxwRlfdubSOcWGUy1xvUxQHtIWz2U=; b=Yr1xDxNL/woJd+YGSKL7n751e0sUkh6SULnqPto1geuEjdUpSmn2zXFM BP2e8edXcwK2AXZAsW/ru9pNMjuekID3gbVJaUMpQoCLCAo0BBlTnO6DE aihlx3BsDowyRwAMzUrwvxanol8qhz5d6T49QigBS1m2WNP7OBk3NSwzG 7klunoVeYT2WO5/HETvKfOdqn6tDc52SWi5eFOy7GsRlG/vszQMPS1EW+ zZEWsiYZo3UKJvPOZv+KU2FcBgih7X26do265LVakqoDQnoUWlnRMwydX Yc481bGElYP7z06O+BI8lJT11odtfXpqU6zomCSEAyU1uSkncnzTAdl+W Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807116" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:07:12 +0800 IronPort-SDR: SwCVCaAuw8bqa5z6KUm7ITR6KeoplEsfMxPC39upsyuKONvczjMP3qn6dpe/a9JSxTORh32G5O ez0lYTltH0Q+oyrTOELYVpYBc4Ppyz/i6fVPKlDU6Q8ek3KiyAkXtd9wUKH64hJwNGzt3isoNI pQl9mHKW7NJuxxUzBWM7nZaddiWttuTuL7C1FK8roRHS+4hp3ySfGyFJLBr5XE3JRPawShyt49 nww6RVyLWz3J9T903VHFI9za2d+pzDgRVKANeNrQT1g8W1L3b/Jg1jcbUaZKqEfsSMaPaxqjUn ky8= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:21 -0700 IronPort-SDR: 5x6F8sxMltI4WaB27lEorTzv/W+x0JlN7rg04JjPfd38UU2ZZm/8DVpEHZF7Dz1SymcLD61OdU pMAulltziCw14vrFFK29xsFqr89kB9UbrC7cwH7R1RI8Lt7mmLGDYyj8PgO4p5chUbgRB50fDX pEWQG9uo914V+cwk1EfVh6hsltWKfNnh9Gqxgm0AGxlxSe7pa8UIAv+zE9lP4gByUZGpAjJ+IZ Lyi/Xsr9WvBwip9Y4KMe0trG46KV0zl+LFfsw1hbin01REWR95Nk66NcjalZz84eqJSVFLmHCh l0Q= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:07:11 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 18/19] dm-crypt: check if adding pages to clone bio fails Date: Wed, 29 Mar 2023 10:06:04 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 613E81C002A X-Stat-Signature: dqxjthdsskmwrogpf1b6jdqszzw59kjg X-Rspam-User: X-HE-Tag: 1680109633-739314 X-HE-Meta: U2FsdGVkX19Dm9irgQU35nbMa+ei7OHsurzdx7BmbFUWbwGE+tzQlW7jJglMVhx1SJahC114PEhfHueCNi42PQuTtwnQl9wOev4x0gSf5Wx6P6kg0SLadtOxY4eykZvWHqxJRF/XhZkPyOKjLGsLnOf8LaITvvvn4OIRHxS8j7wxpgnMEzQd19F5dbsZ5SJbibUhK+ByS5wIEzLELhGE7+PdS3AgJ0XR4KRO2pg1nZF8oTO3rCgLLmm8t1RvtMSkfULDKmwEpEWlVjz8mf3IK/Avs+ygjW++Ct/wdZBgrD+u4bV2X0Sfakaa3MzJfwH76whrLccJeczk5nRC4k1GGvgaIQzBm6w4QWG5NvYCy9b11KWd7d4lOSmD5Qap+u5tWIX6aiFqNI4ua/NxvgAxuU0xQus1JoNuy+90GQ3dmIk2fWH3dz/7GzzydlReWdyZJHxDzr5/ABX5LeZrrpANBhq2sO/YctB0c7H/ItGQh3VnLj5TkAIf1bvqsj7lQTi6eqa44Et6GpYB48S+4f8ZDpQPYpJosSAW9317YebjtSyIx+jOF1khakRL/7dBNpnKi4nnbI5bLE8YsP/kIMG5VVrzSOcC02RnQz98pofXQ+3aOPwSKaBhY2o4PTgvTa6o3b+xKXPVlULjWrdWRphSlmDaBQQuWaL3UaJwtyxul4FmeW5VP1zLGcG/+dneaNvQl/YZuFPYlPRtbfuE/soc+OmQqCQ486Mvu107q3uM7SgjVbm8CFjf0EGBfJqdIEpAnLPbb8ygFKYKUSoFOoaTkUrO/m19nGtKzuGeekBAKUoDzUAd5VmOQcB1cv5ygD01f8cnX/oGyaak4lmn0TNN5OV1OPN2ekbmNfjaAkA9/AlH4NThqn89zieEZLGncvsNCgjZvRxs0rdjh6ZvD10E9Q1rLGmYTFN5FL30ZmVrqrf9mDHxbV5g5xrksBCN0i+osOhA9XlfHE0Cq2tBYMq c8/a3cKC XgZpQjrpTpjnzMfudfQlauDm1QilD1ttpVPj9GtO8DGQ069yZLDvdxZLZ1cbAqG+3ILdCULr1GqAIj4j7kU/+ukvo40gY+suj1ZDLfteOqdCW+IojeIp56HtuQ/vWJceZI8TihhfU8KydCcT8hegHwdWmcb8eRohvfv3hFwb4tyznS0GQlJCkmujKab8yeN1gKQeHoJiC1AvgRKvG0yylm9sWgCYb1hDtdZ9kfzpOTFL5g/04WNRKe4XLAPXwUSO9eXXletk2VYT2mBVeOjsilDZ6LVjSwmaMhYYcsjkrtVOGvlEXppLLXj1QOsoF9CYGD2eyxkt+HnbC01HCs25C3kB1Lqn3NJwCzZAE+aHF6BMRcixlzTos2fEOWQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Check if adding pages to clone bio fails and if bail out. 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 Mar 29 17:06:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192968 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 D7FF1C6FD18 for ; Wed, 29 Mar 2023 17:07:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7318528000C; Wed, 29 Mar 2023 13:07:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6BB5A280001; Wed, 29 Mar 2023 13:07:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55CA928000C; Wed, 29 Mar 2023 13:07:18 -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 3EC0A280001 for ; Wed, 29 Mar 2023 13:07:18 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1EB6F40CA3 for ; Wed, 29 Mar 2023 17:07:18 +0000 (UTC) X-FDA: 80622566556.13.21F725D Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 0B4861C0027 for ; Wed, 29 Mar 2023 17:07:15 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=BksIfeiF; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109636; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GDJ+FA6jm0FuzkoAjCv9Foq+v6LVPc682g0yuduBtNI=; b=pIXBsLbY7EblXS4dgDS112fyqtQGwBV31QfcDGydk1ZU72doNssfdU/4jkQUV85Hw7Ju9R REYuXigUE7ezwiZ62uL4i2QYNeJedgIPJSpveWUMFdKJCSlZj3RYE95M+V1oRbwVGyex81 ssDU74xt+uuDNT4TsuiHKpxTmNaXAR0= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=BksIfeiF; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109636; a=rsa-sha256; cv=none; b=Dbv3ONrZBPD4NuT8RmnwWppiflIhPlelYcm6xou8eKzoHOcotsSuR897L1Yvb3fPUJqTvr MLMg9vKYJVbKfSJp/dV7f90ATN4ERzqPoTao+aNXzGyXZWXVgFPhMcx8r1fWjmtwfTtuE9 v5LOM5mrDAMouSr+3IBon02jAYRioro= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109635; x=1711645635; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=25kvrOzZLFw61mLSH/q2oY93aAmAj3Hgw8SlB4MjMEs=; b=BksIfeiFb5/iBCjl8Y5ZuJ/miuJWxxYvaqoN2H6KKSt5kKN2szt9rh52 7DybsF+QDYl2iAPDHrZu065dnY8Jd/k8hvkEnOKp9lHEsm+/YFtNhVBaF rgtz8B9IY14kv9MlcS5NnhfX1Yuu3zkLorWpm8DxKLmE0Xr7+WwPweZi6 UymwK8ukPdjP90P/WzdbDxb8y2MB9ZzROK7+/sm23FWvkK7ww0xS54kve EGd4OtZxNvqgHEoJ0LDxRDXPyio9HCGjhPAiMW5dek4p7bBINUdVGMnP2 8Gp6rICN7bj6zdVUht1Luy4ryGdzxdJDmBF+pRkZKC8Z9ppER1GaPyLYD g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807125" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:07:15 +0800 IronPort-SDR: YQ8NsJh+6QbYtRO3pgFtpRJsYKgWrrQRm6mdYOdWNBaIzz1Qi3vfLogt0A+R9QTVGq4jGR0+Bb lIQqiOtSBUBhi4mLBKMZFctTwiowaN/1glHOLZwrl31Dw+SMXrhl9Z8yqjcCAbwLu+9TFqi8V2 G6mhI/46Wqx6TVfd1M5UWRMWlsMM6LnlqlHv1XXbTa66qFVHMLi6hv2BX/PBvsOfwAcpj2sw5T L+l/WITcIA/P9VIzQh67DBHs7Is/jtLgS8fFH+WDlZJVKT0HaMZ0Vn0Ct2scB2tM0pgRBWsSO6 wdE= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:24 -0700 IronPort-SDR: 8RmI6zmAOTXFtW/2/SG8J8KNZRYzrAFRJ4uNnILqTeeXG066nahjBZoS9n+NN5J3vTZ6r4tTp4 tgf7Xeh71IvP+ShrkeXh87FE6UCEB3t5gJLO+7c48mDUod+PtEXFK6+gNDb9SNHaMZjGaFFZq5 oSS15Elmdtz3zYQl0pCPbsA+5iw4KtmRTEhmlTSesmM+hPv3lcg9UKEZ8wbUNW7w/THKtkgzir PeuIpe63rdIdw98aKHJN1lP5OhNWW5Tro+ygbZuffnM7QyFj0xiIF2ZERO387ULFLAsv0/t4Fc XtI= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:07:14 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 19/19] block: mark bio_add_page as __must_check Date: Wed, 29 Mar 2023 10:06:05 -0700 Message-Id: <350bd9c62ce575267a2b38625ab767c332429bc1.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0B4861C0027 X-Stat-Signature: onyfqmzk8obza6cbi3wmsfpnwjj4f9qd X-Rspam-User: X-HE-Tag: 1680109635-219555 X-HE-Meta: U2FsdGVkX1/nUczXgbsgUO42Z3vD0ogym/28IHJ5UyNfXb8yG8uDa/PYcLJPBSpgd5T9TmcTyklt4kJcndJOdaMOZ/IyANFmY0emZ2+MHuZeOM03EtprX9v5LEy1xmipv/abAZ6SxGbRWKnVtFByqRNZJce7AjE8ioY5pv6QLVL2qGbG+42n1F8+Eug4sPETk7tU92Rw2lej90yoSFOtnRWVMAfdMqAVhuqP9LZ8WxJnBZ4SyGFtTqECHBTK0NtZOetTQaA9gLfpFQNPaqiXlJFFntCL+OIhKuSeLN6cve/pxmfrYadDsjAi99exq/rFX5tiOCJ1lGTy/r56oNTPuAARxYqArbYbvdawXXZTyqThejPUR+VE93gy44n/XBSrdqg1i6HQWFTwxDQxy8RMTDyPA1r8fsSD++psWpqzw3LEI3JydHHVT50s0sTXKDLUyX/nksqb5Bsj2wRijt0STO1Uw81fzF5nJ12OF1ilZSUfK/tDHWImzmJ7YvbJdyY3jeK9Tp0adMlDzT46WmMSuXe9J67T/gQsY0D7TT4Rm6QfVd0v65+3j9AocFTMHBLC2COIdJ8IGAtX3DrqnnwkjryQkt3MT6bqKMuAaSZdPaecT97u6gqAlamEVwt1jYRgHK1TbT2WG3+w0RGKCGLYNT+ZJ5ycxArt3M5zryioFN+UGsudNq+7J37pkwuDnokykMxQbHsDmp/mERvm2QG+Vk82UDrWngM3jFlJPEtECKDffdUzv5HTqAedp3h5jqJpqmKsUd/7pxy+COizfUTCK+MoZOxc38CLHstRq7IOXT/13+cGzUaf2popqPv31iHYwvM7LpzSIBJUkmFmIqCbX6yMKqG6IH+uFKsisPGY55KPY/UixbbHzqfr7u/KaQorTuf+KPZBQmzJ6mwHlTprk19Oea95EwYD5GPZiNtUsCyQ3uFkxKPfa0qvB431CBV4GqnSXsSKEnQn2DUp9lx VZ3eG/zC HD3XD0CyGoJpx03LF0mvGnsLln4ApeO80QzB2DpkXFFchJWT6SnRsCPyYozWbP6r016y6zqZEXzAgcUdq38Ao/voHrzACYbhCBsJC3BlztAUgvr96ksShn9rTy0PTkyyA8ESH6HaMrclvVzQEpuNwIk9/Qw85PvCKB9K/qtravgCl15ZB7XIzuz4s5eOB+9uY0FbEyVFhjAmrkC0x1PprvFHh+wpj08AqtvRfWuqUeaeeUmQUIeDENVZwOhMYGCK73xjrSnTAiIgF+GHfgcYyCP3BL0mDOqAXctN/BnFSTXY2CUFnT4L+VnIGvbeIeAz6H8YKMrhKt982eOKy7r4nPyIwRHZrnPn7tQz3jgg1+/e8CdYmJyLSEfaHjsHxHqTdrdJ6Zs7sWG8IQ8hoC5WD30mAA36dDY+9ISyB X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Now that all users of bio_add_page check for the return value, mark bio_add_page as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index d766be7152e1..0f8a8d7a6384 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -465,7 +465,7 @@ extern void bio_uninit(struct bio *); void bio_reset(struct bio *bio, struct block_device *bdev, blk_opf_t opf); void bio_chain(struct bio *, struct bio *); -int bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); +int __must_check bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); bool bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int);