From patchwork Wed May 31 11:50:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262039 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 C6F18C77B7A for ; Wed, 31 May 2023 11:50:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 537456B007E; Wed, 31 May 2023 07:50:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BF836B0089; Wed, 31 May 2023 07:50:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3394E8E0002; Wed, 31 May 2023 07:50:59 -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 279146B007E for ; Wed, 31 May 2023 07:50:59 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id CBB8A1A0367 for ; Wed, 31 May 2023 11:50:58 +0000 (UTC) X-FDA: 80850383796.11.6317DF9 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf09.hostedemail.com (Postfix) with ESMTP id A63C9140012 for ; Wed, 31 May 2023 11:50:56 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=bww8YBl5; spf=pass (imf09.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=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=1685533856; 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=k3hMRAQMYQcYNWszibpiO+E9S1oS0CQ0TSI3hF6nuSc=; b=LFm6HEvr6ZGC7BPhKES5b61pNbUA1jjNF32Tdag4IeKukYJ/FFPvg22/vvVNvSSV8c2kth O+FEmFef+KKKUFa5vm3OOForHzarOkeaS1nyiJ9wsyPoNpn/aCQn4atBrPRleKpsG1d89U 47iEsfhflBwMomsmcHqaJXyScSybfyU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533856; a=rsa-sha256; cv=none; b=fdZYC1wmJm/Fy2MPDSvKU3vTESHJPwxgeIuacMXQgI9dmhHHC2ASTzYQPAUFRWSEnIrgSZ 10FIaFzqCtXOJQtluI/h2tWgsGt97+NwmPx64hJWZjeSTOHRonKzzQ5theZEEj76e5bRPU W7QO/dwjm7/vM79087IiqS0x25AUTxw= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=bww8YBl5; spf=pass (imf09.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533856; x=1717069856; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aVyQaNpmt9Kkl+oyJUnsIhsYw5Ss9yLQpVI9KGKLjIM=; b=bww8YBl5K6VZzwdwNIR5+YOBVhP0wV0vDIISEwbBplnpvf2Zj9kf4gge hFnCfGFnPlrD3Tnbrfz2hPBU5yNTegfQO3+CcpKBSi1oVKpOuoDzOvRKB 7xXKG3yr1Kl1HKtC591Sw9h2alHoEyx0LxFPYxQ2Bwo2U0JEf7GtzZ02E lp/znwBLR6j7gbwrltjZiqK0BLQkIwH+SIqbDUFRUHumtLDe3uG08F7Xz qOjPSgDZXLwatcOwkHy9HSzeKYwlg+bTlOn6yZBPZTBE4WIxRU730HzSS h2fW797oGD6Kt2g8jl2mGMxWx8mhRAvTOPIs1ectOQpELuNJD7kPdcZrX w==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207387" 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; 31 May 2023 19:50:55 +0800 IronPort-SDR: 2lBaoR/eQTvVKqgIW6hSIZYRMk+Ocs55J76oS/ccCpbIp9OUxpOQ24uw6Exjah44wvfinUTmMe iNzeVt5QCL6eH1EEmwI/njMtJ/uaA6Eq4BmRD89M9q2v6qVP2Y7Vpn4pUFtidaH0hMyJH6+0v8 TD5QUYiHKnwMMAk6QNGyRQWAMZ58ag82rVmzEA7rNx5P9WwxxIkRu/nh3U3OdGLL/MNEtKnqNa AI0Cj46ksxrdCmgwyZIrzWkRU4LeQpw9W6coLWVKlbcmpgV4eb/54HVv34vflNGbq69+ZbtP9Y 3Qc= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:05:48 -0700 IronPort-SDR: KMtKG3JscatUziqjy7U7g8MSjyjZduOIxvyAtHaf8bQdNgmZPg/ejiyqNoiFm9Z5/dVstQGVpT gUAVKI2lRv/nFQcZFAJUyKS1dF5x+TDBoaUIItPfUSTYOw4cP+Lp6QU2dYeMMHn4BfmSwznJBE LF0WLyvj8M+QVpz9qWs5bLZ0PjrwLDk7VacaXMR7BDRrt8W4RUepJm4j8fTf+uh4aQsOebPGEQ VyepEwzZ/olV1vKjxxd7loGn5w/rIFNdqqFPwuOl/iBlTWTDr5y1W7oR6Mm1kXTtRz+syTHmsM o3U= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:50:53 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 01/20] swap: use __bio_add_page to add page to bio Date: Wed, 31 May 2023 04:50:24 -0700 Message-Id: <5bdafd9de806b2dab92302b30eb7a3a5f10c37d9.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: A63C9140012 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 4enjdwhjetk8qafm849h4d1e9not5x45 X-HE-Tag: 1685533856-938949 X-HE-Meta: U2FsdGVkX19sAqsnNkgOVZ7EJvJCPo4eYUCPZTIQM+WFQT21aHRU9+HirldlSGgB27hQ6YxVNCK4jcXdPJiJg3/5G9oMj41916j+auH0Xjkq6sKGVL9XeBlpKArJSStwMiu3+hnvQYaYkV22+77VRt/hjIxbIpgk6GU48QhfCEEy3E48IC5pOJX1apnMHY44pHov6P0gW/oVfHyM8Mdk/HtOtWQgEIZlFh/37DxAa1TkIdKOVlWzAS3XiUowMD3e+3XeD9zGtAUZaz+g3pvK3q1ym8hex7tx4rzAbYUMfJw49xjMSv9h8HL4IoOKnPnLz5STU4iBX30kLAbx1GO1rW9ger9PXwSDHLKPCF7oVF7aA+CyFYjVlj2e6XmYGQhthKujLuNcfuRjZOM3f8Vg/9SENbMHv9D399wE8+3IUv0WLZFapid4wJhYWroQbk8feStjZuQ/iCe0VgW4UwXI8npbhKWHIdE0VN1fr57rqvsq3JChyVP+Ju8qVPjffV8pRvK9orsok21vWeOMMYDfLx1uXrQBAwIhquf1jOKPUQc9f9lFmDy4vRCTgpnAWnZ6pywqD0cDoHPG8Dr2GniYWpoGaPUpWzCNab8xoLAIGUzVwu/Gp8oXXIuOkkw3IMklkXSbDzyTlcEjoZJq3E9dRGwsNMlve9mQaIjM+PkBfU/+imshOS+YQjHOIeY2sCR+nx0PD1azqG1hoxRLonRCKkOvWDQAdiTa+MgsRqKGqbQYe6P9SzoNI+xESgHVFE87eJoOPtJal17RqBMRuPFSRurOvQlEa0ualk5rDDj7u8aESQ6/4GTR2N4y2QNEPo9ayTGmUuiWyc/HocvsuOq/hw1f50Q5fdO+PrvewTrlfHa7MplMQKw5i5/z7qH9w2Fzvvv9kobemg77bljYyFZBWIlyq2URfeAACIXdOGSg48OdNhLaveaOeJLmhbw0HJUtR224e0+Dm39x2Ag52eZ z52/js5S pTOcn/4mj2gHeK6/YTg0SvemhjN9QFdhooCamBQkCSq/yYDDraWPPooF0WAO9TX01KRRp39HAzwyz/xSzSyBlkR5DYdryc87PIB7mhOnHuBqkHAP9DqdRJ9tJSbBxOFvpbDSShj8OxJ6wTytfCHQEvia6lkxBij61feaGZaQHSrL71VC9oI2IqobjhjKBlVXHrsvyhpmHEvyXuh5bxpae+bFdpx5I1sWgDgHqBR9d9KvVD2cUCsO73W9Ff+aqZj79FkFtbX1Riti9QBQjrQQ74JEtQ76C+a4O91SzsliDqX0rMX4dk9ue0D9fumTGWXcQK36zFP2oyScXGN9PGUmjZ5AgTFCDRf2O1/3FBOq0i9GKKkS7CJmTpQgdnayrWqh4qugqYwX9d2SrJnE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The swap code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn --- 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 May 31 11:50:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262040 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 C222CC77B7A for ; Wed, 31 May 2023 11:51:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 424F26B0089; Wed, 31 May 2023 07:51:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D6146B008A; Wed, 31 May 2023 07:51:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29CCE8E0002; Wed, 31 May 2023 07:51:02 -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 1C0556B0089 for ; Wed, 31 May 2023 07:51:02 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DF4901602C5 for ; Wed, 31 May 2023 11:51:01 +0000 (UTC) X-FDA: 80850383922.13.0F8BADF Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf29.hostedemail.com (Postfix) with ESMTP id BC9AA120021 for ; Wed, 31 May 2023 11:50:59 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=CfblHkiB; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533859; a=rsa-sha256; cv=none; b=tk2loVH2/ieDxzQbHS30iqjA7w2BtkTSjznGJoovOR6yeTyJt3hYIHINdZhFIpvCPFjbtU Z6emQ4pKw/zrk6XMhFyu2HjCY+0hcfFcJ6SB27nCsYPjXYCS4q09p0apXHVhqjLURtvCLJ wZOjBuCl8kjAuOcpnDgUkvHUD3CgPiU= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=CfblHkiB; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533859; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AKDiQc5c5mMUE+M48Yw66vq1cPaHt+34Qu81mFVf1Zw=; b=5qolbU/22orj9a34Z5P6TsTMcUbnppCMDIvvWxmw8VmdQ6b6KSAWudzj9kw7MjpdHCMaBU 8ezHIJ/Q/H3b5vpd40CvrjkYKH7z9i1dp+AbjuKJvZCNz28tjhy7ntBeGnuTqwAZzol7+U A/LrtdRk9CmljacLUEJatout/wxNfB0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533859; x=1717069859; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UUIQkUbEvB2cbvY4f/6uCB2pRFVtewbvTxuQqfjccj0=; b=CfblHkiBv+05q6Z1DE+fUsOocAU1IVBUcIrh04CXYoFAQMIW8CEpem2H PBsbjynil8DNS4p/ApObfW9OHAoEwaIixL+zB2MFGiMotBhbk/9tGi/9E zoJuQ5KHdBqr/0KFcJpwvS7nnH+/hFj+C+C/Ujm40OFhvpBvmVGnNrRc3 TNV3Ns+FjMDIIZhPV36iDEPty+hsxeFOMWyz15lPBBm3d1rZzfdGpHdzK 8ScDl2qq8WENGoyDyhOJrJjUWcVcPAeqcQwtk2fMmyCDM8cM8aGn2tiEx agixTgEoCTVXv7HPQduhKKApGM5U82TX9MddHhI9QKC0EV6QDYgEWRp0I g==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207389" 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; 31 May 2023 19:50:58 +0800 IronPort-SDR: AYSZnHXgPYssx2yNjjs2mMBNZLz5YAkSIkH6H99BGVE+Xd/VYURODDjGYwCMsYsXWF6fZPsKdp HgGCvYDZUwYXGfqCzo0PMOjMdFoh5Biz6s2ob1wvJpBflTKlTIuDiTjUDkgujIiyfI69JoaKug mouPPb35Z7VolayxW/ke3Z2GuMuNJxxDUxsDOWhfEmf4ebfiZ8QQLlEm22b3bC+nciaUw0BH3f qai2SqoWSweh49XaE9Z3/NNUmXW9DdvNbQt/WJVS230e54hKVsSRX3ubO3oOjgjzeySjK2iBg+ 5fQ= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:05:51 -0700 IronPort-SDR: 5fbhaGDbiXGkg8+3UI34SjKA36qN8yxQFYrOzNfKBiGqGFKkpSit1Ju10bDfGDplQIS0ftPTpQ fD8oNw24RMWU4g7VvkH7fNvddvkm6er01jVyMTVNOtHvSwsR9XJm3ab5VfUwyO9fCxhY/DdOpJ rVRoCbjgJZYRe1k4mgWw9zPuHFpUZXB47XYvnY9pZ9QXi/jP1EZfI0KyE55eH/ZOvARZ0NI1B/ I6tNjRTts0ONBuOq3LjKScjHSb4drUc9pfSOAP0cGx9F/5nOD0Px7pW/36RnXKCA79Pi9R6JLP x9c= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:50:56 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 02/20] drbd: use __bio_add_page to add page to bio Date: Wed, 31 May 2023 04:50:25 -0700 Message-Id: <435007afac14f3766455559059d21843771fae53.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: BC9AA120021 X-Stat-Signature: j9xwpjbuy5afoi99kin8fq89gb9hjri1 X-HE-Tag: 1685533859-817189 X-HE-Meta: U2FsdGVkX18/fuQlci7mdwn3Zy1sxIWfdoRam1mV74Cfhwmahu5twxa5uMRQbmHnNX1Oo1Paxm0wwWUIpbF/Hnz3rxZZ6EIUwBnEzhxnWXIX91YMITQABKEXX73TP9JKKGFkOYyjahUdm3XNw/Q3/8ckL8iPs40yERTm+fmLq1Ks9NUJ9a5k3N5ifSrwkb5uuhHv7+MUUJG4aWcCIL5Bv0DKvf5OVRv8gk/4bysym7yo57/hd7uPDA+OM0QgXXP3ZFkK/XHNYrYDLSeqviMXsHVMJhJH1u9DRB+3IGlM8K5u73ZTUe1PwjKXGRTXNbAmbVwabRYVPp/G/fuzpohZNlEgeTflP9TLHr1Ssr124zgVjqbc1rp9soOYfG+EFZnwfoILQnhEUi0lzQnaYuiA6128EgJ84DOjCBikcsvA4Ni7efv8xguKzsQaMNCgwUa5gtzavSbbY9ZG0XtEPeoYSnOvEb9FaUctCB7Z6iuqikx7jI8GiQ0TkhveuQ4QF203qRmRDm9SEPZLY38NDfdbyd2WuKY3sgRT/X36U20tK6UETe+lmrMVf2cooFbiPBmYEkP32/VlaUCZ24m0aFo0KOIdYWmfYHeIJameTO7cavnvAoQY52kAs73RYWYnMVpOsJuT8QJUn+Jvsr8kmeWxaqfYlSh1U0u8Er5mIPSBd4iV8KJIpK94pBvc+3/biDnfzGn2TZpwzg5tFqYEFK4HCJ7zOmcN+1xpRN3m+PG2j272ZUfVnx6qwkwg8THaiW5ieJ9QdnLWkf9pUBllvJuIiWVC/O2XXfb9xyf02+7ucmRw2DqY4Py7dAwNsiFl5womobdGuhm0PeEwQMsHCrOjz9cyB/EexTl88bqf+Q4l9zbojAc4y2dRmVv6/leigAmjuMdBqdOGKeLvwv+1xqOo1DwUevGAtvvbbpG4X60JfP+W9Qa1+S/CBeIhX1DRg2KpabHj9MdKDeUujZuZCHp CNen+Y9l JWxNEYpMVklDfr1SDlLqv3/NElG8/G+gFAOCXN7aE+uEbvdCBqrxt5XuH7DpfLjKep/kY+mh1ZFNV/Sib5zGcVAsvJeNCTXlxWc+vTGK6gxIK7gcIETsgb+m8N7UQ2f2KVaO8NXQ0K93sZSJU7czyYoquq2XiswGxswds37X2gFguvA3Kl9oVAkHmKNI0SiIaMxJC0EOzosR/wcEhE5lnvYoxDkZc4YuGjzFSZo+kLAH8BI/P8ZhQkQxFGGgyep87VANf76kpYe1N2XzPGRXnDrpgrb9W5FfRRWGXh7Y4yGvYr7mHWFgdZnI8Lzxr4RlIgVVz+xemmQR4VHPVFsep+6JE8DJaGEzN0n1RaDvwI2OfDbOWjIV1E7bYcT5BNFKF9Fv2YdcMh49FxJU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The drbd code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/block/drbd/drbd_bitmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 6ac8c54b44c7..85ca000a0564 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1043,9 +1043,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO, &drbd_md_io_bio_set); bio->bi_iter.bi_sector = on_disk_sector; - /* bio_add_page of a single page to an empty bio will always succeed, - * according to api. Do we want to assert that? */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); bio->bi_private = ctx; bio->bi_end_io = drbd_bm_endio; From patchwork Wed May 31 11:50:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262041 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 11B69C77B73 for ; Wed, 31 May 2023 11:51:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A40586B008A; Wed, 31 May 2023 07:51:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F08F6B008C; Wed, 31 May 2023 07:51:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DF898E0002; Wed, 31 May 2023 07:51:04 -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 7AB296B008A for ; Wed, 31 May 2023 07:51:04 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 41BB91A0357 for ; Wed, 31 May 2023 11:51:04 +0000 (UTC) X-FDA: 80850384048.26.BD1849B Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf29.hostedemail.com (Postfix) with ESMTP id 18F3C120013 for ; Wed, 31 May 2023 11:51:01 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=Tkj9wSOV; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533862; a=rsa-sha256; cv=none; b=4Oo84TWjoDjfVB2fmRbYqMb8CaZyGTx/2SaQqLH/CLewTDK27RnoYb78QjQWjrAcFHZgfy fYC5RW+SAFIK6uSitFu1twylGfl2TgUnQkIczWPnn15UzpGa7uj82ozo3PmmA3fGZgEeNz tpNK+fZINPyexEpJdt9D24rbS8ck8V0= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=Tkj9wSOV; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533862; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SsAjS6t4vxeJS3qx6Gp/BdZFxpipc6y58YVRUDPoMew=; b=RmRAK3Ok4eE825pe4VBIxXoByBBsqU9mSK9S9KTRbO8pC8JOqktbL4cPUafp/bAyrObvtG fnYgSx1lCdVrr3ma2F9Z53IB8jh/Cs50Qyw83tkQbujcuk/0geOhTU3hm4bGrVonylJntO E91TZ9UPEczlcMllvKnxaSzwQ5v5830= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533861; x=1717069861; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yht1tkgwasi8HpY3YFcrQQ6s5n80qKmfhqnvFToXZgs=; b=Tkj9wSOVccVbvRtdJZVAJ2F88JeJZj8KJBUwunbBkHEIeS+6Mm+UUntu ApfQpL9Ewa1ZqoSNImDK+psInxCCr/HAbH5XDlTlHNFs5PTYPRhXkZwGX 4x6XjE8yItsqdN3WvuFtXjUFjRP4hm7e///AZnAOT3eIG9gsyJl9/lP9N mtpFXjWkY0foWLKEoY5yAX5Efv/lkwamgtYkPOL5DsQlKqUvoiup61YaM H25LBzQJyxev8YTdoUC8vuYTSVHUsReT3giOJfAD/0ZOup82+73GzlEZ/ eKpOSoe+MTGi98crCmYM27EceYSQXTohE/CmidGoNAMGgvpTfvDmzX2vT Q==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207395" 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; 31 May 2023 19:51:01 +0800 IronPort-SDR: wqapWNrztqrFuUn2W++OXS5qkkRAXvck3xEMgFpvxpoQkALXwznBXB/JrEv8JKGStw613l0UPy ed+vfXmE/Z05mz2pt3bpMjtLMMR5nD4MuS4tGJKt4U+EAgBDZUwneYzwZ+VvViXMrnG2Su5X9F hVAzukHjJKcW0q/+gCy0FI2uIxs/B2p2CWg3RcBPO8f/XaqZ03v3OyuMai2DDsgKwq330O2U5B oRA8u77JFrZoKbRwAklmRJj/n1E2rUNi4eT4OdWQ10Spz8BE6cylFzttzD82S2m2z33TmLhb/h rjU= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:05:54 -0700 IronPort-SDR: bsi7HwNoddoi1aCCstr6zqEUz0yRweXsbpeUwAD9EpJFxV4mtkV/er5q/U5Rtf4PTtq8dDGKTL 6Bm1doXKC1ZsZlmOyIQMYHRP0CxBcyzAqmfz4V1wID7LJJntM04yP77jdrZeLV8zMePOeEB9fi mnc/c4IKxHr9qPLks3U0aTHrkZGdC0Nddoqn//IrBToFuqv7JuL6t2n19kxK3ItMI087JoHAiz 2NW/P+el9+4FFBvaFgEq5wfOFgSO8ReYWFFZDHZHiKVCZGfLRlQD5HyvSI3XoZi85DenMceD/4 iYA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:50:59 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 03/20] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Wed, 31 May 2023 04:50:26 -0700 Message-Id: <55a0c8dad7550379647873b579dc7cfbe0191f96.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 18F3C120013 X-Stat-Signature: tmabyxygp4n48y8hd6inbhim5wksnj79 X-HE-Tag: 1685533861-504507 X-HE-Meta: U2FsdGVkX19UTpQiuc+OyUXVNASHkjtdREdcupN5YvCmE56Y5PaQrI5PZXY4tfBPCC+YExJrsZGJ4GrrtGEzCKV/FXxFwiU6c5/hUb69rqNXKAHRNsUnz0kvDie1Goon6fAVnfwC3tz9CeWwy960XhrxyeRk9a9hQbOZmuBrwD7OCDw8yO0W1cok9Ycc8k/HRglslAXzgC8MS2TBn+dv7Nx+VNpvCU3GP5wW78mDDrFpLhqPLOtZCkBDkDd26IrPiieEAMJneBC9KVdiaPWPiV88UhkrPOKdTMdpu8thHdu2Mm1x/h57UBDS57Lt962N5II+Ayrgatw0eorBULUz/2kuN86bsdLYp2VGamj7oh2eDtvq6iiS1YH0fruprVo9zpcvRwEdJD/Ibcl6rIiRyggCBDvI0GNvQIbHOAMLKdZRp/Paessf7QVh7UkCTBPBo/idHXBVy9HrC0mqwXHx46DnTyPVzOln9CkZx0OhdjXchNWC4afxmPWvIvcPdtQn8lopZqfmgKP+wp/eZeVFZ36nr8shgXxNz0vstzZnKVST2I4agQxaB4UeDi7DsLt/H6j5XzeqWHLNJvYN4GxISUFJZyPgwU4dOBxa4vDzNOYGOI+BPymUP0CueDmMaAyPOE+WOGfGsbgLtNz5Kfoongf6qQX6kDBZzzyM4WGaCJxs0r2aeAdl8XRqArHNcshDYrZXotLa1N2Z1XAa7lw+OJcG0+U/kNpuWT/KKlOaHLjysmzFE1ZXUosV2VygDjS7mZsbcbFmErhKblyZoP25BZmFuL44fBwj41Yp7kZhas9YRbLTSqpylgLqmzh1irdBOGnr1w55ZYu5wK4hMsuNO5hw5BcWhHv40IvtLHaaqURFlNuKqFjRp4KBK4Ja6e8CV2pdSUcPCex+ftBRAdgZPXYGL5RPl/jPGwF43g83hY2T7hO5k41QEKZin21+gPKv4aoZ2Ituk2YsJvllrne lIjPz57I Q+0Q5LbnmbUHS8nNiENx2C5PLhKi+Vk4H/tQgZak3gDTlE2l7Hq+v5d3sMEcjgdwX3cnNnY2lkEului/ghZi89FHEyhQEebDHz6FYausYLRE2IVpw5yjf8bxaayRiyJaaTwoyav2Mc3Z5LlIaUMiq6+OifBnid702n17d28VKox0/panogZL6q5Jd6/H0ZKWO5kBjFyFWnkMCtKimugesgVDHmgUflYt8U1/5+hMRDN5rgzYbkjM2tVx/ZyN07UQmI4vxjqaSm95JQbCD1E9ufTlGLMf0pm1YXz3zvQOvNV5jDtUHMpXmj0IiKQ2PFzidH8qNjeb2drFVgg0zbRcnBhiNenK6hIR4cXxqYWctPiQFok+rgD7fzJIVq2b7HJIwkihQIeWM37Yd+Ns= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dm-zoned uses bio_add_page() for adding a single page to a freshly created metadata bio. Use __bio_add_page() instead as adding a single page to a new bio is always guaranteed to succeed. This brings us a step closer to marking bio_add_page() __must_check Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/md/dm-zoned-metadata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index 8f0896a6990b..9d3cca8e3dc9 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -577,7 +577,7 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return mblk; @@ -728,7 +728,7 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return 0; @@ -752,7 +752,7 @@ static int dmz_rdwr_block(struct dmz_dev *dev, enum req_op op, bio = bio_alloc(dev->bdev, 1, op | REQ_SYNC | REQ_META | REQ_PRIO, GFP_NOIO); bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); ret = submit_bio_wait(bio); bio_put(bio); From patchwork Wed May 31 11:50:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262042 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 C148AC77B7A for ; Wed, 31 May 2023 11:51:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6478C6B008C; Wed, 31 May 2023 07:51:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F7C68E0002; Wed, 31 May 2023 07:51:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4994E6B0093; Wed, 31 May 2023 07:51:09 -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 3CE286B008C for ; Wed, 31 May 2023 07:51:09 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EE05EC0371 for ; Wed, 31 May 2023 11:51:08 +0000 (UTC) X-FDA: 80850384216.15.6012485 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf29.hostedemail.com (Postfix) with ESMTP id BC595120023 for ; Wed, 31 May 2023 11:51:06 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=fzi2jXDR; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533867; a=rsa-sha256; cv=none; b=phyWBM5Q2EDgwiqZiKhovT9LK5H2WEN9cSruYuaMFtAp/4p0ucsnLeTcFtr4bPCiMCY+rf gqMhx4kofFjSknBgiBi6YWbYJZoOEthsf2HxV4MtvdFZ9AyvmS7kJOCJ5/EWQEpi7q2Oav NwT5yn0lCrl7ZyNRSVFPT8WzLPAKKG4= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=fzi2jXDR; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533867; 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=2z8ePqOkMA02EjZtFm9zjlDNrusgnozPxjGO1q3xLaI=; b=5hYW2weFXYQ8Qs5ICv2vbJZUcASm+vYlK7lvRIRTVaYMC1SgNlmgnnhnpMEPKz4P8AdFll Zp5q7ef6pwkaosNTqta3nXYIqBahZ9UEWhJRi2aIesP6Jfe6tzs+A50MMg/PWaHg6qc/Wl xBVHUtrwK3+lpam8PxTCnEsG0LsBAWw= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533866; x=1717069866; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9z6+zwuzCmTIb11KkYmr2yz2BxhQ+erlThVzksd2pAs=; b=fzi2jXDR94otJDUaPZWpl7TNvp0G8Y//w0ZjkEbS2EwfPKIgawXDfPRD 6YFYIqhucfK+bwaM1F9LiItpI4KQ9325/53E2BHot8jQsR/71pUNC1dYy NQy+RN4qwDjp6HUAyNeZRBys21UrkcdUQeg9e54zR/fY5xkcADJ89yn51 tTk03KdzIwEc4+NN59uxAQOwycYl8aaYGwcoF+syDXXEs4sWo3dqLY5XZ W3bxRnpF9lSPWjKYdFTzOWMI8CVfKmJK3tGi/bhXarZjaquWWjuoL7s6r UBXKBM87+fE0pvQbHB9yng+ykbNx2M/JOolMQBtmVvB1GUkaGQnQ6t+wm g==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207403" 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; 31 May 2023 19:51:06 +0800 IronPort-SDR: KMpp1yET9nV1QcTVbGrLIKQI4ffB5ouQTabx/riKKOYF5thh73NQGa8AyLyVZrWcAuNbRfjkEy ZvfCU2KLPlQu0ybPuxjfyT4QT+VQY4b1qmKKpFmBmmrRygufW/TPXb8iY+gW/KSUbsL0clfjRR 3EkDW8fRBN2m6esPpsyWSxw+Tgt7Ckac2nbM8h+B2e5ZIHR7at3Zzrdr8chptPecyoKh0SYIqA 3BWLQDGx/woxHuEeNAV3vHH1GszpPuEh4ekdyDTc5cBT5HDDWh56/YvfX1r1hbJYdfI3KqgBpq pQ8= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:05:58 -0700 IronPort-SDR: DCUoJnFdqTpXehtn1JwgjSv3UPX1uRxp333BvBFifFTfBv7OlO2CSbLrKRyVZ1ZVcgiosXtY0T tVsCFtk92PhOFdpXCSWvnqSTCBvF5UVLxocOGAcoZEQFEIu1gOajsi/mvqMWu8cMF5J6hkw4hM 5eCUuV+nUJWEQNxIZoJ/kpCJ15t9r2ZraltnxO2/iRT8ytXvXYLujM0u5SnxD1uxOurCUrxHMR wO24NKfN/B2SA63R841MABC0LQn3WFoG2ot/EyIEOWiHlgSgUeAes2WB25guvYTGVgT3jm/xuQ aSE= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51: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 , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Gou Hao , Damien Le Moal Subject: [PATCH v7 04/20] fs: buffer: use __bio_add_page to add single page to bio Date: Wed, 31 May 2023 04:50:27 -0700 Message-Id: <84ff2dcbe81b258a73ad900adb5266e208b61a4d.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: BC595120023 X-Stat-Signature: qmecjudw1apemd694dix4iy7ez7fk5at X-HE-Tag: 1685533866-101609 X-HE-Meta: U2FsdGVkX18aTDW8GuHn1gpv39JbbG8Q4i4HM6PsGaYBNPT/zj1u898Qaf8oZeEbPGDdtdc4HVGevZ4IAHxx3DQZn9bBZ/2n7B56vLvycA978oE4IrZQcd552k2VAcHAFgWKOUylWD/LcyOhdq/aTOeV7bEgmfND+aL1zY6iDUqUgtHKV2Zvg/3orim7Ue1hP3qqRCoRjAE0VdAcM6+Tfx24DzalZeWpgm7j2IsNxY0ryf+PKStiNTfPEmBP/axEAlMG0XW/LrArdupUx4D12oCzRbKAaz1CrGHSqmKW4qkI3Ccrmh5ef1HmAi1mkRr6Q64wI2vJ+xDUc/YVddKpmVsattiIFKi6OiyGMJ2wQoCMuw8VNVqwuOn9KTcp/5fu9Yv9UzxkJ8TBROwOnA+6/CCyu8+uDulDn5EAoTqzzsiiulUJsZMqbfyXiN9oPhlCvvXDGPjSXxbGNecpPFhO48nYXad+4JvVNv53EgI5ayW91ZynvT0GIJOVUEQl8PFgzAe9Td4QY0kDT53vfz0EuNmq+lFTZhyWcSIWf+N3MlCaFYYRjAN024sw1HlomoV5ZmKlpBb1yFfG+YeRXyZiZird9V7QU6ZeCW6b9PbQ3CJliTb4+Cjp3hNDHM7MKAt32u5JKsR1916dQuK6JtJIizs8Sfcrj6cj7F+/lytyjXIWBbYBXA77K4NlnfQYlrsgnZe9jd5PZGwr5CexZizGcuTdoGjYoSOZznTHI9G5dNr3EmOgIrIaYVsA9gKCIp4asQq4PV3pfRrMYDXkI98oADoHr5vmseYxDYNi7m9c/PG4cWasfFXRz6DgdJai0JfmYXnSAOl6JM/R+WyjXxtuY8jOkQSCgw8vS989z/gAGn0mVzi+IMRDuQLJNF86gjx13gw9MCM0igLqXV/EGNW5LGHFf7r0rXicJ0BTI+NXVW/PVBRiGrpgLyCbYfeKQdx2DosBeIA7Z9WhkkLESrB MFJl1Ei9 WmmM8Ahn31cK/svdAh0AaKEfSZm959hld0IoK2htZqLwqpc8eb2c/5+5tUH/z83c/xPwge4rb6B71M5T9Y/uGn5VyFGRdDrjmA6j2DeDqKBJj09FbXeRPCVeEIASOpLO5HYBVs8B/XNXwlITwgdTrxaUF4MZaGSIkY3nxZC0x8BKEHVz+1Y2LNch+2n19RK4R6ZPRNRGgmCASjlf46Wj8+tiNsviN2X0LrJzOeom+Z1FyfsNfJm56dT7dDziPdSXkEHRa2QjrFC6sM999m8h2zvMNLBUBpx41nbCZwviOnKC3ZelvRZ+s0JHZFwTB24HVNcZYRXVZ+MEwgT9dVwBUsLH2g43GZI8WE4lwwzw8f/pzv2EZz7WmtbJGOOfl7sAOy+zUJtW6iRd1mUVmFNGv5VK4rhkyV4KES8/D7ps/HKcwFlTt+6uUJW98SyQyrVzmGO1nX3vDYu2sL6E= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The buffer_head submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Gou Hao Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- fs/buffer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index a7fc561758b1..63da30ce946a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2760,8 +2760,7 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); - bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); - BUG_ON(bio->bi_iter.bi_size != bh->b_size); + __bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); bio->bi_end_io = end_bio_bh_io_sync; bio->bi_private = bh; From patchwork Wed May 31 11:50:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262043 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 9EB5CC77B73 for ; Wed, 31 May 2023 11:51:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 424E16B0092; Wed, 31 May 2023 07:51:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3AFA76B0093; Wed, 31 May 2023 07:51:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24E756B0095; Wed, 31 May 2023 07:51:11 -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 124726B0092 for ; Wed, 31 May 2023 07:51:11 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id E048D403B9 for ; Wed, 31 May 2023 11:51:10 +0000 (UTC) X-FDA: 80850384300.06.1BA020F Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf02.hostedemail.com (Postfix) with ESMTP id AD8588001B for ; Wed, 31 May 2023 11:51:08 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=UZB0yu14; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf02.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533868; a=rsa-sha256; cv=none; b=5APKIxvzFDkkVWdX98DKAg2/zWlIWo4HeDhR/ibKBDkJa++0XxbyLQL1FhB+lXIw4931GW fN/rGx9cbBXc18JCmh4YJmXxIfiGZULNA2pmqJJHBvc3zoFTh4iIa8KGaoGX8mbd9x33sQ n+r6kiXBnCiCSOykswRpvd3iv3Ee8uM= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=UZB0yu14; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf02.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533868; 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=kHQVtEFS0ozGR/5wGcgQIBQdU8zXb6vbZolyTo60zkg=; b=7yAEMJy5DxH5TAqVLZe9wnRqD09gD3TbjcI7O2hF60oUVCL4avRIzbb0szwIZHdPBt2NOX WVvBm/poiU/PshH9OLonhew7GpUYVGvssh4x94fCMGK1JT5qaVVc7MFi3T2czYC6pTsM9u lHyuP6hIyMWkD+jawBbFT+4FT05DMSk= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533868; x=1717069868; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6fCkYLHLU2sdscgq61bKtq6BxI8MUyl+IQuxHUEXz0I=; b=UZB0yu14SRbdGeDKgPlFtPtd4DqHHYmrJFFOXcljuoSgXftLX9uZH1I8 V3SvZNKjfUhB2pgLUS76CDiG7r5Tj+0k48COH1G8XcWeDm4QNM/pIkumh T8TCMhRY/zG5VrRGfyeP3LZvXrBunDmJoZtaRTr55e4Ykwjww35tPocQH ZeZw36CU72vYQGmpt3H4Lj6urlFdTmNQaluRHpGlCyZwDB9hBfxkOq9dN BHJpxH2g3KorsA0c+Zznso0UQt+krPtTcIyIYwOZfqzCax8NaAj+lfFEg Bl+uqr9eJxDrdZXyf+RJgpQZrgtnintDYlDGR/olUZmoNsNpir5mEQKAp A==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207406" 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; 31 May 2023 19:51:07 +0800 IronPort-SDR: MDJF+1b3Q8UORwhVkG6ZWdhnr60O9ZLWCUaLSrFP1WRaCYyA7oxz+461YDXQZqGbsd4QxzUxSg 7RBMsWd0ssiB7ByZ3D2FOeAhG6Hvac1WHugMKBsLaWmL1fex2BWlTheTtBFEkVFHjPyRl9uZFk irrKgLhvem4r3rzYeBd1iOAviyoqm/ZpKOL7vNH91WYYPNeTb7RgQqUwRiEBnYFSxPFcWQ20K9 8ZVA81guDbE/SlrDjkBBtwbujaETho7gg4WuKUm4Wx4Ealw0ILqyne3lGOLaJ7xpJ9kzeZkZM8 Vro= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:00 -0700 IronPort-SDR: Gn53kE5C3awoJBs1z8/fu9zSK3J2c16Qw5Ap/LwMuYuq1ak1onfG41AzuFrfFpDgw093xXiL8G 5IDcs8WVq7GROIbadARWQhW/82INlpRG5KezVbrpCpjOVN1FS7s+chB6/dVDBhvHoAzlmzvsFt +UZ3q3RZ0XLcO9O7h/52/VdpNEexXInUlEcbNXk1U6y9Wg5zi88lpDr34tQ0Wi9aG36WAafIri cEDqzhOb2lXEhROumtjAKvyFK4NA5YKzTDsiWVMUWQxoi2jyv0y9vscB6TDzCHDh05FrNT2GE7 w8Q= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51: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 , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 05/20] md: use __bio_add_page to add single page Date: Wed, 31 May 2023 04:50:28 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: AD8588001B X-Stat-Signature: 4qyc6hkqrejoo8izsjqccwt5t9z5hnrm X-HE-Tag: 1685533868-601753 X-HE-Meta: U2FsdGVkX1+1BV2rxPg22V0C9F240GSrEhuaACyo6GXLrqM4PGhFq7/sYJPN7bWQJpBijJBP26JiD+u3KlbrQY1wPV7QfMThyuWqADQHL3Ux8aozSTdY76JHY7MjnLcjFI/uZwF/XmJfK59EgBG1xW3VLutMjz5h6raoSZoJerZjyWg5SPq67VuVLujZ4ACsQvXQXcT71O/EP9xuCS8cfeuMIId17A7zFqBdlxWkWwHEO+Iqsr3aKL1Hn+330HvoWBWPn3vcKxqzRpT/g6meKxfGKRdbwMcMk7FvX9tABQk7/YbH3GmHTetiNzzkf7i4+Zr2l5UHYEIZWVpITWEgwdwFSPrXESH8j4ib2KMEgvWMaMIu0Ox4zO/RjeLM3lk9PMMJqV+pGbUcV/ipx56VDvla7HjRm8jWPGHU5OoXUWnFiiZAQAKoPZk10thAUGM3WFIVlqa34zDCWRzDvNkbY1v5ohDVsDQAJEYz3vtta4zmfMzl8BRXNRaCanNKP/ZdNtpqkLGTrsk7/Q/3vbEGJSTcncRbLR4V4kC0MAM6i2WBrmyS1XRIzW8dkI+otv4U7qH5/K1miJpBOg0ry/5GQ0SEwBdUNMczUHuPK/BBHkonfUyEDA873I80hnCyOzvv242C/ayexp25+wShoYB2hTyNyBsKOFnLIzbhj22JJuOO4xeTlCIeXxgf3qwq2QERq/8wz44gIYzUIoYKqLCYxdGspFpmI8Af723etlIIhklt/nKH3OxEaM/JrkPF4vT/HKx9Nt7zyPotCv9qpJTZVutcPCDmXSMUMQlbL3KqMaFREccyy1zGRsBhEWHTAJRlCu5L5TnY0tY7EdelVRX+vlCpI0Mn2g8utNYFgL1CuxmGons6AGZykrBssg5YohxzySBv+YpUsPPuB35lLIscUg9qkLar9Cb4yLlwugLo8QRkaxDoC+gm0xeG52kF5ro3yacbEMmE5LgA5N0tVM0 3PpxvAsy FnKcXCH/fCDMCKTAu1U7ed/6b9NHEDt0TmhHynj5f7iP4B6vy/9bYsyX0wrVpIrd8TJ9qeAPJdfVgX0QTd5ic4txJbskuXbf+GOTY3wd4mEmdqVgB7Kz27ZakxlvJXv49AJRVHcU0r4IlN1wBcF8lZHYehuGsoK1U1L44rxSNApclxur4W87UR0R3w2glYdn9fD/wC283PQyuspjdVwGThaJ1Ihg3XKLflRaWPp7qIuPxRdD/vhlQqFXfHP7yQJcU8epPcd66cC5yqtx1xHmERc7nfxR7ko80KIrKqBmr5zy/FUBvH1XEdM09u+Ec/8MuCUVOTGNZVxc5umqhE7Zg/+G/DiyCJStZ9Sb06LnynhykShaYeizlNyeIsIuENbXOYY1bvz2H2TNaeDe8ULcr2hONkBqmqT30qtC4zcjxhsJ8i3mKZxuNm6pc6ZMLbUnNoPUFwH2nou10M1E= 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 Reviewed-by: Christoph Hellwig Acked-by: Song Liu --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 8e344b4b3444..6a559a7e89c0 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -938,7 +938,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, atomic_inc(&rdev->nr_pending); bio->bi_iter.bi_sector = sector; - bio_add_page(bio, page, size, 0); + __bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; @@ -979,7 +979,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio.bi_iter.bi_sector = sector + rdev->new_data_offset; else bio.bi_iter.bi_sector = sector + rdev->data_offset; - bio_add_page(&bio, page, size, 0); + __bio_add_page(&bio, page, size, 0); submit_bio_wait(&bio); From patchwork Wed May 31 11:50:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262044 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 415BDC77B73 for ; Wed, 31 May 2023 11:51:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D24CD6B0093; Wed, 31 May 2023 07:51:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD6656B0095; Wed, 31 May 2023 07:51:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B76F06B0096; Wed, 31 May 2023 07:51:14 -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 AB6EC6B0093 for ; Wed, 31 May 2023 07:51:14 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7CD2E1A035E for ; Wed, 31 May 2023 11:51:14 +0000 (UTC) X-FDA: 80850384468.03.CBE9E1F Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf25.hostedemail.com (Postfix) with ESMTP id 51135A0013 for ; Wed, 31 May 2023 11:51:12 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=SKsqharO; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf25.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533872; 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=ZIbu0TX21EDIwOw8wIGcHvfYOz5FfA+fTkIFuK8R5i4=; b=I7cpX5NbqJl6dnsVXze8KDuR0+dU7Ndxx5rVqsHLTs2q1CvgaR5KH2z9uR9lHCkSrjH8po UUrVJYKdsI6NoeHyzpMEpsPNFMU/1SPzWQa24DOtzRmNHYZR1H8WETE3kFp/o3tONP7nqQ pQiOAC0Es/5LFgbMg6/WEvaGz5kez04= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=SKsqharO; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf25.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533872; a=rsa-sha256; cv=none; b=8l7eUzkMYrgJ4oUMNApApOhD/oj53CAG1PwEiQQJOJs5jUSrpC+uMLJJwTqTom4ogSjShY r3Dw8i+xnqIFhRyA95J7MlruTeVlfk02v9tRZOqa72+Fem2eNXFd0BfCTctJrvPoEwM+6S r2D7S6SCZdbQamI26YLUzJ8FN31AOU0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533872; x=1717069872; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KhIiE2PZNX0ldPMtUgXTcFhOjFzcO4m6Vc6He+n9TMM=; b=SKsqharOrVcZMlzPFUe8COpCO4Fe6b5nqb5uV0C2Se/M8ICSSmRhTVv3 z/v343VqT4DCbB5xwCFYEj/WY5h+AXnsUgq/m5ZvDQr0/E/G4YDInApan Vz8q4965n3lq0cY2AxbnLgQDykiLqyixQdBHHSLlahtvEOpASWqnBweyj BXZcjjFr7YnYydK0VaaS2lb3jqhWdPl8KRvecAlbLZrB5w3jgFOOroEJz UrwA+q17EeELgMUGJ7xBfhY/e2xa4+4E4hZfxz2uFS2nvh3acK/byrj3E hLk0/9mDRjLlupVg4aVmoT2DJVTTdgs6UCApSeCSihyyzChbDRYuFneL0 Q==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207411" 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; 31 May 2023 19:51:10 +0800 IronPort-SDR: cOhLU13zMob1wU3VrXP+1zNibN1lOZ1RbCTPY+Y2Eeqe0d+MXyjcZG4Y/1cWpKcUj2ZmJ8Y8uJ mwP03Of8ujF3+DBffg6+2DKiNVG9rnTFZZgZm2ySQcyRrtnGURcvTwR2w3OwvqnyJiT0qcFCZ2 73MWthS/uhtDwgQMR5SnyYNe034yUjIBCnVUCwlpP5AzRMU6RCOSgNalBtFTGKnIsiusMeI1uJ U8wY5DFg+ii+seJSk22cOxD3Z+QVaAv4HHvjcTsuBZHauQmKE5pwGmD8UsCkt1nkR93HJTnKrH q6w= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:03 -0700 IronPort-SDR: f4sky3ehrJxiT/WAHaDyDgGjgkEGaBVQ9Ynqzb+9FpjL0wrWalF1YoF39q6U55+/vA10v+md4S xA+EZ1AAvJbX4CPvXm2q38H3efX7qrlaeAvxzz0OHLkK/u2zsBNbVKWqTmZi71JeCHDpbVB39S aUtkeULE6SgapnBoQdZNAscRSiR6/B2TGee/piMikW+A9bCZVdTSYmVNk+gXPXJSo+BoUGRM1S G6csNNGPboiDcVMzRkpPA8s+7n4Mf/m2BO4bnujYmZkdKcmmY1nC5gkfsQ85PydSyrrQfCFnhg xVI= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51: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 , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 06/20] md: raid5-log: use __bio_add_page to add single page Date: Wed, 31 May 2023 04:50:29 -0700 Message-Id: <832a810d6c9e71f88b0a39cb076a8c70e8bcb821.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 51135A0013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 598m5ri4699ihjke749tg51kqhi6nkz4 X-HE-Tag: 1685533872-354094 X-HE-Meta: U2FsdGVkX1+xAHb6sihJyC41sJkdIs2p91V5pz2dMpD5JievBjlRzYImATRJw9xCi/7NFYR+TRW6Ts9AnxvaFKl6nraYW93bOSGtsTC/9RPq1dkhL2EU3DyBPjIpg4oGLIhm+S8eJIkAFhu07w6f3zstBVueo14qZd67UxMMAQo87H7BHB3dECKxd+d9biUR0lGiUKA/QcN8KhR9OXnE2KdYo0B/1NRjtXVUCy7OUK0ENUzoIFcLXpj4J6h1VBHXqCrAcJJl336jgiXq7XJ0lcl/j62gfoZiK6a3ZMOxTWtKQIW23OooZ+UZxVAb1zOeL+ke2X+YD0cI0DmmZM1sCGMCxpfdA/euQ+Q9FQ24KMR0T1lfFvbmUTv9ljMJJ3fUeq66e5PynN686bAHjXvRmsYFeVVvYp17JypdX7cM89iVyml/8j2wGKK46GcHJ7+bakiCaB7yPE4rEgU04mTwVS8idXt92EdFJx+cI1Bt0/2CrKeYSAtOgLKVRH5Rt2MAOYZ7Dp57v/R2l+R4DyM9rfWHnZinwt6snAE3+FbI61/AO/TWEmeXvS1FHff/uZmvAUSXeqmdcMui0cIN4svLyC8tZJjqicrkmzldMvP/dTXAI3f/2XN8nTS5HMYFk44F107UuXROlczyOa0WBbwrI0BTcYKZLd5+yJERnzxgU1B96V5C28CTzkGvLV023HblaXp1AHIpWvD1KxSvuCueGPPHkXRtl6puBgRGP6WJnNm8crD3nqLhfI3sqinrXL/hRS1vrfpqvsGe7Dddjynufppe/B5Ao5ZUVfrSn+r+kgO0aKOzEn6gmgCxvwpaz4e9K0MILrIvO3rxU8sv23MTyIjIgOoCym8RF1bLdCe5rMjDWtnbeQuTSnA02YOWG0UEHVq4yM+wZ4m8msPoJ61EBgGSpLSN6Gip21q2n/8zrZJe6ow1MYqvtziiFffiIkhNdZN44vw5UtgSBjeedhn 1qwU830F TC/iljrDZVlQVJ8/842LXGLZ0+HNdgUq3jYzny1YjBAgDP0vM1NT5IleVx36NyqbdS2buTCWcgE2E0bHT1uYp9KHUbdQuqTgy6m27KyI5P0YqmsXISBwalxGDwUlGsMocbsGavuhSqyhxKW1B7yLfCOnM3z4e5mZ5UDiCVUpjHLOUx/WA+pSvrIRM1UXt9VATLYwWZypmJpgxTl7NaTbulhZWKlfuIz5zWqjt/KlTS2Ekr1hGu5k/QG5kJdDTNPs1Gas+Ak5yG81d5X0FypobIRHjfj5137P4aXRSs6MoDqvfv0L2sCz6JSe1E2bCNzlL3atgJFluszbi0jcdjJKPZyxJoJb1HtVbapgoKZic9XgL0/NUZCE99xbDPqv4/l3K7z0qf/U9jkf6HqBCyX6efYV9tP1iXN0hsrbeCDJdDINQfQyVmll1Hb9tLXJMqPUi5ts+C9SDzqJJpcA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The raid5 log metadata submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn --- 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 May 31 11:50:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262045 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 4D022C77B7C for ; Wed, 31 May 2023 11:51:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE8CE6B0095; Wed, 31 May 2023 07:51:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D98DA6B0096; Wed, 31 May 2023 07:51:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C61118E0002; Wed, 31 May 2023 07:51:16 -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 B77516B0095 for ; Wed, 31 May 2023 07:51:16 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 81213403B8 for ; Wed, 31 May 2023 11:51:16 +0000 (UTC) X-FDA: 80850384552.20.1EBD0EF Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf25.hostedemail.com (Postfix) with ESMTP id 750B0A0016 for ; Wed, 31 May 2023 11:51:14 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=p7r46pS0; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf25.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533874; 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=LoQ8onSwPqMBI9F4akjRcl6OSdc0FEMP1YnPrAl3eBs=; b=455j48mf3aDT0TXCVh7N4Wey6e+i/UQMWb4YUK1ueJFrvw8+109TqYFV/yP0EIcHDsPW6s jJbJicBBeAijEeV4m+LAqmkWL47cSF0Q+b2T9hoptIcfrl7YrTjtWrwwLHmqzw+sFCz9fJ /6hYELIKLJPC9wpLM+nbpGDJQQQqQeg= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=p7r46pS0; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf25.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533874; a=rsa-sha256; cv=none; b=TSKLlRlC2gG+bYed5yYyZIl1GG7l9tguaJYJeBR9AzPZBnIByvz+2w8djekhaT/C9Azmza +fkdZCdSM5gz8d6zFh9/ErXJf3mY7oNBIytVSdy8P1iblg7t5iFiFxB4j3VUHoNpTXqGS4 DopnNs+5vayvze7lDZ2qUi2kYQfFnb0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533874; x=1717069874; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=k4a5Zi2GAZJPJB4x28jGupVJUdefs0tR8+WNO4iLVd8=; b=p7r46pS0rJ8Cvq/JeqaPZunBWGvUlRvZb3lFSE/6KjSqKin0PjfQErd6 t2l7k8/t9xKCw7tiCtQDPhy+j3BEy351LOk5kTX/m6ptpMyahNobfZsSB P2BFN+itMcH9LzDztMb3eeJt85rsAclDIEuVK2UYlNuHeKTAfbrspzugp cgmjJjJGQcoisRQ8yEf0ply/m2OxJW+i3vaG9z7BIL4AvaT7kG9bO6nh8 JFwHnJbh0SKWAPKGkBEwabdTw/6rhskONkz8PnqXNai4H+IpnvHhNfm6B eCPoW0unLKpR4zPjvVt5/f/41rcxubpJG++wD5H6aKGetaP3ig4gQyVyR w==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207414" 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; 31 May 2023 19:51:13 +0800 IronPort-SDR: XT1RvUtkeU4Jm6lqVzh6TaH1ONFSVkIM98N6Io1U7wsAipCpmLglbngGEegqV/vZnwiRczAuYX ueOkZjMaFN/gXeJfXckft8VlYQBnHiZxkuCMda/bkWKvyi2O7bQV+GWX1VUWN8V8B4xrms8Rj3 5BEju7xBGZHc4FEvUYT0nl64WsmS3m7Od2TtCkqC4Et/aFpglDcR1CjbMSiDkH22lU3A2lKiKD +ijX4ktptbgJP+gPac8Nx3mVIbA5MTiD4PteE/am12j5UQrSINjh56MIiRdCFsVCAVrDACsUYu UY0= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:06 -0700 IronPort-SDR: xjFPRUk9Ifjou1cDm0luSpwn78hU9nM+Uh6/lNHb7tmpL9BnDcAHIBz7pRZNu+Y/7vgJ/Ez6sY RyJ/ivLjBW17l+dotn8hVR30logKnTYtxKcJUpZjXM3pkCCTww+Wwx1Q95GuK0KwbO7NqPBTzp ajKcCB7MvUhxXFY/oUZ+zxu7dJ2H1FZ7EusH398EBt4EExQgIH13eoEhJohKwTP8QoP4CwoW9U kzYp0zCcFcq66GRNaEJVSD6lmZnBsL7SZcjVd4x99hRY1Fiv7ecOyIyY8X6ND26gRBWXJrsssH laE= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51: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 , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 07/20] md: raid5: use __bio_add_page to add single page to new bio Date: Wed, 31 May 2023 04:50:30 -0700 Message-Id: <27e6bcd762354bff74602e89159cdd12ae3d1fa9.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 750B0A0016 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: jfzadtih5g6zgtdntyw56bzd699cbnkb X-HE-Tag: 1685533874-345016 X-HE-Meta: U2FsdGVkX1+NYSDzxHCVabvdljghMa+kpZbXZBdDXP2lnv/y/eiw97DuVVhu2s8nTAahw9XWK+J9kQO8jflZ3ToSRWByUqYAbF/N1Q5qWJcxlZxtjvOt7A8xujkzdKWp4LB9Fwu5DYqZqsMSQRUAttEKtO7Kq+hNVp1qePGlh3+dEpLZRXumkrve4ZRWbLgpe8MFTWn94tbfwUgB1fr8BR2FR6e2vcHnr9FXI4O6KlsYA3nVWnK/CiUjWSs+IhXcDEdVjL0w3ld6ePhPkX6ik24fDCH8BwSRt2Pb2uc4EJKCwSf7hWSm2y6Q+X/l9vRN3GR9kgAdzA7eewqE76ff++XyziMdm2j8oyn6vvgX0bsUFaDg7Fs8pFZcHwe7u92kZ53Bh9Ze1Ak5KYY63ekzAoH6vS5f+jXSSMhozZ2MJ06xaTwv+TUpS5lmgNxqVWU8VHPNOw85z7sTeoTadpZdXEYH6eFOEYfh/MxNNtj/cguah1VXwUYLMDDmT4e8NzuyqJbCHUbLNIgp/bFYT4F/8B4HPI8PmZy34vCq8i6UdoiQBVFYQx4pklqNmnhNT5ivcfFiPlzR8GJZxqZcR96tmpDtDqbQTwJqn44Bk86LJHmgMXNlVYglFQR2Qf/7yRWjT63OVDJRdkY86xQtdlwWD6fBAMAR9IPaRvFbT3cuEOkcjZasNNsmwpL8JAYZdcJYmApqv28BBhbKYM3LTBl3Z/IrXnBCQ9g5xBlldKU7sCHBSGe7kw2NDvvHk/GkW1yKv/SBYoR8rEsCTNl4ODwVCzsOHnf8uFWxEL495ypH1M9vRZuCrgBwcpLCFqKG7OgTjjmRwivGxAivcpuWODkE0EkF0ePRQpbq6S1WuuY9d3rRyQNdJFyHXtzQKFYlVqfJebUNYssaqTehGtdEgGRJ/A47UuveiZHNZkUxB+QD4Q4YtlEEPwyMgTVChw0PA06L9lGmFzINKkjycDbcAXR oFa6sawX 37+m9wTHKMJ9TN2fpmuY6e+55K/DxtlzSWTo+O40U1/twAnvbohA2vvCdPOaTOCX6oYTj/FfP+bnXivPoeB0xz0xbcwRtvX9fv5eeGVXmrUpDHI9ntG4UogCYlDAx2VC9Yzt+fnJ6AkxSxZojn9z01lGA9ehJiiajyUiUZTiYdBHeM4Y9b3tndVmv1jWw8XDZOdvBGAGruFjbzOq6DN47RuX5f+TjF5QZOG6KtdzS76Eu8h/lxZf52gfjpdCiNXY9FhsQHPqmff/71Ny2lLk4UJgw0zMQvwvihBEw0VeNhv0Yp2WxP7sfzvoVYHXuiFdatyAEpNaKid3n5F4EhOun3w1iDxH6BIz2TZ4ww60pg1RFiNhZNzU2Vpf2T+vmntA2/VCQkiMQH5IPAgJOcNUj0HpNLFuO6Bcbp8y+ClITZOp/6bmTkZbO0j5v3GsC8c958q4vUW/XbIYE17s= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The raid5-ppl submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. For adding consecutive pages, the return is actually checked and a new bio is allocated if adding the page fails. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn --- 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 May 31 11:50:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262046 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 8F780C7EE37 for ; Wed, 31 May 2023 11:51:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EBFB6B008A; Wed, 31 May 2023 07:51:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 29C626B0096; Wed, 31 May 2023 07:51:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13D878E0002; Wed, 31 May 2023 07:51:20 -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 03A5C6B008A for ; Wed, 31 May 2023 07:51:20 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C1F161A0224 for ; Wed, 31 May 2023 11:51:19 +0000 (UTC) X-FDA: 80850384678.28.E992999 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id BAABEC0021 for ; Wed, 31 May 2023 11:51:17 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=nWKBEYpv; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533878; 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=1fr4DCS9z5JgCeOZOjMVffvnm3p1cCoNfC79QY0yH7s=; b=UGUdOFR6Ea7x//Q2q63TnDDnfMqmvW3O6VEEImB+7dMyC96kXhrrOvetqkaO7zs9KWDy4D +xI8ljSuBfhQGGpTdQ7OwECUnoXYYM6k4Umic9FS12zTsqvJ7k4Y5IYDt3+5cuB3yIIUHu yzArSO4yGFdVJwDhTTxvQHoJojt3gmg= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=nWKBEYpv; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533878; a=rsa-sha256; cv=none; b=pdKLNAraTqlqySglblLqy+6jUlGrLnqpWY484WSix4oJ0kohxF1rWbTRNhakJYOy4cO05o sL2vVVL1z3ueWE5a9+6V03m92FJH+pY8KdSf7WTsNfnmF2GoAvfuz8N+fGSlrEurOgN63r UI2cbaNy4xw1HMIMB9QE09HF76hPO+A= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533877; x=1717069877; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5nFlnEeWG8zlFVtdyG/d358hq+5vZL8/oxRNlpo0zRQ=; b=nWKBEYpvxY/fniy5SYSemMNkV+ZAXRIW5+Y9Bhb7L7/1FrpQu6YHuD4h NzbLWTpUex+jOJDTTbLsnqtbXJ7/8NuagtQ0WNK9r53z+v6QOHrDwZWSg TRF9jXufM/jWM+yDibgbLoRiHoKzrb3/wpRZ64IAKwTJdmZHwX/sZIdDp x3EErP2bXtrlmwWmOjazZvOSTNkZTir53Xr7LdOaVn+V9rK+U8/nITf4d HggsA9NsgKNR2F2AB1BNErISrHEPWnCbR2cUT68vJqCXWV+xRE2rLHgTX 2ABgGy4Bh0RE0OZ4alInMc/SgljGH7gjdyuWbSHv7KyStgLS1/2I3w2r9 A==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207422" 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; 31 May 2023 19:51:16 +0800 IronPort-SDR: WM38ohfg1Wu6rQyDqocWkMuWCKKZguQuBXiIMtcV6+Rdf+taU/m1+E/KClnJ+CNFeXSPF42iVX cbg4KksYscZvNsrZOFPC9OmUex7EBn9Lvh0Gw7zBTGy9CLHjEd8kq/sIsytCyStX/X3uERpqzQ bsa9fZBXOFGNsbA+oj9MfHPNqHpgjLseMDIiUUjjlEdHub36yaiBrCy45W2C61Xu5zY7+f5ISi j+yzfASXxxQzaNo5FYoWCeE9fXorw74ck5eq6go5389rAX9dR2358qhnmBjiaxfOtCq+o+/btN gA0= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:09 -0700 IronPort-SDR: N0Mp4y8z2roxzuFvPYeS73dMUyskg4SUdEFYqtiWL7UyYH8QyLK2HbkzyMpGYTT+EF0PQ5R5Nm mbPRnmO0CtIMwMBVMTx15s9v5a5Oh2WyHga/ttkbUx7Jl4Bta6scFUZ2meTIIX541t59maxWrh lWBndZcPbu30Jx/mVNKgDiRjvYH1saj/OjkpXgu9CIhpiu3Rt/dyHI1Jxml0CwwJUNnrSWSZ1k uBy7/6x2V7pUSi3wBQs8HX8G/rHyPZfLVSVpt3mmdn2FdzPjXwB7XpwzdquL7kP57mT3B4RFOz TRE= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51: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 , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal , Dave Kleikamp Subject: [PATCH v7 08/20] jfs: logmgr: use __bio_add_page to add single page to bio Date: Wed, 31 May 2023 04:50:31 -0700 Message-Id: <9fb5ed86d19f6e0b6f64dfc4109a48ff8ff24497.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: BAABEC0021 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 9eg6x9css3mqp5y37ygq1w87cy4xenj3 X-HE-Tag: 1685533877-626429 X-HE-Meta: U2FsdGVkX1+mQPFgo39UyacD+fvMz1T1umXqxg3HLpqbcCeP2s2q1WsF1KDgl5SslH6kGNBjwfkgBdxAbyghzeSglrnJJHfwcjs1i60TmRDYgW4Ave5STWzBQUVq2mYAuUhfuDflV+l9kJonsaS/WV6QzrNoKmPcXdh/MwzX9oQpQ2IsK9ozlcbyMviBNq/WTQtrSU/eFZN5um3hQVzpROJ+XUoRJjm/Vf6vUTZoL8r1W7lgxkMj474za1+EFuuWJ0og3sO7uQohit3ryYNH78VCj0SRSEVblqXPCQ36/8r3JtIycHRB6Q0/GLPpCWQzjLxyY3/NaHfveprLFCk+geDTD8X69+8eSaaCHzHDPHdP0LdMqSCQuZm7sqHeJxTCa2eXuoR5O5Iv2+YvWWUUxhgU/PRkY/au6AQrwW4d8pEe1AWdg8o14DtBHPBUobYe4qdN0J6rLGttqzyWkqs94IcygXzfH3yZJzjIVue68m/J2qeTlpT1K5m6RfyegXhpQ+qZc/2koEXOoW1YcLzkamg/kIeAM1xcCIlRJ6vBwp4R6OJoK+r2EJR2yCCvxPSGW7vIa79L6HZctC7+TEf29ZSRawcuFOFnibBNHKT8fT/WMlxAOnyDWFhewUY71d9UwJSERu4yob3ySbLQdXcs4+7bBfp1Ebeu6pmwtlvyufndgROcdwGWOjDyw7PeaW/f78ZzGpLR2Ao25uqKefNU9nGftnQ/wjeLSc3gSUx9E8so7DPfBd+ieOvwyBQykyot8PQzPyk1tf0sVbf/BGbS701I4tjj483KkymDAIDU7c34qJ78j8k1LyYJNOniaGZRljk+heN9qFWppoSdd5AKvvqbCxFBCkOqoriZhXJeR2e9pKqd2ZHV5x2AFg+QC9wpmKicTU+zh9qd722orSwT62d5urKAvlFauEVS8xqGrrFqejiN4R0HfqnvlHuM5RLhJEokAbdd1BYfgxj4mFL bBXQbxB4 g3OwgUjeQ+fgVQnuEdot/kM25k6SC9Na1S5PvD807QvpC/tHq5ltdBbBwN9GXBrwr0LE4VBNsp/n59qKmoLJBcjZsIYJyXM4A3o7ekJd0FWBKTX3XaMFIt9lSsGuSNJhydwsgzoc6MvCjdXX7CMEeNaurZHNab4hkaFFT7TGP03zW/R7ng5ipZrnqkA9uMZoileuE3nRn4oej7AQtTMomdK1GbdMO5BVQ/qtr6IyR3WgIznB7vaBJ+dS/javAOXwgFn0z95vttKRbgJjg5Ivgt4jsyManqPfucji0B+Ikw2b7cbejYq6EVTNG0p5aA7duTKnxUXvsS0cNoZ+IyL9G8pZNxiefeRlKUE/RBNAvUsRiGJrN7W+zNIhLXKRzaHh0GPKFH5hjsscOcTiUJmskMOFpANhjLlbN1YS7/OlR9soiypQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The JFS IO code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Acked-by: Dave Kleikamp Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn --- 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 May 31 11:50:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262047 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 E3D60C7EE32 for ; Wed, 31 May 2023 11:51:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 55D8E6B0096; Wed, 31 May 2023 07:51:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 50DA26B0098; Wed, 31 May 2023 07:51:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D58C8E0002; Wed, 31 May 2023 07:51:22 -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 2D7F56B0096 for ; Wed, 31 May 2023 07:51:22 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0536180368 for ; Wed, 31 May 2023 11:51:21 +0000 (UTC) X-FDA: 80850384804.11.7C41316 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id 16267C0021 for ; Wed, 31 May 2023 11:51:19 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=WM0knnXa; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533880; 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=3B5ABvvBy0IkS9bGCRSeasVhzt4B/CsILKGKfAmCjv4=; b=kaRCqaJemZmdDNtcJWl1WtNAGp+GUKVpG9xlweIjIDLnLYAP8kx7H16aMPy66uuZ2RLLJP armAIu2/PIkiycb1Zu6xKtuz0fS0u8AKXVhZOCPQ4nMhzcCSYBIxF4D6RWzh75sVchsNca geSz7ZYv6OBpk5Fyat/aBPlFVnugM+Q= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=WM0knnXa; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533880; a=rsa-sha256; cv=none; b=RmytMHCS4Uk79rbxCvlRjACb5d5STjNGG/uj54Ce5rsZ9yiuIA4KeFhLqGp7UNpXKn9b5r NKggjir9I5ae3O1TPGotq6PanKv1UqWCRu9RWuCBh8gecU5HZCtQZI/s8Slav/blLDkXBa dvyEJRbr3kO/rwTW0seresHDqudHW0g= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533879; x=1717069879; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cSkd5AssBzijA2arQQJ/jDabPq82unQrdrIRPZntKD8=; b=WM0knnXapAC5feO/S6h81xnNNM3waEoDY9O2nv1/nCSxQfm9wl3v1hsD qZAclJAlfC7mNzFzQ9fYn/4UqHWL+Lt/1SdO2mj7W24O+UXmtrbkDGMwc yOowkR8YpDRpn++Q0KSxZNr+qAg0fjmM5aQRiFRvmGY4+8jyp8gvIUsgQ VIJG0mijlPYEVGcCsaRHHlh6IYlprj/wIzcOg2+xaGG0+CNareX6VfsGY hBJy5n/pYY+lWPWKOv3zhTAI1a/LEfBsNpnM+qHcKF/S7ZtzvtaGHOUdJ jm0FP+UwgKGViQqAMWgTAAP+k2eIVASjgaOZGFZSI/fvGBQRVbmAkmlnY Q==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207429" 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; 31 May 2023 19:51:19 +0800 IronPort-SDR: JyT8p9e6qMJFSXPp3eXeKMCWprqId/LwWqX0Ky7bORANip7SnUQ2vwj0j5YGNOBpEv9iLuV31C PWvG4T5omOBs33iYDalDequdr3eMQSFeDMGo0MNICLdHEtc38B4HqBuqRyanUKsAaVspYZp2eX jFHkHa3WPXZ84/peJckBcUfwnGMG1Aepn0SDPDRwnmIegWaXUAMnUmye3uezeRblrcCQhdJpSK ZhkuncZdSchrBEdFu8EAALkEf36ScYLgwZ9nfuE4T7LMQRVPZyQ8OcerE8EeZKsZjWVtOdQBUh HGs= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:12 -0700 IronPort-SDR: JnJbKILHB8Hx67SEZIIpe1y6Cfe/bqIgfbZm4SN6soCmKZu0UJsjeqJfDfsm9CfmXDkQbCKFO8 YsXT66muLI4R3ZWh6EvCz+i6T7UJutXo9MG/o9yRxEJcrRvYstuAWlEz2tMVsgpBX0tLGYQh7B kQ8Kflt+H5RbvfNj5NAtdJNflZq2RxUBDL/5aMLyld+sYxFLoDJQXfDCGd4s6JHXPT2Avp5goJ MkE8t0T95Q1EaWVnN8BYTTgeHfpax769+8hNJ/WqPxGkEOmGHA6NOSa2mV2CJ2fxNtJg3AkHmF 54c= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:17 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 09/20] gfs2: use __bio_add_page for adding single page to bio Date: Wed, 31 May 2023 04:50:32 -0700 Message-Id: <087c67d4e4973f949d3519c1e4822784ce583c5a.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 16267C0021 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 8tbsb3myrkpsheezji8h7kypygy13kmz X-HE-Tag: 1685533879-207193 X-HE-Meta: U2FsdGVkX1+CR5LmH3RXjo+MGlZB/3dxvd6epl/Dmf1xP2qFQ5C+N8MFW4/7xOcxiBf8aqE4OjZGex+7inAAQf1mDC72JkeXj1c6EsQYr53SSIFO7Tn9ONpwKvFsuX34plXWdghXSp7E3a2JqqUa8kBhQnpugi9heE/u0zd+yTs2yGQhGnfJZyeVw5e2BIqE6PtccqodXFR/VPdMI4bNprSTYy22u5oB1gdwibcsU6s6K4CAn1jAMBwqUVIszcmd7nWBY88BEehf6JeKjzYMd0WYX0mNfrMydCgLdbgm/mSCcswkxbNKdIdnXIJH1JpmTXVrMd6Bc/Vr0iX73xZBkopOzNfnBI0hLsmMY72Z/yYNKReNIplUBcampoldkWvLMN2IoqnO/PBn6laPcpQYgAPX9xpvsHEMoQGzPVIRkq0m0cmJSg9WOEKRNmBw2rYcvbKTmJ+IIqlq2MriH7TXhTe6O+b2j3DKj26FGo9wUBMHvjmZd7tzHXgFSLzg0o46XZhHVT/Zv0957NxvPDdHe/GQtGTtaCfBpUUax6MMd4/GLWKahPrKwNahP07BKeeM6szhE0bYj2JxGtSfEIjMjth12pWrB8Al4P72cVaSpilsARPvreVyq6y2UkgvGvMMbeyO8MhBqbAW/3CQRTy9Rw5H0m/6iFyTOHWPyESmFgCrbuE12sjuYZyIve4ZQ6zrlx1GnlpR+yDWIPcYzR21A7XzOJeZyN3U0ozPgWaE26bVArU658Ots/RLpB6WbgLkXLG0KfrYYwZNmMixSsSmXAMxW18xRLJlS025OZwbYNaALIJg+FPATLJrFpU8pMcCt0n2LBkO05nyfk1zaxA4w+S1kWCHqaWV6HgIJL/B5rnGWym5ZnEDLLBCUil4npk29+/mrUSdUk/QnqJ6fUGkEYviakmeP5sD0+zJRBq2MgKMcPEN7Jcb+WclStL8a0OCMalv36AmSitfJVk8Bzj wOyf3gkv glskLp6rVYRVQWZdTwpJjsjPt4uccMz8jdTJjWNXaMpuiE+w4VU++En0ma7YSW14aERjkeboowm1OTpMS+zNWV4ltOT9GeljOfSQuJ74ImsMBe9/iAr5pkdNUrSrJZBHjpmuleU1CSXm60EgSgJyuVC6SQSwxa90NU5TGgyor3yGAG5xVZN5rV3hlXfAH9alvz2wZNri4jpHJz9Bcr6FzjtWeToMLIVzNjItrkEURyP3dC34EX38ke4ILvZNBvpMdroNXvQZpwINUcdyTqOc3EQFOZM+DjxO2WmK0X7sz6mi7APjZpnr8Kb2FLE8Fmd3XXyUMbm1dHQnWM5N5/fqowY6O2Hf7AgHM1WZ9PZHXYbAMVLwm0m7yrZY6JUB/kBbKVtyy8oQcBWhVDJ8r4wSHog9tvNtWFEqApPkImAIhoopcaDg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The GFS2 superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Reviewed-by: Andreas Gruenbacher Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn --- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 9af9ddb61ca0..cd962985b058 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -254,7 +254,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio = bio_alloc(sb->s_bdev, 1, REQ_OP_READ | REQ_META, GFP_NOFS); bio->bi_iter.bi_sector = sector * (sb->s_blocksize >> 9); - bio_add_page(bio, page, PAGE_SIZE, 0); + __bio_add_page(bio, page, PAGE_SIZE, 0); bio->bi_end_io = end_bio_io_page; bio->bi_private = page; From patchwork Wed May 31 11:50:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262048 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 E556EC77B7C for ; Wed, 31 May 2023 11:51:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CE916B0098; Wed, 31 May 2023 07:51:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77E4A8E0002; Wed, 31 May 2023 07:51:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66DA66B009A; Wed, 31 May 2023 07:51:25 -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 590546B0098 for ; Wed, 31 May 2023 07:51:25 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 37D8080362 for ; Wed, 31 May 2023 11:51:25 +0000 (UTC) X-FDA: 80850384930.08.49AD38F Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id 44BF6C0024 for ; Wed, 31 May 2023 11:51:23 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=GlSHO6Rv; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533883; 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=IxGJiTH6ZtTqQv7kMwXfygYzomFhd6ij9tDGz1CDdC4=; b=CwoyxXqSu52zRtFM2/eKOeDfnJoMiAm19E5mrrJgg/rmYUmjGP8PJAxWXIdSXbiUcx3dFD AYupIt011x+HMFdcyAT/ANVsrPzWwvLXkSzh3OPZvHXqSj3J1YbZTHOjPbREAqZDNL+rv7 /NQKpZ3gnSFz1L5LJfD7VybLmaolxvE= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=GlSHO6Rv; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533883; a=rsa-sha256; cv=none; b=on28ESN7uqW6fXn90iLf5JcGUauxhlbB1HQt1XMN8dLzKebMVbk4Gyi9HldgZGpIcgMMRr O6xdm8Yi68NfETfFYV6HQNqAPiGyC3CaJsuVChNZacT9tGCaK7R/MLzupuvR0Rk/+rDmwB XW+vGdle21lhDi4AdEyELlXmcJVoe2E= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533883; x=1717069883; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TtMwPwqoJmAQPgnjq7wocIny6svRrZPugVBgK7WOt6M=; b=GlSHO6RvnN6aoQQQEalPdvvMtFeQOGj3QNP65loyJuWS5iEHe98xM57M 96Ad2As+n7GBhKc2/xDeqzLTMwA5eAjpxP+6QWyNy91ZfzAqnmf4soAHk VY/QX060OabqYNJfCU68fyvaJ2nRxV5EgYkwVsRqrWlpAwvItrGRcqdkq OWwb0kPZL0haj2Kv5p+1pNeCioJ3CQHABrz670BWhazucD61USw0vlMRC oMtPVIULLaltq5qawN3s/e5Ho+E3kaITOwQGHt2kItx6xQJlnHN2qwyS8 TMSPYBBOfJpfS4q+9P5Xtif6N7ssml5SpCbV0WqUQNi6TwKv+xLMVU5NR w==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207441" 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; 31 May 2023 19:51:22 +0800 IronPort-SDR: aOZkA1gVtqRRZl+qDlft7PNHMX6jLeC5kolQjnSvTwngdC+m7Vtt6bqdlKqLJ9Kw+xVN9w3OfQ Slc8GcLtm0dWF+Xgc6e3v6bx4XMMPKfKt7rNfn58NH77hdKzgfrKQ0pOZp89UI/fpm5KlyZCpk zEmXaD3Q0LcjUOHQ3C4PB4KqLErTcLKqgQydM6QzERy70RXIqDdUscxoqpP9G1PDdCHHV9xi+k mPdW+ZDrBDTtV3PvRc7ESPv5+MayQ0pNdVgw365yteGSkdz/nTU4vAN0PQJDpei+MNmpxlp1Jm W+k= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:15 -0700 IronPort-SDR: lSLmR/VBj2pjG1BOKyzbzpWOt10LQ2v+W9nQSkfzvPSPIPVecgzRxwE+mTlymgLSKsZZ7JJYhd saR/IYHvebRwJso+xoYWje6G9oEb7N4eM1apcr9zWPZykON9DnRU0Pvqa3YoovOG9mo8KMnQix +59L8VmldaWJ3bDq+eFFGdKuoZg0eQew9RjzgnlQ9qsTIpDlvXIvDrTtcd9QfWAIOE87SHwlM8 bKsDPUc4+smximEMS+6wPCkGqM5hMJAvOL+JxbNTObAa1Db26lV7WOnHYrJwT8baEncOGR6XK/ IhQ= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:20 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 10/20] zonefs: use __bio_add_page for adding single page to bio Date: Wed, 31 May 2023 04:50:33 -0700 Message-Id: <04c9978ccaa0fc9871cd4248356638d98daccf0c.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 44BF6C0024 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: o94sqq4ypth9sb9t9ff9ftjanmi9nhhf X-HE-Tag: 1685533883-757999 X-HE-Meta: U2FsdGVkX1/uq5HDTGrkRN2ip4jeJ+5+gjkRez+s0l3QPKqFYEhLEaDBm05wnJjfOh6dmxcAcauhbAUboPVRMTvjJiz9wPWCKIl3Dmx46heLSIsTCXkcBC2JshIWUrdM63e5CowhsaY623HKuaGzNGVwI/AZIXfxNwfGv0YIqJDyhYcYdtESqyQrVkoBqIA9ydZUF1q4sdTxap+1KtzaJ1oKDj/0P3R5dmc8HGznEf7386IgyCW5mZN/bZ2w6o4SYwGtitPRbr52nFiTqZPFJWcRs++inlk3qb4L7Ywzzx/ttJChkTXNtrhmI4piS5+mv9LKxI10kw3lARV0+ZKejpHq6wUAfoZgw5um0o6FyFVauwg81rlB5XbZORAnGgvQSar7/knX5aYp7s+ZzRdbPX6Q//KpfQ/HGYdLMvnr3efXf0y/u7aBjjNAfsQPQe5Eg73NJDRlYu38SbCcMiyBv8QMhRmCcayAbu21oosT6SFEBq793wEfT5nh6QDD5CNWJ76Pg4Yj0aXheG+4pOUWlZ7u1057bXz6xW4llDU7Lk9pj1/gD87oz66nP7RcSx1Jtg/FdsecJj1RIH8DvSV7PTeR9fW1KagJvmSXD5k4TiyD9Yna7epbnw+AlQUCBX+Px6SzXu3d9FcRTWMLj3judyaJ6kDnP8O4KOcPjnSR8/BM74suSt9jo6W98eB1q6/kQyylgZHrARXAB8EWnd4A4d3rrxQcZTtcXsc4rVVRkSEj4cGeVgT2G6ro/hvdS7MCf3LGIsk2nMfPmlmshW2gZm0Njq6fIgeMSokfUTq2CDpr3nfLAqEV++HBQGlnCZobSpC112SbxakQT8p6hJgBbrU7K4xo/7mFWfuDbno7yGtHiwVpF1NeFCAP5zky+2Hn9bd50eC9pH8QcavGDtcnrQaHj7ZZYgiCtV92QL91ibZ+hQV8fm4DOGDhFw6MQOaVbkMneCIabUObm34Oee2 rjxqV+3e 8bmxSlT59n4jIu+bXAoVeKfLmmawTs5L0Ij1R59uIt6tzxXReUYDfLqUv78yPN7BmrcFHufkbcY1Ch1o4srT45eMPtVKqriYkqgbZYGxjeNljw1yR3h4tlQZTYAOcqljU7JLpxswGCHqdJ0LDY/qdFdbZZ0GY9cpaJNdX61JxQcoui6ZHikkBm+tPsehmiCJs/IWpaeCP0SnyNyNZGyNOlR0/v55qqH0yWAtZ4u2x5bGVl+hkHH6uTjhUvkitwhjlHhyRgYPjvDreS21JTHXd22jETc6lYo8eQtWWiQcoMOuB8j3cX5U3USoMAaNKHepXxPKJTZ0SiWGxTB1beU4t08s3cFEkuaPlmuOYPH/gYkB611OxmMoK7oHkUQOZ+HGYXqNdahobAVCEc6NUbp9y/finWg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The zonefs superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Acked-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn --- 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 May 31 11:50:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262049 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 1E845C77B73 for ; Wed, 31 May 2023 11:51:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B29276B0099; Wed, 31 May 2023 07:51:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD9F66B009A; Wed, 31 May 2023 07:51:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C8BD6B009B; Wed, 31 May 2023 07:51:28 -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 8ED236B0099 for ; Wed, 31 May 2023 07:51:28 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 692A616039F for ; Wed, 31 May 2023 11:51:28 +0000 (UTC) X-FDA: 80850385056.11.E1A3D94 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id 482C2C0022 for ; Wed, 31 May 2023 11:51:26 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=VkMHcR0j; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533886; 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=RgTLQ0ujtVrmH2npoMMVqBnEFnH1HMUaK48y8FQUJdU=; b=E0wKhnD4up5jk7iPsXDRQfJ3tLFDbsabN8yT1tV3sFnX8acYR8Qqvpgna2KabAFl1pAvHr 8gjxQq+Zp6Kt3HnP0KNjmOQoqZDS7IIG8v4TjK0DzYsAK0Zx3eTRSzdKnkDJ4Eiduz4D93 u6vMPoMsNgMk0xAtUIp6yVkS1bcyLhw= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=VkMHcR0j; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533886; a=rsa-sha256; cv=none; b=7TY7NywKHzdj41FPSExd/k2583HC+ZwGiH5+CWS2deym+3tZVwdrhxrf9/O/ZWlF7wR6s+ YKNW/er4HH8uvMlqdcJ7WzLNFZIiLCgevAolYFM0E214mnkpV5Og0ytnFYuSEiyITcPeTD R6WWDThwuYeqOqvaxjpimDqP2eEBrPI= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533886; x=1717069886; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KEvuqAniWi8kHi4qA/R0NoUerrluHuejNoQFU/cmxk4=; b=VkMHcR0jJYA/ZXyNtvgD0xJDnmwamvJ7QZlxEUjUsbjWoU5RSSavIH+s iZ+DV1BGhUIduWofTrKMZm8BqNmHkTEV8WYzvZb3pegPAQfJUYIAetgBk 7s2zZ67mkO3WuugwBrVoe/ZgNDECxtrtKPkptgv2WNPjU03PYat1rT/iY IecEjOqBfSWXmeaXZPt+u3dgzCQGP5DlagOopTT0k75o9x1a+4L7A5EFV mxn84PBuG31V0dRKyajE/wGFFABFketMIoOh3muXWUnA9W0hSzPFbDyTq Dv7Iz8nCzlZeFOYSZsVyw5BlFjD9p/1d7cmz1tRj56Z4xHwkZGn8gycM3 A==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207451" 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; 31 May 2023 19:51:25 +0800 IronPort-SDR: MJbBIHFuq3reXblpSn1KLrPGcO5o82xTCIaepnpyQjzgcWNRUeCTfGCRAoHvfEhXQeqrKURS53 F+TiWp/PzVTULJPQxt9c6YzHuMms7NpYsbXv3NE2jpaGMOBHU6mwGMgp7AB/+Y1wGuM0fBFZqi dC1nnaIrcmZnvMbnPyKBQe8GUJV8iptVA3a2t+funG4YAIcRdjJ2DqN/ZjVp7tbOWwjFBxHRVa c+5p/o71QXexBWs5/fKX1Y2mGDLRwGG9U15amKvf17mHIIz9IIDxQzQPWk7qc3kdKPTQFFGN1e N44= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:18 -0700 IronPort-SDR: kmu31oBFaHnnNAJGr+xhYJn5TvPy7FWZ+3bDl/POq5dEGZ6Ww4ILjSxttl5EfKXZDUQcRli+rZ moVYwDDX+fxlfeNlv+Wrfhx9qjjhuINsRqJ7wDqXzpUIu1qfANLUrv5fZXWn+bq6nOyCp9mL+A jd+tV7p/CL7GZwMnIHFGfEi2kh03FzkyIpZKhbWLGSyU/rpV7IQd8BnuVNyYVVF4Clnms4udrr 8axxTzuHHRxPpkFC7dekm4y71BAXSfErGtkIM3AXOE0UhIxp+Ce8ckzsRvifEaDe/YrKNROIOM ZV0= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:23 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal , Sergey Senozhatsky Subject: [PATCH v7 11/20] zram: use __bio_add_page for adding single page to bio Date: Wed, 31 May 2023 04:50:34 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 482C2C0022 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: wdn9eqthdwnndsu3osy14z8qmdfhj7k6 X-HE-Tag: 1685533886-838568 X-HE-Meta: U2FsdGVkX19/iWOD6+QqMjCqtLIUCb6NSGZJXfcH+XOCn0q5r+Quu74h2XbBKCaqadygNaGAP+fDnwHNkbG01ICC6VYBN2qBbXIeuhZKQfxtIyLNhdFMa9NJUSGY67jUzCpg0g2HtnewIzsGT8uzLkLvZO4L0qAir4ZIQ6zTsnlio+1OK5yozxTHe1otbPCJQ4exbCLna/7PxhvJbl3fzZrMRcwhzqjhIMMcFSX4zA97cJFM8uS18ruhCwguB1HSyLBvgO15ARPCOhJn0AddyVBdaYln4/XVyqF18+5VTe+fbGNEuQvBpUk0fkzcZOCYV4a58dxXkDUCGWhfB/TIkjo61QSIke3Q/qpv2Q1HDWVZiKFyExh2K/hhnardn+inYMXnOz/L4u+nOUIvQuvSnwcksE8OE7lHgXOMHajdD0Eo3tm3hpl+26hwH8LPNu8HsFYpm+icZBlH0APUbLSyUBNnzDajMUEXU+xemwvbCAgSFFZqnD9LWdwg4izRNsQOyfCV98nsjagwjDvVIFmt5hyrBYZX6CSDTXN3DgQIo+lN5h0Hn5HbrT6ClCbftMcbhFxFLauWmHLgbDLZQ4khryNG+NyrTuXODBK+BmHEm8SMt2QN2gq2+DBtpG9sYvUdUOebdxwEtO0q5SiRdBC52G3+vDhLtznGywGDKB1aXbLHhaZ+Rb4wESg06R8tJHD9GqJFte/XzlDjDIVwW7/bs19olDFNlval9Xev/lFf3nJJMeYLOuNZNvnXS9r9Deo/rwYFTx5ChObEY6oR5qK8uV2BfsqfSxED8m73NAFNKIfIj3WKUBlJ2+xZRSzdcuu+1M8H9Lm2Vaz+LIRVwv2/k8zsSo8tb1ottCdo/YVrtib1dvdEb5Z3E+VF9g7vRggHHhesINsg+mQmTfd7Kkz7Qa+1IgE1AFcQGwB39mEA5TunKILRsFTRLm2BEUxW2W4T+tMdsIvdDJxgkS9dpuz rVuOg00w 0yjnmtW50p0wiSSvwUfJZkos8xUCk0xww1ZDPsopIjtuQXhTEU98nOelFb9x94e0hSB+JNidoqDXW6FAxM23mjqREF8N5ADavVyFhoYrLTxBkhpIG822/xAjUqWUyhs44dqxKGKJb8dyqn1DWqY4DE9U0I0HSh44tATSOQq6QGp37QeYHs3Ce2bxPcBrRQe6WEaNrly+Dx3FpnZ6BywO81Iat6IgkY2RnjaleB0elqTG3dI+fMLKOVDPs7R8rSNxQJWwCoVDaAsJhvmVkIoiJRxHxhaAOJR4MehBD4k4CltXSMmnVobGGwztN0MVVAmduk4eyGRW4XlZWiR3aHljJgd8qCD6BDyU89NPDhvMamv9g9NEMKSUD8PvyP6CGNDyeuCs7ROUxL4PCfDfNm4NHt0JsWZSQbI5C9E/MphaxBRPpKlEP7Cpr4AqPmDzeeVHtEcQcJFj8S/wnAYU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The zram writeback code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Reviewed-by: Sergey Senozhatsky Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index f6d90f1ba5cf..b86691d2133e 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -700,7 +700,7 @@ static ssize_t writeback_store(struct device *dev, bio_init(&bio, zram->bdev, &bio_vec, 1, REQ_OP_WRITE | REQ_SYNC); bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); - bio_add_page(&bio, page, PAGE_SIZE, 0); + __bio_add_page(&bio, page, PAGE_SIZE, 0); /* * XXX: A single page IO would be inefficient for write From patchwork Wed May 31 11:50:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262050 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 3D3C4C77B7C for ; Wed, 31 May 2023 11:51:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D253B6B009A; Wed, 31 May 2023 07:51:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD75F6B009B; Wed, 31 May 2023 07:51:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B76E06B009C; Wed, 31 May 2023 07:51:31 -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 A64386B009A for ; Wed, 31 May 2023 07:51:31 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7F3D1160390 for ; Wed, 31 May 2023 11:51:31 +0000 (UTC) X-FDA: 80850385182.15.24016C9 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id 505F4C001B for ; Wed, 31 May 2023 11:51:29 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lbMSW3Vy; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533889; 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=vBhERJyH7iZFJP2+DBlNzG4J3OKG3vOoXxHtp7iVZXs=; b=PTTqcQUOhhNE3IfKpI4W+w0VchJWqvOPaM3VONlIxlcfHA0Zp5vaC2EjodATWNZaM/uStM t8UOVaSrMllH2ArU3QUV+E3zW5HY8Y0hz8bpZ9BY9Ayuk5l0hDNQdomUvR945RxGa/WwH2 1tPsqlJpIYrl1ILo6ghD90dY4h25N/Y= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lbMSW3Vy; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533889; a=rsa-sha256; cv=none; b=JDoaN7046LcMgeBoEjhAyOZ1kcw4rgNiWkI+aD7CH2jVW+zHKZTW+cA6mhKBP0cwzUydDp gczW5+hNRX9qpF8o8LVXB/ZZuv1xE0vkFYfcD7sUuknkApo7Q6diD6FIcGBrGBwmIGm6Y4 zp/lCFdHvQBctOIf5XKMKTddZPzGojA= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533889; x=1717069889; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hm9sz+6gQ1vQAlShNXkzg+WL0o4VgpWyUzccJnRSUVY=; b=lbMSW3Vyv4tyEWq/7dSFD1bZLdcouxxx7F/jpHbzBbU6Y/nJGlyI7XYq /WvhDa2X8RyDe1HQmGrcK4VWwi3+xMlyyQhlx9e0EzGNx1Xu0mxObjlTB TDvUHr9SuRz1eIcr4dxh+tCV9WqXqK2nBMN22sA9kNHoQ4mZcm3J62ylF SDQYLtqyeUy3VMfW5mPwBlrEQ8ERMCvgm2e3J3NWqzfsyYb3sTeN8BxSg wfR5M1mhJjrH23q/hgW+8X8bHT5RtxDj9ZwhZAz5u+GLW7jEJYmWifGZn Dm0hjzQM7PzQs3k3YCS0AsGjlRSycyDmnjHcvLNm1POOfbw1fbiWnB1lS w==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207459" 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; 31 May 2023 19:51:28 +0800 IronPort-SDR: zQeFMzA57G8Tjw6snFJB2HAiifXayjgPRsSx11EuHMfNcwdsLPLLufMcY1LSVuEW/UUNPErFIL L2qRJ7Z4OrORyeEFK1fKYXuz4mFfp/ekhvBjlQzz2in8Hro6zaQBmBooD7hvJ2jq2VooxMZ6bG nIE6VPvEJYjgivWh0YCdwagNSwqAZCLcf0iuU8/Tr2/Gi+td5Lvs1OvFsDwSSir4M5fvwMv297 CQEH8t/L2nvApRjO0xkYeRqoj/KUH5OyMPqG3lY+WJEcBpM9dHol1zSi5Me7MqQz1QFWYsfyHH RQY= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:21 -0700 IronPort-SDR: ZZvgdXqWvf2bLPrnAzdu5RRz15ga0Chi9bLZvedEHwiFH+B9pi1FcckdZ9/wvgZDFhJZaVL+Gb BhT3tjRKwgxHLeMEuSyllM/qJbuncE8qbGgRTt2n/CBlkxPhKUal5Omdh78LULTg56zSv1r4Xu EaLt4CaJU4Rb1gJ2dDbb7DbwFFDTwtL1QrA2IPFcyQpyOtCc2SCv82C+Ozex//EzTenqavOpi1 mtt/lwX3ifWVjnHHZE9zO0efKjQ4U5fS3Sv/0Tpv49OzM2Qr9C8+dRTcsbUdyAftaM3SElFTbV W6o= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:26 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 12/20] floppy: use __bio_add_page for adding single page to bio Date: Wed, 31 May 2023 04:50:35 -0700 Message-Id: <33c445a3b431270c72d9be03d5da1b08ae983920.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 505F4C001B X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: phzdoxdts99m1ep4o3rxmnis831136zu X-HE-Tag: 1685533889-784873 X-HE-Meta: U2FsdGVkX1+NpudeIItYYtrPTS6302bc7p/pF0H0UmhIpCmwyHXfi0T48gY6pvpi5iY3vF/pJ9w9HLsWa0f2GU6D7nRkrDjpqeBFV3+AU7gUJTVhEEXmOHuwExGhmjcU3qiOpbSmUFGG0VsZ8fRofP4PyIuoOBxk7fjOvh+BHOu8VVB4owW5gwLdYvsRyWeG53PW2g4xJ3QNlkB83XB6hS0LDPjJkD6b2FOdFuihEB4CmqONIHL2vX4eFpXh5Om6fmQUz7r/GPsIs5Dn5s4PEQIyrxJ4KwTKFoqb1CIC75GEi1Ptn85cHsOBBdg2x3r6PChgtvBw9mOm3wlbMQO5oeS8ardQkuumzB16fJHeqMsXaZwt5cqoZLgT6pcG5/0M9IO9vc8ReqaPZyFiYD2YMVupkDOi6ckJpCd8kSFgMg0GVj3ZeKonUDewOejdS5gMMrE4qRzQkoz+iZMey7HIHdzJt0AGIeyDUoylLBGX0JDI+TzgX+YuknEaSADeNYyGBT1xi5vAvP1cdVpoa5LEvFKPi1DQ1ytpdUidXzhHHgbJBbmrN7B3yNh8ai5k+ZjLYWVdIxiOTihDkaL8BNtgoe6mCiYIROMsFOaiEsjVqvSTssphWsE7b52beJDB/m+QBmVYVWNLYWTF6SKPhWbsbvXA3wBeMnpu3N0W7EL5tBQ2Ce0yVIk4+kpCJqEjo/bNMQMDYdArAoKpjZGBPbCs9TZ6XCGLOw7/oAXMN3RHuRvOwbQ4/+57C0jSFJAGfoCJmkLizpDRD2rVvbeS8bX5N+YQMsN8FIZBhclzzwuBVpfrMBz2ovlD+Rwf2nVAhBN54VAtNpLC85GAnLjVz/xMNGYUlJtoSY65erhTsQnPObQKaNSTeep1wlYntAJmawtaEHvSYyf610z1qNUHw09a+UNtv1KUmFesJ4MDsDv0AOtJEn1eWh3OhTKHxyCzKxWPRG/7/bpw1cW5dfTh1Ju LEDCqG5H U9UX7Kjy9gtkQg+5MgI7X5Yi4/7kEc5s/olk+00CQMAzEWUs0OvExdfe7ycyVkoqadRvaOu93/XRSsoghobrNDVy8WPMr6lRNmSBg0HQsDxSnGQyMa5K3zqV3iAl0QhWK4obuoxiWom3m8/hWaxZKmHmqoG3zh3cwNcVEeL9jlPmpgtniQNQZgKZQuqL8uDmzRxDCPcW0fg1c/WS9Opf2/dR0mHjdALGas05BzpuXjzcsolTStPQbYmk/0UAO3xF/pAdkC9FVw68bJtvy0FWROZmfkUI2vLtwtHeitrayYJXZbFLrfYDfTWVPJbiIQj9BwyqO4GTNIHSQ9M1yYaANZ+w1vA7w9x0IsmuyZJT7iq/ktWOq2M/x/5su973N3PI4QpOTHI9vhfrLgOpHRJ9FlWphiQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The floppy code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/block/floppy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index cec2c20f5e59..28ec6b442e9c 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4147,7 +4147,7 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) cbdata.drive = drive; bio_init(&bio, bdev, &bio_vec, 1, REQ_OP_READ); - bio_add_page(&bio, page, block_size(bdev), 0); + __bio_add_page(&bio, page, block_size(bdev), 0); bio.bi_iter.bi_sector = 0; bio.bi_flags |= (1 << BIO_QUIET); From patchwork Wed May 31 11:50:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262051 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 6ADCDC77B73 for ; Wed, 31 May 2023 11:51:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C9726B009B; Wed, 31 May 2023 07:51:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 079876B009C; Wed, 31 May 2023 07:51:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E83C58E0002; Wed, 31 May 2023 07:51:34 -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 D89FD6B009B for ; Wed, 31 May 2023 07:51:34 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9D99A14035A for ; Wed, 31 May 2023 11:51:34 +0000 (UTC) X-FDA: 80850385308.18.CF51E9C Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id 873E9C0023 for ; Wed, 31 May 2023 11:51:32 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="e+3h/c5l"; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533892; 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=4wltjMlOzsPDRwIgGzzKckeo7q3CC1AtmBW5BIRqZZc=; b=ESqHthbwXX9CyJru6Bgqukd3Sm6Mc0g83mVBod4YOdjrkdw/NpoPQi+XHqzDk+PBwhNhVd 6wmCSvKSjNQ6Em7lYKYJbJC7BzlicxKjxE5iLMFZHxXCjar5/sTgYYMuhA6c+VyPdRJGCj 9lDzyBT0V9O1Jz1+qb6vYJPSkGCSPUo= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="e+3h/c5l"; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533892; a=rsa-sha256; cv=none; b=EDTQWZE1XM3YRY4KCrvEoiepzYLp5SEAZWOjlDKyH+LrNf9dByNR7PkskvImnrL9Akie63 LuQkY3sr99MvOH/loGXdDY48ekVSa3n+NmKmO4zOwENztZUY7lVBP/bdNrdnHKmIlQXAlO n6iMAStHvxW0mhY7OgGyC+SASAk4nVk= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533892; x=1717069892; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ea2jSAo1rrcM5ItwZsgG7lxFamxzjCiiRPLmWH2vTf4=; b=e+3h/c5lnfwZWZdQgchdUaawY0qdxXli2Fm1EFO8BRXJYEWjz/xA/KOq ZVLhoina92KoURvboGuWx6GEFzjjR2xbmBcges+24KcmV3+4iGHyay3Wv YD0zos1WPUTRLA3a0R7fxppG3m5EdCxNSV9YpRSDG20Soc+ac/dgcdDLD PEdlzFlLUYyeKrNIxL7+lIyweUa0pnbXG3G9DyXaGS2IoKcO1+qdavKyb LNmavho0nrF3AuuGLvVI+gbuF4hIVfn9V5xj2Xhj2uXRtWOfwDTNo6h2Q HVY12h6oUcsGwK5DrPPj+H0J7u3jDs9eCf4fjr0oNczIXpVe/rf4v8ND+ A==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207465" 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; 31 May 2023 19:51:31 +0800 IronPort-SDR: rMnIWjOcL7+dGL1rYGO5MHf6oBC+ti3R5hzz9a2p8JUZXwsFEDKYLVdsUzN4vzIZCqdxhrhquI crJ3dUfS/A4kAzx3FqcZRkdlzu8PGecBj+98aKMUunYxNGH3Tg5zMLbBPaV/2P/aEaxa/6kZ/M ckOT945xjjrDEeS+EKDbLj6uiLIvrqQY9YBANerDKjD4ot4PKDAVPMRmMI/guZOfSReHwIMpYo l4WKKlPkv/Q9/nzF7x8ly4ze9nTtB3IfuEythQ3y/rbqmfMtkAmuEOwD4tj6AV/us/7Hbo691t qIw= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:24 -0700 IronPort-SDR: Z6zZ5moCZAo8HyghcdM8Wh0qvfaCT2LiPQW+ewVuXAv+zyl3VKWafiSq2yJXvM/A54CkcTJN+V kRVbq0irr40y+MWSjgjPIzREhnBw/QeLa6OkO6LV2aSFbCYOSOdgOKC/mj9w510XzxJvNJ+Ppc bKsq1lcjXCfe5M8sYfeB+boMuGe7XuwZ5WTGw2/M7CwC8jX4gUJEv1IB/iHxsG6xSoVSNEIkFI s8y0GfyXNSKO/vqm5AA9muwlpfgMinBcH8LoI7yFQZewBeLk1GwYOBtK16jZm+Elw8Aj2MWMYn WJY= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:29 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 13/20] md: check for failure when adding pages in alloc_behind_master_bio Date: Wed, 31 May 2023 04:50:36 -0700 Message-Id: <827aa12d44ebf3f50b41b47f5cedc0f80179f2c1.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 873E9C0023 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: sj8u4rgzh6t7cfyg8ygepaxckcu73tym X-HE-Tag: 1685533892-898279 X-HE-Meta: U2FsdGVkX18GAItMCtSMJzM9lNgQ1Ar0uOuE9MKflWIRZpINpAelCneRQrgQzHnEMNfjGK0e2zp/A/ww02vuRON01SNWRKz3fDYSrk1YxaG0kOPv/T2g8k1Dt4sbeD9IMqLaVtZA6z8SToymYUcvgTJ2MoQqD+YJEf1IH2bOI1bLC4T3Utzl9rJLWHIXofnqbzUl/MnOOSm2V4qqFJeSrTxJiEFkK/m+0+2qrZLOVmFnYU/RNeDyRySbjraBVHNZ4ToKy8Q1EyrusGorgLPiW6b7QfEoscBDh89OaQIe9p4iA6QNvjW5UI+J9rZ6mLocCK0o0fk0Pr8SOC7IMTamVTRbQ7K2QlwA2jfuyl5qd7wf2sgf6l6vxSaXn7AFYhoc6zWb8iwzP6NTNSVh4TjXbqkoi0dLtInb4THdYEJe+7BzWqKmiE1dmv+EtDVIxtHdjA7K7X22ethtM/+2W8TcMwCUu73196Dt0hOyKESKPtNIXTvEkEZc74i7W3MZRPsZXSYkZyAuQSTKzC79mcoUEJbdTBU9wNLivbnPs4sI430rK2rXDdihjnZsWEzZXUv/WtvhRIaulz+vWyoD/bdVGR0QnELYBZlk6lEnQNNXzCJKItZkRFuUDB3J448ZnDCmrMG0py5/DK/SQlIayhIswa6gCmu8ky1AWK6A0UmcmwNkyYhEEPJtvrHXdSAP+pPU2MxFHkMvu2a/U/03CGy5XqY8VIO5S2vyVzgz0NzwZf8pc/DuC38kl+aT1Z7RmdTvFSnS0akWt/J2WpIC5pyqpZc+YosVyPKuuSFtO8f56o91IxEapxhonErCsEfgIemAxzM0LBSFKj6yAiG1JS7OBaE6kvDkm9lxqKIsbPhkjkM9PqMg9yUiT/dvDITU8wweXXZDgbsAp/GyhtRintyVPqZ8U/R6sIrqTYU5KZ145eZewePIKvJ8nyMDIxZrOH2Yw7uTDZaunTpYavzEoKU EV+JjAK/ BBjJkAiQxkvv2erVJfvg16xEwl7ihRSMr8bNPffv70PZ6h8vy6R8p1SJeBRLVnpP/w4d8DCrYLihMVCk1O5u289SsNRTHDX6Lgf+Sff0ZNMc19pDV1f+yzHCl+luA0ZnNnz1wXVLqNgQtwpIeYJdqEWnf3Ey9qiSIPK4HgBjLExt+K9isjKyWLHwyB1Rk4gS+DoKNFnpmxTl98fymPGq0hDfqFMTn76M8c1YLkGtriWWgXj6BUUkFZE3EotwmZKhf77fMKweElVKBbRD60wb2LEGeevL7tsGdySx+Yf1TZXS1k1WmZu3x1WhOErlXVUzYzlMhi4o+zaJ/unz5pW13iIwek92PHE2/9v8nmLp0PNkTABiL6FJiiQubmqT5MN75WUm7aFP0IXb5x7ceEARanicwqtTEIYco0p8FTDDzeZ94RtHbD/4AhCOq/Ebo6Y9IVhnPDkjkFnAJoLtYAthBEA2v3VEeTKPtHTEkLzmL3OzDlks= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: alloc_behind_master_bio() can possibly add multiple pages to a bio, but it is not checking for the return value of bio_add_page() if adding really succeeded. Check if the page adding succeeded and if not bail out. Reviewed-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/md/raid1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 68a9e2d9985b..8283ef177f6c 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1147,7 +1147,10 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio, if (unlikely(!page)) goto free_pages; - bio_add_page(behind_bio, page, len, 0); + if (!bio_add_page(behind_bio, page, len, 0)) { + free_page(page); + goto free_pages; + } size -= len; i++; From patchwork Wed May 31 11:50:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262052 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 62A2FC7EE33 for ; Wed, 31 May 2023 11:51:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07B7D6B007E; Wed, 31 May 2023 07:51:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 052B96B0089; Wed, 31 May 2023 07:51:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E5CB18E0002; Wed, 31 May 2023 07:51:37 -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 D63646B007E for ; Wed, 31 May 2023 07:51:37 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A903FA035D for ; Wed, 31 May 2023 11:51:37 +0000 (UTC) X-FDA: 80850385434.22.579910B Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id 95A58C0020 for ; Wed, 31 May 2023 11:51:35 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ljvAZG0i; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533895; 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=e5jeRClelxpWrkKfF2xneuRF5zHKGThLfAoZ33Mhr2E=; b=mjqbS60f8yZ3liue/dBFd2vztblqOJteNfqUk800O38eEKfCQEBCgAsjRFyfihK1Io6Se2 ufS/Vg9oBhgkDfaZJscAgtMor0EIs29Z6wGegT38cFE6pmGu6vvOWz1ILJJ7X2D0MeJvUN xm36GkeQ/ieQP33Deljaf2m4U6dByXo= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=ljvAZG0i; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533895; a=rsa-sha256; cv=none; b=qSIzJBxusZ4VdE9SCElIbEYt1GIihugI+CKmbh3ePPtZGr70/asqqAd8yMWgB5zxcUDMtp TNrnA/GXjiqcq9h50xh2dB9FXwGFc2VVMLAq00H4f9x76Nw0EQE73RS4Uqh6w7b/sdIg49 b2yjiXzPSuWduOXtMICMkaSHFJqEchQ= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533895; x=1717069895; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bohfoz0yKcyrTKAmwYJ5eEtuSyoqE/wma/5DAX2SoB4=; b=ljvAZG0iVaEm27TH4iIw69Mb9W7NhtX5J9z4HIjKL4Mvx3VYXvKCC7zI JGMpPwircoLGwrcOodJKI6xKispE5JRD5lJ6rmcXjlGBFZyQipoYiFWCQ /2AQXp/gJFC2xLHR6Q+YsSxseD7a0/rTrzHH3bfZ7/weuY1llmNOuXdk6 DeoxLVO96IsdYlQp4K5mCoI4GpM4MtUWCfDu1MSEnYTJs8UuD+aWIn5N0 asUqgUo0UBucfffgtU3xdgFY2Iryw21oi/QTbE0JiQW1k/EBaH8KyCD1O Lq8QXyFoDybsc8vdDWOD/RKgdK5d/XDc6As6P3xHKDp5ssLz86Sq0dbZi w==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207473" 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; 31 May 2023 19:51:34 +0800 IronPort-SDR: RMm+mR80mqUTcBqJWehnD55GKfXH26olerxhk2kDdlPAsXM7sPeEtVkCvZ5fLcbaK7vgc7VmET 4nCZpW9I5Z/FobLsLVatkCtwZ+sCM9tQ9id6I5kcgsW9e3x4kCkoNku1Gh41a5E39E7XzIqF0r F5SqOfXfwySlrE9o6YGasSqUuBiUOZR1FT9QEaN3YmAh0DoeReO/pjp7tbhWvPK60shUOPw0xZ LuDQHNxQHnMGsD1JX+SUo33H4Pm7fyn2fsiIG5Kxpp8XHas62UoN1sVb9swnwZ4/jBENgFqwa5 cPg= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:27 -0700 IronPort-SDR: RyI1mO/6ZDV1E3DLyp6Uz4OkisAp3fmmDbkdi3t8dad2mENNTujbJYnovxO5rrnbcFvj44/+jo 9geIEpgzs7b1YFKTE0G1l0Lp3+lEzNTl9X1NIJsU40I2Prt8PsF3yR1dayx8fCgdFyyn8gKXEz IXyrLtro5IVNZQZrV6QYzNOWEEJMlX3Q7lqTPiOFr1n/0rkij17qLKpIKNy8BFHJEhMnhLSV+o YRHeP/3vtyn1/eOy69ZH3PZyRUMWrOMLRpBiN4E9fFtSLU6ZiZvnsiJCzeS0GaTmXOpjuO4FSL 0ms= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:32 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 14/20] md: raid1: use __bio_add_page for adding single page to bio Date: Wed, 31 May 2023 04:50:37 -0700 Message-Id: <6cf7f66c6e646231200d025dfd5f2d3ae75c8fe5.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 95A58C0020 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: rx4i3g18jh49t7ac8qxw5n39h48ttwqq X-HE-Tag: 1685533895-831078 X-HE-Meta: U2FsdGVkX18dAFO0ncTN+ASNQDh6cNPj8bZ1JfJnNAYDDvZ0zXIh3d3bDySC+D1J6CHh4H5RM+dt+lWp9zH5p3BEdJ9Q35Bc6Vg60gYpCQWLBX5fsdy6QlIZz+AktW/mqejv4wUx4uZMRycEXC3sAB7yh9lvordnbtPMULN25wQt97d923oIwdvwnw5H2O/OAb0TObjaiQlY4SDyGww9QlpaHPIud43vsThdVObC9tnylx/FWPqqJ2WQNjsPZx6WsShgcnW+7RIeD10Rc3cFRMwuPFmE6Wl75WBvHZyZfu0dAvR6osnDGAkUHEr0KSuPlsBLSDblOYBOMrOnoNyivhx/zPfGbem1QhiYUvgog6jAcRYxoiBlynGvMq20zy5verIgzgylNzvjDNFljGUziL0UfPIaPaj2J54sEimCtNmtgzhV2Jmo2iiucl0vph4Z2hSrcoBOnhOthgolZDYRezBIyvSLKR4L9fEfCnlnuxi0ws5c0OICIvMzso7UU6o9W3iTVjKeBxfBTxwNQbjKBn3jQxZQR5kwyo8C6Jwj3BcUdh70co10IQpI21uZxTrX+cj3FEUqyweYEg/vt8qStV4susMzZw/a58INIY/zJZl+xrNY1OdrK7u43RUh37IWwsh7ovz+aFVgbBQqB5SyR0I5LznFtczNQRpBGgKM7nFNNwEDI9QAhIaRwEsOhe+GTT1PuN1Z7eYkaHB4fwjJ3yS22c5IeREnZVQJ40x1YTWOLiNZOEGDPXPrroefxQDGV79eneRoKq5RJvAUPobD+zJjthi7E0pwCsO+WBey9KW5NmL/KJ5SRuM47tWM1D4Q28t/OMsMEtnnPHrEe/xwmxExI92B+CSVDiRu3KgCogkYOtio4DjseqUtKcxKTw2gpfTXFCZegGLsQPyg0YmrZ7NVNMihVUDYV5NrdnLm0tk1HfqyHBxar0tON74quNc4Op5ZaWQpisTSA1mA0eQ 2ZQfP4SS d9a7l/FdeE88aYkcqD0lxfTLtsS8iWPDxwhJy74bykOHu7qy9uN1wv0yBqRWLcd7PAfB+ymZOh2r1X4EdOSuWWabcikpddkzj2oL0leL9IU73CHNF3f2vEbngAM1zVxiMPoDh9G2XRG7y/BrqmAvMe2El18k4lNVRzIKrthfVV+d4OWysPskLHU5N+NEBaJ9Pjw1Hq7CaVMID885DxHsEA0N4v/sx5ChS0XjQtt//qBpLh5JCzBq5SgJ3M/g42GpIxHnuKlTc7Z7wLTryauHcfp0/RijEP+rKd/fp+lKw4RUhBKorySITn7K00Ionrgm6lfCtEyMo0kmCVuu8rVe5Bm6863z4IqzucRGqZ3WsD/1mAms+oP6rG+5iFx8GEPfUkD5NP5MjG52QgvpoIemJJe7gaV2n1+1/M1WBwIv1xnlapUvxpeYxGhkCx6MjbjU0nlN+huzdw4501sI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The sync request code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn --- drivers/md/raid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 8283ef177f6c..ff89839455ec 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2917,7 +2917,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big * enough to hold all these pages */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); } } nr_sectors += len>>9; From patchwork Wed May 31 11:50:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262053 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 1AC6BC7EE2F for ; Wed, 31 May 2023 11:51:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB4256B007B; Wed, 31 May 2023 07:51:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A64616B0089; Wed, 31 May 2023 07:51:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DEB38E0002; Wed, 31 May 2023 07:51:40 -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 7FAC86B007B for ; Wed, 31 May 2023 07:51:40 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 58990AE490 for ; Wed, 31 May 2023 11:51:40 +0000 (UTC) X-FDA: 80850385560.01.6DD3CFB Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id 39A2AC0024 for ; Wed, 31 May 2023 11:51:38 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aMQ9y8SP; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533898; 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=FHRiaNGH8GsP9cu8M1JwbyzXVk8Y8PZLkCnUdeYJEAw=; b=Y4sql++lD6JjIbmet69SjZa8+iEu2zisjyCAGQg+x+n5e770p/yrlx9jm+b1JIbjeKZ8hK cioONQjQhZbm7fQLWPOegKmL1iPwxlmg5Z6K5agVhSZXX6hmKJM9yoip7/vo9na3L5Wfw0 HqwUTzqOywFdqGU4emedcYG+oNMxPhU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aMQ9y8SP; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533898; a=rsa-sha256; cv=none; b=BeSN6KPBFhN2QhG7yilioBDt/lgsK1+rdJkiBW3SXf/pbybzuWLHAVsUR3SOGfOpLjhIcg Kk5Jw2+yCag2iNTRlJBpFL/qWqrRj+Jl9CIk6xgHhPFMm9JV/EqkW0uqGBB1p3TLcRGmo+ I2gXCG0CGBSYqFeroguL+XZLk9XwYXo= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533898; x=1717069898; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6E0YSkUBZHvEVigQ1cP3fDbvdT5Seq5Rp2IoJ9HugPk=; b=aMQ9y8SPa2l21zcvmCfYEgrX5gFDWL+2lan1mbR211KN06SbMvji1Jyr zSsLNg+/l2keASOVm0rxxa5L6zp2UNsum5W1JU2+Cfmdb/qqtz8iMYZGV 7YOX0w0y5/248R5POF4xwNgYm76Pae9cmTFt4p0xr/YjigHTo+m5Bwi76 S80NdU/xRq7CKLaJYlbjvmsfCmivrWoNf7rtI3uKrZ/1uaTTl0i/hSSIL ONZgt8s5CxIBzN+xqaRy85QuP0unP+1c6A43Xde8eSGy5YAA74IU2PseV nbt13+N8yjGoaaJZbtXt7Oy0DzLd9Y4lLfyzf9DSAncKv1/Kto/QidSUQ Q==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207478" 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; 31 May 2023 19:51:37 +0800 IronPort-SDR: CU2Nayw0gQfHU52EB7QC8/nTTPU3LqUOp8gpPfRxcR2p7mFI2wV6pxYXHHGNAaxKGEj1RPnZpS PJeLLDSKXV+2OhL187kuoKsTzgmfAj0eb1PaSL1i8PLDs+xX0M6Xw20XXhZKZTOW/EgAPgd4Xu PeBbCqibo8M+d8YUhfzOgrd3qN9TwuysYZwYklyWj0iqGS/J4TwNgu9ovl13w8F8RBu1p6dkB6 lK0dFLH/WcKp4+PP9PPZXmWWmLBsUtlMC/Xoqcrn7KBOVOzQympzV6kdEIFYEhcCttTVbirINZ Qig= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:30 -0700 IronPort-SDR: dj9wdSmathvJ1jOI9aJAqtcU+ByV1jbR7k6k/UPOi9YViazTXsL8jm7ytyX8fRKf6g8on0Tw5c l8RC/N/qurdeB7sQNWHsX61rXiF6IyZIV6RgzzkT88Nv8OOVuY+L5Aad77sOASOny1yPabjYNl gfA4qWBFySa/pn1UC+0Ui4ujsIjkOFt5upt4p23k3JYTaHIYineLkqgSOpgReCb8j2J9o19Hi2 IsqVmYyiFwI3cXTnXxXq2BtR4lvT+jp7R2bqCuuxAAIFYdFWMXE7jRgd22L3cDz6QsfNcuAWwk Up8= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:35 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 15/20] md: raid1: check if adding pages to resync bio fails Date: Wed, 31 May 2023 04:50:38 -0700 Message-Id: <33aea4c271220dc9bcab58c4b7bec478c1511142.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 39A2AC0024 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: difa3p73p7r3bx79wtucwxijb6bib6dw X-HE-Tag: 1685533898-450443 X-HE-Meta: U2FsdGVkX18aRY5c5JY6iuWzLxVNbBzPW3WYUnnXDOCLL6yS3dM+LdCHokYrw3GZgSG4MWFnXzY3yootlfhwLon9lNdpztlgFiTQCedt7p4sOS1lyr7xbPG3c3gDMCIVHDYrfSOn16+ji85MWxSXePVcGb+VsUYa72ACfKI6gCS9IsHU2TdCz6EM7oasihzpZrjjwDxHXk1aKGPz1lcQScWDj4J2AqiEG2SGL8pLi4ypuqemvTXWEhggu8QOWy35x3cTT3hUZsAatl+9hBuscLDDvdhJ+Iis4qgTrztlg2VRMXSvKMLcQYSq99lB0Kd5Cr8vF7AQNlthS+GsU2wmhK7oJJtOZNN/LXJObXPJd4CbNGw3WgHYI4+Kk01OMwNdTvWSC+WNM99v8MZzvoZd8BFpiQIjjV2uoMy7dUGeCkkWuyawEa1yrryxdJ1U3Hgs2LS0JMpaQ5sMoxEryXDaFhhbeqUUmGZyJTZDgbuQta1y3t7SctyxHsEcCIWCk/gzBvkDtT9OP15HUiqcjHxr97z6g/lb/CsMLBeRhjU22miivPJPdCu8FLTEw3KoWXdHfF3NRMp6wGUiqp3F9L/GMiYbKXrcb5r2X9nI5LzwE4X8QWTSWXDlJvTYZ2tMhjOn6PNY5mqgKiFPbzpbyO0M24t6SwEXSHDs56l49aayUBf+A77mtakoGfpV+uZnIVtECs18H5zU3X3wdzoUE+2ZyaN7NHJ4V3oq7G1C/RzbgnctrN55YTdAlrEPSKrch/CPgorFT+wKp76lXh/Fto8/GmEDBEmbOkILbEfzlpmYW6ADupOeN4a/cdoZ0cOQHMj1B25aZ5aNcHfxNeWeut5vLPloU76V8f7oY62I2J7aNc4rzZ5BR6EaBifx4rvW6VMiMEaEy3VrAFlIDqiSz9EPquPoFxslWtIHsP0o8ZG6t/T8cCzWHqFRPYC2CIFbT6S96BpdT2SILgHkHpHlE53 pHh9OgzB IVwhicLBiwIP6cMcItmHoLxPl6TrvoYfodw0LQ7oR4ufYXMJUH5Dl5B7uUUx/EDIkHij4nBU8Nm1ZrLekOFpsQudkTI7THvjb7Cl2vJ37iBoOsv/8vJEd3pVVAc73kvDg+ScR55ipIbADPuKtLf5IOdlpo+CnVs2+Nf4honn0Lftmxf2R0LrY/L8qtn1YICsbDOXSGkLD7dkR8BKXxvpv6EXGdzaC6QDHQp3ek1dagDnwpG+yhdbxZNtFO5lBGvEbwW3bdslqpljvA7y4n8J/h9vGgFFQCltJHmYCR2n6baYOBgWVGpRmg9MFfD1OcoIzyvXACkRWHM6FMKH/azBRJQNfab73TqS9c365jRz+5cHKEGZ6qmDj3+Xpj4yG+JmSHe/NHBVwPjnI6i6EQQx7EnZ7mQX9NgHORNt7 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. Technically __bio_add_pages() would be sufficient here, but asserting the pages actually get added to the bio is preferred. This way we can mark bio_add_pages as __must_check. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn --- drivers/md/raid1-10.c | 11 ++++++----- drivers/md/raid10.c | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index e61f6cad4e08..cd349e69ed77 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -101,11 +101,12 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, struct page *page = resync_fetch_page(rp, idx); int len = min_t(int, size, PAGE_SIZE); - /* - * won't fail because the vec table is big - * enough to hold all these pages - */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return; + } + size -= len; } while (idx++ < RESYNC_PAGES && size > 0); } diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 4fcfcb350d2b..381c21f7fb06 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3819,11 +3819,11 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, for (bio= biolist ; bio ; bio=bio->bi_next) { struct resync_pages *rp = get_resync_pages(bio); page = resync_fetch_page(rp, page_idx); - /* - * won't fail because the vec table is big enough - * to hold all these pages - */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + goto giveup; + } } nr_sectors += len>>9; sector_nr += len>>9; @@ -4997,11 +4997,11 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, if (len > PAGE_SIZE) len = PAGE_SIZE; for (bio = blist; bio ; bio = bio->bi_next) { - /* - * won't fail because the vec table is big enough - * to hold all these pages - */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return sectors_done; + } } sector_nr += len >> 9; nr_sectors += len >> 9; From patchwork Wed May 31 11:50:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262054 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 3B9F6C77B7A for ; Wed, 31 May 2023 11:51:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C88FE6B008C; Wed, 31 May 2023 07:51:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C38BE8E0002; Wed, 31 May 2023 07:51:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B28A06B009A; Wed, 31 May 2023 07:51:47 -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 A02F56B008C for ; Wed, 31 May 2023 07:51:47 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7A10FA0238 for ; Wed, 31 May 2023 11:51:47 +0000 (UTC) X-FDA: 80850385854.06.AE2CCE7 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf26.hostedemail.com (Postfix) with ESMTP id 6698714001A for ; Wed, 31 May 2023 11:51:45 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=JpQ3pDzz; spf=pass (imf26.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=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=1685533905; 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=7tVUjP4+PH6St5yF3wX9Wp96WFgE/j1N0ByIBSNUfaQ=; b=xwyOeTd/jtF0cKoEQ32K1L7MSwtzoTN54o41gqLH2fKEKaOLrnFgo4WDSXFBO4s+nF8Yj9 NVnjQZi+0IjUlXumNbQ5BKdatFrcxR6LymM0O/3mfEifaDjPZWAKc1QnE30y0N1EWrSkgS Fu19IwV1ll+vUraYMLE9Qr85HULBE4M= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=JpQ3pDzz; spf=pass (imf26.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533905; a=rsa-sha256; cv=none; b=P4gWrQOvaFEf13ue+8AHwfbJmulOtdQtPcB8r/NMih/WFN0xDziE5lcZFjb61CQjkI4kDf r+LegXhRVzN+98dxMkQlHjIQceSuaJjXO4Gh5JfRS/+xvLdPdqbp//QN6mDLDmZaU8u0T9 HcNuxz0rnYxhXNNQigau+/H9FRw/eNM= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533905; x=1717069905; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wyX37qrNukpOnFd0kuw76h6e0vzZ4DyBtjizjt54zEs=; b=JpQ3pDzzP/UzK/L8axRMmRuO1u1XURFIGR4ua7X+vVgn0rGMtWar7+KQ v3ZIF8ZuXyzZDpH1SN0vEndvJDoMRcn4ZYZ6e289ujRX3GfbPNS8lTIvs ADP1MEjpv0/Ol9Gncad+0sAdP4hjZwo1MO6WOgpfeM/xLvOsRzZov2A2g pVOFD6tZoaQcI8TBM0wgDzjnPQ8cAeNivwF0M786h60WYN0wrpTXz2Z8K oomyVfrzDfS8va/86eP6Gx1ALLpiEosvK6SOFjjyKHFQFfWSIQY3+i7rH 9nknyR3PjQwz3oVjMA8hNObcVJUZBkseEQq1bPFfyahG17QtTrcmvukbJ Q==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="231985149" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 May 2023 19:51:44 +0800 IronPort-SDR: RV7ZByqdMeIvg0HLvW5oyqzXDzBalWnK9W3zsNi7KLK0WswdWxSH2r9vaEnh3voZjX4wAwFuOX NX5yRkIrJXmvys+tjhgB96BVehg/0jm+83TikoZz/L/pOiYoGm3KS3AWJ3ANtBUPtqbY52NKIL EBY3oYrdoKXzSz+euH4m81Chm/xTlIevtccd9f2NmBmPdD+3KiL3jV03CAU+2jj1m14zWXdDqU /mJr1ABm5P6Cq4EO84r7EOCFZVExjR2+MnSKVITnw47DndSfdTe6FT0LOkIh4957HE1wrPMe5J R8o= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:36 -0700 IronPort-SDR: xo459tElfFqtwBDe2sQAJqvwfBpbSzCQVTTIg+wPUWJFH5rvf87QZ0/LRdMy+YjMhlouZBBxmo sSFHKg9lUYcIkRHQv54nV+2OgEzxoHzxVahxn3BeeKZAyYylUuWRRTeDS6dvBOIxkJePE/rTcC eYbX1rHn5bbth8QftqRWLPHth0Gq61eGFZ6K61AfXG67LUgq2wZH8hWCBqD5V+7su+uSzYeeSR Ss5cmfzwMHsFg984FR8v7pis/w9ow+W2i6iaGIo6tiECTtkMKiiQqzdfNTk2BbJ95DDObBEoN5 z/8= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:38 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn Subject: [PATCH v7 16/20] dm-crypt: use __bio_add_page to add single page to clone bio Date: Wed, 31 May 2023 04:50:39 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 6698714001A X-Rspam-User: X-Stat-Signature: tsguymw3fi3mjehbi4b8x39wescrs3c4 X-Rspamd-Server: rspam01 X-HE-Tag: 1685533905-626614 X-HE-Meta: U2FsdGVkX1+NGaaCsb4qdIAE6PFgdyPOmMkUokCgERjcPfHAD+Yy3l5ZRUm29ckCDxtDVn6EKT5BAVbgxikX17sY0zvk2c0o98BSaprdxB8bVc86Mw0fvtJOZMjANP59rPEm7RhUZEj1OFHV6BY7w4haaHNUbvzd0a5E3s0LNKpe3RofMEmNOxGSBRPc7pqLbUySkUl7zd4PlvMEgilSXfNGE6TYYzQpgRY1S4YeBZyJuxcenO6pQTXQzg5T2wyfCj4vXF/2EHD/4g34k/EGT1NWYNMqRyQvG7O+QmtHZ5xW4QDD4+dWAu6zDJJJQ7+ypoY68C/ZVfv/uERi9ZXeJ4UEOehdmFuIBz6UhE65wmqgoudE8d+O3pDuR1PmeuWYxsMAgCi49etD8dlBMhL6O88PIPVaaxXl5eMDeABTfDvicl1BYY/qEIG8PBkm0Xayzdy61OL0492obsd7oZ3REbPVBk08n7GlPirD4TIZZcgLtQhLjP2OtzhmRdQqOF16WvSi/6YuSLB2Fjgj9UWpyr+Da3acniVtw74X1mt4XH6DxY3PoGHion5eadRUgrKupWbRboad531G3+EnRUumHkM2fB99h07i916Qn4WM3PModFHDW52gOi35UZguQXDSMideI6NovgaEqrkqTwKQehuEyEhs0uZbvHafEGkCuUBJSMMqYEEc+lFrFxPzuI4Z5pld+YL9/JRuAFtPA5KaxPlWVJxKNUjHUxICTze3XnNs9lNeylxVY16tdD/271HZJeXLstgaHqD0ZkESeNMqkAxuosCt1hbPFTCCVNpKECBeF1GbByeK1pA+5X6UJzxQxxJIPvYNAp9hVEmEjCvDiA6iMei+0WskA9Ca7bSuX6OD1FI3Rnm7cJNqt44NZ8Qfn2EsPaMlsaSkPOdIE972wqWL5aCxUbfgDHoC3L2TjCXUge5rUgYSebrVAVLfg4t6KkM0BRQEgXRUXn32lrz OoBSOYsM wZaAOYTOEj6dtETf0mAwzsX37RZxsryhs2gzdH/AGHCsOsBZmkZ3Gcwen2peUJnvP1E8HDvWNTrqxcHZa/GT6IdOkjLjUV8a4cDs50CMsTxGh3ScfjTpDQLzCk4CsgV+98SY9k09kpzOshIpbS6LoYVAUGiN/GOPo6QDT48v9qhRBpdbcYrxGJKw4J0WMyKvMRGerjVneZSLX4pEqcB7ip37RkXaIWkO2Vhk3wirP+ZfecsFCpmkzln/OhLQlGamcYSi+nQJOpSzkIBsgrqfzP8eQ2m5VkaTRzkkvmJSNdDt8RBnXo7lc2g4xpda+VlvO+kL8an2S8Oh6tFpGE/3cCwdV5tQzJiq+6ImknyyXx4ppTNq/GTtMNpJREzekU/kywPD5Ad1skjC0XQ1sgcrwXBMd4w== 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: crypt_alloc_buffer() already allocates enough entries in the clone bio's vector, so adding a page to the bio can't fail. Use __bio_add_page() to reflect this. Signed-off-by: Johannes Thumshirn --- drivers/md/dm-crypt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 8b47b913ee83..09e37ebf7cc8 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1693,8 +1693,7 @@ 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); - + __bio_add_page(clone, page, len, 0); remaining_size -= len; } From patchwork Wed May 31 11:50:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262055 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 6AE20C77B73 for ; Wed, 31 May 2023 11:51:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C91A6B007B; Wed, 31 May 2023 07:51:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 079FB6B009A; Wed, 31 May 2023 07:51:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE7F06B009D; Wed, 31 May 2023 07:51:49 -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 D26CE6B009A for ; Wed, 31 May 2023 07:51:49 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B3F73A02C9 for ; Wed, 31 May 2023 11:51:49 +0000 (UTC) X-FDA: 80850385938.18.244EDC1 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf26.hostedemail.com (Postfix) with ESMTP id 8E26F14001A for ; Wed, 31 May 2023 11:51:47 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=k4eSqbp1; spf=pass (imf26.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=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=1685533907; 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=sNH7pVmdygoeCZgHZmSqANM+8vLZ64wXe5n0PirP0kQ=; b=W8eTvAt/CUiX6p/wW+s6WTYJ4YPbcnabMV/lyO3xaHM8FNlVHzDn1IXgYbdUOncoQ/7cWE jvOj03amF3VbtDw0gyPUgmtKVpK93OigXzmizSacf8odlvtd6Lr5m7Vld3NihT8M00JLE3 fMrsyXL7OHHBbnb94F2XrE3hXnZcHGM= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=k4eSqbp1; spf=pass (imf26.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533907; a=rsa-sha256; cv=none; b=2Rb/myoUKu8gtby5JZxWzjYWnan8tb8pL1ZqRiCds00feC/sJQwHKV9GSsfzq91HRUO/oW CCftwu4SmE7c2ylFaXKhYFQmlHUtxYzmdTazlb6VWvUcpjTpZngY9YinvJkkyka1EO1eFG FVvY59vgZBM+zM3Wvknyam69m2hdEbc= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533907; x=1717069907; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eNep3j+omtdw7VUEVyvSEuMvQR4DwZ3logtHWgIlxjI=; b=k4eSqbp1fj3083PkwJjNIxMcsMqWlIPrnW1KnZ5IIxyNY+QTR2x2Avaw PS8CClD9XVliG70jBIpMLMs263nTuDvoDxoN8vidBl8InK3o+9gXyuYim 6DNOCAFZf8Z+wCxknt9hGPoDWFJ5Z1l5c04TXOhjpQphL2Qd3FdKCu+tt hlyL75w1+luNPchwv945BsGvMcvLTsPYEQcSoYsxl2CXwTwwS03S9xPQX FBI2wPFLoiQORDlR5sceJAUxJDmIGxJWG6om+hdqvDwixVY3n6hgyx02U 3QF8QSeCGZ1UOVjAfm+5KopKQm2aCKw0InCU2VwW+vyDPytRCkZNp+8IE A==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="231985150" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 May 2023 19:51:44 +0800 IronPort-SDR: bw7la0PQ3W8gWs2NTTjCMwDjFt8V7Z6SGDhQl+x74wCZNBJLBZHQ2ECxy+GizLldDwWThf2Zrc /5KXmIdpJDqPMKq6Y5kIBVbuUGvhsTaH4wZM7hyueEhAjSMqMJNRLQrKIbQq+hr1tUPIytRbnZ E1ELZBZv5GaQ4p2IGeWLq2w87w9OIoII0wrEH4Ud4ZBr8lUXir7ikZErtlNY2afbVXBqoI4xvO 07kPAQ4UUWtUjFzXeO73hWdwfCNksX/kL71miPIBjoa4h/uoXSdWdxowIHbBRVmK221Las70PI xZo= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:36 -0700 IronPort-SDR: FCL2eubAZP5N9vA9HDK+m1l82gIsrfnKwR7xl5QF91RBemiBMgqeza4/jZiezHWUmx+A2BPvbg diAJW3D6qzTTjWDhUmm4+CPI/5Pg7yzgXHh3HJFIrkz3I6/YCxvrl5dZGpioD3FIrHJ11rp7ht I6HmAKaEKAajDqnW187jX1JXP1SwiHNqHZle9nVdQDpjjStKHttQk7X5nq4km22hnGrB8FLHbJ 5GGj+z1T+oiCsX5btGRw34bpXv3+vXL9f6GlctCmHk5dzGi6sYWMqAROn6Jr2ed+EqoN495klc Cyk= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:41 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 17/20] block: mark bio_add_page as __must_check Date: Wed, 31 May 2023 04:50:40 -0700 Message-Id: <7ae4a902e08fe2e90c012ee07aeb35d4aae28373.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 8E26F14001A X-Rspam-User: X-Stat-Signature: 185crwg6agog57zmmkc77tx5pcu6mbbs X-Rspamd-Server: rspam01 X-HE-Tag: 1685533907-231327 X-HE-Meta: U2FsdGVkX1+IquTUcIZmm0cng+keYfkiUUb1tyKrxj8DzvMINBSD02BG7NlXOa4PwCd52l5/m5Y8Lcv6EPvWj723GoN1YqK60jOOnKFVKDbFW7+gOBDfVzA1G8fSXcW8M0CWHRqbw35p60EYFWnvwdstLv7Hw8bfPRcxo5XPfh0Gxkvybr+M1gdcNXhTv/QxS4WXWUxp6LViRQK8lh1Mp8BPoSHujrwpDY3Qn1vPPPS7hrmjK8Zm3NphjmwkKyRC4HWxyYhREBUqCIhkLn2M4HsQp91R3S6hPwuRzOkdHcaWxB6QHuE8QLd9QxiShb7/00gC+LMoNckSlhle17s3fzggP8hSkzwrR8kd8ftoOC8kvNWVPH3NLymglu0j3PywoIcwfRjIfiQMh5rZbgNIK4mle9mDGBdaJIovLVzBsU0OXx/Ltt/oEq87AgmrGWqTJZOOkHoSQrbTRmeOVwP3hQ/uz/hDWIdSiSN2/1UME4LlsGtANXZhJmSstsVctA9EQ74WqbgeECHAlnIMkz6TnW0sSakTMgr+bX98JqWs7Jw6gZoiIhwAgNS6MMFvSN4PYlG0tvHDn55fKmozRj+GDzciI7OGOzkllEjtfwCsOSpAV6cJ7hoiZ+gfmAikxhvn/s3isjnOFoMt1Q9Ht6L649UfGS7LPV86z4QPO6hvvypt6onWdapBsCweE0lntjISHT+pm8XkxWQkKwh0jXxYhg78w5raA5tSNVHtzY2ox4yVCyg0VsdTR8+KjJjZls1kqnYQhHbASqq0VORszNc8J3a+WpCMmvymcqo6WsCWnEwXw1hRVTAHZZq2Wr/NmOfZhYIG3Q+qzccqLI7CiWSzKkRx+SGB6ZqrmBsmWP0tKYiufMC/dtVk0QBfwcysQdFb5wV5qTfzMOd9rLhrKSfJxQWksvjzlueLiSCfwIWijb+5tAvg7SbxGyYxpwDT/nzlXJglMyRPOIkcjmiDOeP /xSF2WgA m9i6GVHZQ4UVUVLYSLHyZmPThJ3MqtUGpDYuwWLk0ADT1oFDdUh7MN1UA3BRbaVtZ4yS5uxVWl9JOm1WKj4CwJroARNnkEkQSPjdJUh3i4foSjuJvORE/qv8LS29ROf+AuiJqEbQmPBMih3WyivnCOUjBui71LmNSycDRyMi+DiFDzlUMybbGZQUbIa2JS19crzA2/hpu86GgZffKd9R9TLfDyCv8sBcEgkGlRQa142FBi7iHPpLFM5AlVmtGol7/RaZNuJ6aDaZA0as4XYoUuBwhHcHTEMPJZfwuXXi+zd1xLv4mKWyo5h52FG2umu5abxJKpFZGKauPyotvHbHGlpdUdRjQZD+9k26WHNv55B5/usaW6mG8uVda6+kTYvlfbse/lJhKUYES3ITfNolICovfDA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Now that all users of bio_add_page check for the return value, mark bio_add_page as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- include/linux/bio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index b3e7529ff55e..ea2d937d3cba 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -465,7 +465,8 @@ 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 *bio, struct page *page, unsigned len, + unsigned off); bool bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int); From patchwork Wed May 31 11:50:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262056 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 5FF23C77B7C for ; Wed, 31 May 2023 11:51:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED44E6B0092; Wed, 31 May 2023 07:51:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5CAF6B009A; Wed, 31 May 2023 07:51:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB0416B009C; Wed, 31 May 2023 07:51:50 -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 96C406B0092 for ; Wed, 31 May 2023 07:51:50 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6CBEAA030E for ; Wed, 31 May 2023 11:51:50 +0000 (UTC) X-FDA: 80850385980.10.F5A8E34 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf21.hostedemail.com (Postfix) with ESMTP id 540781C0017 for ; Wed, 31 May 2023 11:51:48 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=FO1e3sfq; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf21.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533908; 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=JV+QfbhswWYe7PfMrv2Yu8Kn7ZidQZ3SJddP0Uv61YU=; b=XKwPiD3k4vK9bFsjSVyK+d+9+th4JNcQS69gLMCMDwjH4Pucm3LmshrmqKyfYzGNhyEQMd SAzDUIhRLYH42x0Ztu8s4csjmfF3i6QbC9/gKwPl7hdnGslnOJbSzkG6WNsy1KvWorBUNb XOrvR/zeuTKhjWxaMvT9bkZhHuf+gFE= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=FO1e3sfq; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf21.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533908; a=rsa-sha256; cv=none; b=vqfxHDT7iBKnSeJPhKJJUr+7KmbfAp9L3Id4H7xPi5sAdeHA/iQWvNKvxTu2bUAFkuxrcI Wg5P+tb96DEGZ+WG0SqPz1zpoPs2SF8SKGpAaIpPQChGycy+HG7OuW6Nt/o7pS79VrLM/B KOhcKQ5zNThcL7Um2LXjk1zbbCk0tNQ= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533908; x=1717069908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cYPPoEv62NQazrvih94Ycv2rGmT7BOuXvS8lrmnDxSU=; b=FO1e3sfqGO7HWb3HsnqJDua7s2dUjvkEqLT5l8M4L7r5hcbMo1Ts4pGx 9UN2Tm0A9JRBHKVXOs+bAHKqV/Hvn//SqYA9zTnI1wsxNORbSXQDaZjZ9 lDpnBCEWaPv5yd6GFM+I30rfvmY64ejkdfYicEG1Wxo0w3/e2xkq0q3X1 lpYvF/LC9HqwgAaCaN8K+l85j9W0HzrOwS1Q8poXyP13Km88VoXVosbUe FsSZj9v/SRm4WVlqWv3Mr34Z/1saQcYVZNGdgWDVOSiLthiyTl3s6/qxv fu31no2qNwuN36+CjjP73OfdLUnSozbekapRsKVo68Im8DJF6R68zF1Ik w==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="231985157" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 May 2023 19:51:47 +0800 IronPort-SDR: t0a6cFvmGv3apKDls7m6vH1ogMVEaziCB9jCzduvzHd5AffXqqssisKaZ5gA+AeqbvZLKieZPJ N5KcGG2IuvpFcmQKaAxFnrDQriMp8QfYX/Uti6W9Bip81n06rg9X+Pt+unFexmoVopMf/WxZkz GcbGd8a6L0/5ZWDTch1/hLbuI6bXUv++5SY+oCpW4Nbmkj0agDGcVYHKW+7hmDFgPYyFaL/k2e zhEIutOaxopNsTOHS1Gu82ezrkgnwZBgmb3RU3t6IScyvqzwRcD8XOB+DhHifAZFuvR3S0QAd0 X6c= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:39 -0700 IronPort-SDR: QS61h54T8yZW50RLo6/tAmhIU9dZKUSaD+j7SLLE6DJcuENXB0nA81DplHQBb61D4xQN5z6YYg lyD4dagzoF40PNFlLjzTZJ0Zg7tFZiGl11uz4H1TbZVmBSoN2y+wo62ttaYHvL6KiHjLe0+6zm FGyHqtygisbhzUI8rq/fYFXGU3w82UmCTVNSYk+2JCVsdH8VqjYSAJfn3rSnoQGKjalA3DHPXh ec/1PSkgm/XAUuzf+dnf+/NfDPsket5c3ZH5oLqRyfJ8DIpHZ5kI0+L0iQDvqE4e97x4r0cURX AEA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:44 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn Subject: [PATCH v7 18/20] block: add bio_add_folio_nofail Date: Wed, 31 May 2023 04:50:41 -0700 Message-Id: <924dff4077812804398ef84128fb920507fa4be1.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 540781C0017 X-Stat-Signature: owt9ahcbdqrtf7r8tmpz79wnun9nd6je X-HE-Tag: 1685533908-784506 X-HE-Meta: U2FsdGVkX1/AjJY1WufFbr905US6Y1Rzqe5uDyhQrLe17DP208FSOm5hnvNvVo5U2HgWbrSfGA4L5ES0GWbXhrIrgH4JMjbp2qTaZuE2dN65ncJ/QpcsozWqIlvVgzKZGfy594sEG4aXZ25YoDrnMo6JA1nwuonvjc55LNZ0OxVkWlp3WP3+0LbwJrn4O0r2/B7tozUv4XMPAp7tBuBNqSsWJWcJph2f6RLi8nh0b0U6syw6jaqx+fR9a5QJmIgepOpX7tw/Pq14ZFlswyfUqCnYFUZceTq0+lcphNRSeCZNnpyQUmifrP9JZuYQqXkNopqRPjYY80wJMxfE+XROpN+R8GABQXyX29Z/rIE7BWK6yc1rswX4ComNA1w/K3sw2UUSDSVZjd21H6GLm1yU5IaVRRTzKWs1pxgJlqztKz7ovAgMy0vFDS+6bI5n0CK4aMS4stW2zrVc7nMKiYI9LWi2vaZvEpeRtjUfgGLFIs/eA7VT73xRe//WxTedUc5tNJYixQihuOVRVRnjLf12MqCLViSgVFaQI92Xz9QlLiT6rsm1VBQWbuHxn/Mkx2CLQsaQXdjnFgxx7qSh/mFVF19Xe2yWbVHG5NddtpUTHIu5IJFHp7d1i8WrKn8pUPfgUiNqUd/YnVZ4YKaUzYS+4i8QZZWPGXPdy1pwOeriPk1S7x1b+y5ejaapY9XqAWNpKZp5wCJFL2kTKEtU4eWvYf/bCHYRNnS9SzjtAkW7YoQ0EKSeiWX+sOdWkFQhz1gZ8LmDoDxVAhMpjENe7MBxIL8u0C6VmQD2ZAnVU5zGQZwUPaukU1lp3cg4QJ2OipJELa3i70/QXOlIW3wVq4HoN7tC9j/jdLQYoCLvBRf4X+2BNgSd5h+1MYr27rVXEdkRW2+KZOsfgQ+cG/K6y3E8Np1zYetOh1haOI9E8242f1dwmvEkQ0kLNblhg9omIpUdwTmgV/c2UquVR4mzPCu xK6ezWEz mj+Rup0gbQAWOhEklu9/ukTe/akUyBjtyeVHEgrTlxBiXrHK1Kk0pPqe51rBvrwhpFeK/taqSChtqzfy6sMuP3gBYKLkNZs4J0M06wlfwWk6t8nSVHCKYqKP4gJsNXCrnYIuVUml+64+yZjJUJJAPpVOuzbUZX4jeYWKPcemB718xOb3oJK4PSPYCdfUULMVeiWRMBQU6OOGeZy1ZsAp9ZQ+aeL+2n+Rd0NMUrJ+X4akgtr3CPeRUFslucoSBnK6i7dRbmRsL0ZE0nsLI/myccaWpAAq9U3sEx1iioOVPX6pQ+/72tEe15TcKxvGjrvWeFNt/5DcrLozgNgBqd2MnHFzgWcxxdculYbcFIclZOboWanObB3ywy2py6dHRtZ+awNQplagpwgg3rUWHf3gBwHKh4wqcpr6Bbh3VL2uGxwO/zYi+R6xNU+/j+2e/om/YxKdIWdDMQ7wyUhc= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- block/bio.c | 8 ++++++++ include/linux/bio.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/block/bio.c b/block/bio.c index 043944fd46eb..07bc5139f9db 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1138,6 +1138,14 @@ int bio_add_page(struct bio *bio, struct page *page, } EXPORT_SYMBOL(bio_add_page); +void bio_add_folio_nofail(struct bio *bio, struct folio *folio, size_t len, + size_t off) +{ + WARN_ON_ONCE(len > UINT_MAX); + WARN_ON_ONCE(off > UINT_MAX); + __bio_add_page(bio, &folio->page, len, off); +} + /** * bio_add_folio - Attempt to add part of a folio to a bio. * @bio: BIO to add to. diff --git a/include/linux/bio.h b/include/linux/bio.h index ea2d937d3cba..f907d75af205 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -474,6 +474,8 @@ int bio_add_zone_append_page(struct bio *bio, struct page *page, unsigned int len, unsigned int offset); void __bio_add_page(struct bio *bio, struct page *page, unsigned int len, unsigned int off); +void bio_add_folio_nofail(struct bio *bio, struct folio *folio, size_t len, + size_t off); int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter); void bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter); void __bio_release_pages(struct bio *bio, bool mark_dirty); From patchwork Wed May 31 11:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262057 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 4B4B2C77B7A for ; Wed, 31 May 2023 11:51:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC2746B009A; Wed, 31 May 2023 07:51:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D73366B009D; Wed, 31 May 2023 07:51:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C12C26B009E; Wed, 31 May 2023 07:51:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id AC7136B009A for ; Wed, 31 May 2023 07:51:52 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8EBD7A032E for ; Wed, 31 May 2023 11:51:52 +0000 (UTC) X-FDA: 80850386064.26.1413DAB Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf26.hostedemail.com (Postfix) with ESMTP id 55009140015 for ; Wed, 31 May 2023 11:51:50 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=hpjBHI7k; spf=pass (imf26.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=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=1685533910; 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=YZb2egHLBrx5N6/I+IaDtqHDbm42u3jNdIR5Vm3jeo8=; b=h8SRCBTc7EW/XoQGVpDAiO2EqWD57vJy47xoMwsJlKGgdK2iBo5xStyXpda4r1s4lCyYNr YXp32Hweg9UX9LzjkqQ9hYpB0XGFGn8cokAEENlcDQ66mCGElZNpI0ofZjqz95B/PCGt3N OxPYBqVjPXhi355NFlUiHtG7voSNT+U= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=hpjBHI7k; spf=pass (imf26.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533910; a=rsa-sha256; cv=none; b=ICI7sCusj1uSK+b4cEGyRa6cnujbQAkj4dnYAnp3W4h43//BO7rgPxCpIKfCkaVP5al2lM naeJL1HioQuA+C2y4XxDAiyfcK7alJjiUtgqIFHIkxNYcezdhSp34bMgU126M/JlxCU9Kf Txx5uXnwiq15RJ8l+DzWZdTLDG/AO4k= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533910; x=1717069910; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FGWqPfSW6ep3dW0Pc7XFAqv0X/wPwwa9HWdy1+kVpjQ=; b=hpjBHI7kc6T8qLG3x4I7qwXWNUCf7eIcj/nvNInbqMl/SaGLx9GDZPat eBcYgF+NqnrdbxcsY7+/hEwFwP+goZP1OQ2OoYrU259er6DinZswNHdyh R/lPc0Whh+D6vTlIF/8zt3vlbY5TFnl2cHxIb4SLRf7lREZGon6HJyDnX a5K6dc28NlZLOHNWAjTxbfYNSvzqXm5RGNhB5mELEjbAWO61dTZmHl2O3 m8QB18vXtzW2doZCkPlPARO+F3spoxGOBCRRUdJVvHOwqQlXuDWCyWmlS wLRSyqSZNIA152a8YYwjoxkk1VuPJSUDDbrmBeENLEm5QHlznl15xsP6J Q==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="231985159" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 May 2023 19:51:50 +0800 IronPort-SDR: Ybr7vdVNUWJl98vj1khu16iM2kBLnEjLUY0ezeKGqRI8O9w5zNFhT43ZPFvxeRiTqG4fDzIglH dYB1/AOdba+zUeDIf90Iee3mLcQ3pLFBfarA79JdLjo1wZ3xgfIvcYvjWh1KIeaIqAAEPhtFwL cJqAEM2rEIJCRhNvNI84YlViupWS+KVGnE3j8Qv4DMECx7KpBUj1kFr4Wcuir/bKqMv3nF4FRo Ap7niGg1NL2iDeBNwdBgUjBd/gk1GvpwfRMg2YDSRQLmcQKTE4/pcOODeFStn3hXyu2Stg3TG+ xPA= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:42 -0700 IronPort-SDR: uHFIf7/iHU8Czax3/d36X72QqGjG0msVMP/RSX+n0ryZbgTC/vQVTGZ34sHyh4iM5x7IyMP7EJ 7cQG9Yw608QeZLGyP0kQIFeSZCDD8DcLwHNsm/JxZC3UnVblDfvw8IWh3MbAtONyBZjBACr8dV 7m9L+ffLx8wwrUzS5Nw0EQLVRsl75GdHE4S7QFxRYSIaxJJ+Q94NXHETUOLN+Q12WILx5359SO w7g/jlWqUSxuN3ILW6qvcbufS8ZTgefKKE0a6L1aJq6XjTvn8zzXK77PIN3epTN1HJDIFj5z9X G6Y= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:47 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn Subject: [PATCH v7 19/20] fs: iomap: use bio_add_folio_nofail where possible Date: Wed, 31 May 2023 04:50:42 -0700 Message-Id: <58fa893c24c67340a63323f09a179fefdca07f2a.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 55009140015 X-Rspam-User: X-Stat-Signature: ft9aq4hu5tytz6dnc89qr4zytwioozdr X-Rspamd-Server: rspam01 X-HE-Tag: 1685533910-362429 X-HE-Meta: U2FsdGVkX19p1/cY5soeLpVxzk0LabcCgug0/oNQ2Sinkuwnr6xfofqL5uPdV23A0A5rpxcOWLrUIfAjFEnrPuiVWUlCd5GpEvfaAZ8A9dVtK4EUKo38iwffFQPTNOWlM8Y4mzUFV1znNYHWTL5JYwX0qK1Pqt2or+Kr55ze1iJqcwCJ0b50phXF7jCdBfYBinpvYa2rYNCPbqLXpwTtaLgtD8K7HwBO2nrw9nyn13Tn3KVqmcWoMMfimmiSD9y7JGGsxs6BeI0ItS6y1AkPImetIVciPxpgiGlfWIkPe/ton+2a658QLGEMD3AEofGgbrtslFvTxjRXgvWxIDPQ+EWWnSdG6hkdQv/hcyGKDYPjHwXu4FMx/S1NfVRxrmrG/+6PoKlw4rQ5w4U1mE1M+3m/OoI40jNFU3sqQY98cEl1+e+gCpzXrxzn1GawSz7HtXBsHnxH49Zn2gKPBrHhiGHnxij6/YDAqnLw+RqMtu0hcGOxQ0imHVctnuwmrlgXAUJnMUP+0DNc+9B/UisGVhvg8ca1BQseGvUOK3AvpmSESrC1Nk/FOziEZi3dTi5hxKBQxoM5hl7qImWFBmSB2m/9722G4GJC4mpTya8gBi59W9DlmmpXQEKzlc/ljpyCLsUufSHzMGv2YXzNMY6FXUcojCGBHVYCha1e4Bqk4AaDs1gCxPCj8ycUHIeBDG57o2uiQzDJEHa+Xx5ZKfrZM6rJACEP4qzui3yn+/8urP6w9AMet+pR3wK1ZmPawP7BXWbgJIZAscYHeR96gKBXam8RNKdWi4v8QDYVlOccVPMHA9quO27Qntw913SgEqMvnputB6GfRZluJKKq2zXyuXMoyGrpiKGbyPIJ3B1W1Aizxflbfj6ZeG0iRnEWFGQ1MIRXFq84l4wgGjUuugMvlowMuscvReip6Znnck+m9I6Jdio/0Vtouv7dPGjBGyRIksKDmMc6YsdZR6ikvCd OGjwQOzc U6hGIHkvPuypzMMe04canJfviiLaCXwacw92U6O3KYeMRk5C/2lbHuvKQNws2U27kW5IIu+9H1hrjUmzBKzwv01HtO7ZX8AAeDSd1VRGNcEQSnyMqdb9R2U6rTgbnI+FnJdbui7W6iN1DrFJZgrNSfI7UapPqAiIEAa/FeVQ9oaqPIlvL2NfkYw5a1RdGF4ha1MBy955eg971lprJlO8E5Bb2dbffKEWb4JurXH5pwDW5EPHrXTSzX/d0E65ddDONGhs/FQA6b/FszFir8ELllmo57bVQqy8cj8AKR4NAnxbZQHULXpZ5UD7xnw7wMjReKpGMDphqNkMs5Ie4r9V9qBHSoHAvD44cWO0xtwV8iODCYGKqYxnOBBLKBfXWPQRbW6n/hAA4gEU5wmkrqWRCDQVj2Mq2Em3ccI/DHsgCM9r6zepzxBH7+f1LeL8oo3VIJJyaA02qHfP5xyo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When the iomap buffered-io code can't add a folio to a bio, it allocates a new bio and adds the folio to that one. This is done using bio_add_folio(), but doesn't check for errors. As adding a folio to a newly created bio can't fail, use the newly introduced bio_add_folio_nofail() function. Reviewed-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Johannes Thumshirn --- fs/iomap/buffered-io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 063133ec77f4..0edab9deae2a 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -312,7 +312,7 @@ static loff_t iomap_readpage_iter(const struct iomap_iter *iter, ctx->bio->bi_opf |= REQ_RAHEAD; ctx->bio->bi_iter.bi_sector = sector; ctx->bio->bi_end_io = iomap_read_end_io; - bio_add_folio(ctx->bio, folio, plen, poff); + bio_add_folio_nofail(ctx->bio, folio, plen, poff); } done: @@ -539,7 +539,7 @@ static int iomap_read_folio_sync(loff_t block_start, struct folio *folio, bio_init(&bio, iomap->bdev, &bvec, 1, REQ_OP_READ); bio.bi_iter.bi_sector = iomap_sector(iomap, block_start); - bio_add_folio(&bio, folio, plen, poff); + bio_add_folio_nofail(&bio, folio, plen, poff); return submit_bio_wait(&bio); } @@ -1582,7 +1582,7 @@ iomap_add_to_ioend(struct inode *inode, loff_t pos, struct folio *folio, if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) { wpc->ioend->io_bio = iomap_chain_bio(wpc->ioend->io_bio); - bio_add_folio(wpc->ioend->io_bio, folio, len, poff); + bio_add_folio_nofail(wpc->ioend->io_bio, folio, len, poff); } if (iop) From patchwork Wed May 31 11:50:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262058 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 2F50BC77B73 for ; Wed, 31 May 2023 11:51:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C3D8D6B009E; Wed, 31 May 2023 07:51:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC4596B009F; Wed, 31 May 2023 07:51:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8BE58E0002; Wed, 31 May 2023 07:51:57 -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 98E226B009E for ; Wed, 31 May 2023 07:51:57 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 788B814011F for ; Wed, 31 May 2023 11:51:57 +0000 (UTC) X-FDA: 80850386274.16.A04CC4A Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf20.hostedemail.com (Postfix) with ESMTP id 79C301C0014 for ; Wed, 31 May 2023 11:51:55 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=qDvyau2Y; spf=pass (imf20.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=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=1685533915; 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=6L0r6L5WYBy6S5nxfnPMsigOf27hWxRb+7ozzJcAxf8=; b=V9EZrP9i94Ji8SJXFzhkQrMZdPJtzM7MlonMmt12J24xa6Scj2CPJGP5FTLL0dWJhZdoHZ z+uUhPQ5f6rGnxPPq0cgeFtKPINNljs6tSXTW/ltTwbTiiIMYaosBNwx2g6I7z8WWATdWz T3d5schITk8LEAoPBZjOnFUP2hjiAMk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533915; a=rsa-sha256; cv=none; b=exkHn+NOhPy2uqMvdjKKpoBjjtJPsfMMWn3Ca6PnCfdby7/81Ue2oycC+Z2PSGmT2AgmwU nToGo1+LTXi2teyi7RmHmJBKKWM4OnGaZvvBq5nQZy5qqhfvTOaYVOHBG67ZKLHR03DTRo PKS0Qeww/Rt+fhxLb4gTYjLf0tLSq10= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=qDvyau2Y; spf=pass (imf20.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533915; x=1717069915; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TXHm8cKgeXSbycf6VjVIJnX8HwRGv+9KYRMuHSdcMO8=; b=qDvyau2Y8cQH/QuT420h1TDuS/cJSsOfXHnpu0FKhGLexb5yOT4qj9Su xBOoyE//AHpue1D5e61+IyPcO2ON8uS4SXpJpJRw5CqNiDsODjcL/5Hui zUY+YN5ijGoTZIPjQg5sdF6pjVoEksiIEjGaAPS/9vgT+MYqhlmGRtl5z nlqPXZwWObcXiH2T6M/JbC5xFYcYkMXB1LVkN/ws5MOZcoV72EBdDS9mb t7ko2VTB1IBqlmSP4+I9fYE26D+gnRNIodoUBylhz7SdfgFqyR/BH1YKu 8rDYjRPmVnenZcbN2J32W/cpcHqFVEuw/gftO64qnExkv8EsdyUR+hTqF g==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="231985169" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 May 2023 19:51:54 +0800 IronPort-SDR: nMhOpxenn3CR8Uf3EOX9Cg+B0sNK0RNvqsza1jlvoUDzsSWTZ4Ja5Rx3tqfnhte0mG7I26U2OT mV/m2WBWXpQbAXwxJVpUjsmswbGa3C0JNVkbDFqt0x17NXtmgGORoHMTR/XOdmVApeNvf7f1vM H61wM76ckEhGvM3y9rOFgJTUGXBjl+sb9FHoU2AfswPvQEYTrN4GozwmQmcEDGX5R5MEa7OjUD ahLD2o8eX5sscsGMc3zrSjzcPtCnWd94V1TI50tVyOj1giuu0H3Gww+bsWFHY45ladiJLXp7qi rko= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:46 -0700 IronPort-SDR: K8DGvXh3flLPynticzqNOEK+cYmmrpCanEBz66JFrWIngUtekJYSQhCrCrQqqhG+xCFaPCQa2f kPJSf1LI5UoWCk4clEw/qwVZ0W4JIS0jS8S+dvN+TLf0ZfYCIO+3Xte4UP0xRPIscBgFVDQ2Kd i0oECfF+1dh8ufMGv5dV011PahNQRw/rJMUEPkg/QmDHoXKUFcS063SfGvdOMAWACqKfwoUrw7 ZHc2iWsZBS8kDjkwhUtPmAIWhJo/MvPANH9LDUtKSOoqChVFdvi5WpUhFTDcEYLLYC3pqPKsMY Ipk= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:50 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn Subject: [PATCH v7 20/20] block: mark bio_add_folio as __must_check Date: Wed, 31 May 2023 04:50:43 -0700 Message-Id: <381360a45ac3684120cfbe1e07685e9c36256e47.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 79C301C0014 X-Rspam-User: X-Stat-Signature: ideeobz99opwaatrbrdefywh6ca1ecnm X-Rspamd-Server: rspam03 X-HE-Tag: 1685533915-85208 X-HE-Meta: U2FsdGVkX185ePfIc81znZ4hUlcKsOgjUk7nAV7iBxVWlQzvFXwBPoG9xkko3dEtG+xf9Fcz6MqpGc4TGkGN6uTJ81S1MH2Utkz9mOOgjoZE7N9wRi2aGb2Nvc3OxQ+1Vxb3LQmDw2vMCYOIl8kFAOC+4Y1Dqd0kfCsk8M+Ip68dLV+SRheKwDGM2pC0W/8f1ctvAvQ5F8WQKWqkDkwkmSkFIgeYbIc/VywhoCV62EHSXbKsCImagBjMFoS7po/JIPPsDejuZC3ic1xh7pfxCogc68h8CAOOe129pJc8ODY47USv8E9rBbQx2G2LBcuGxQ1gCA7Tw3BgBGtB5Y/R04dYkQfO/KXhbXkrlRwUPH/a0aibmL46fN90+ev7L9rzii8Sd+YYo7IccO6wuQtuV8cxk4qILepqumRHaYPwochiAjVGQGAC4hgQhtKJOjSTRLdKhWxVbJ3ZrIIHE0IaILjKsUiGmL4jhbSNyS4a21RY3bbFKkj3X/n8zd6Vfl3W4URPXicEJ4mHPpJy0G8U8zQ2FIsDQSLVzB8J/DxlFvZqa+hDXY5vM0G5BsAuEZKWp+MCQDFDrmiA2tSObb1soVmQ0Q4nPTOWifE9nTuVKVEV+PoRRmZhu0Rm3dVFoQEpm26GoXJ3qn6qxKbTFWyrtUrSMU4SnZ6GdXV7zknvO9uA+Y54R/CGzBWT+haYBFF3pqHEKMPxD/cDTjC3H0A7D8HCBSTWkQZ768X5xFA0/b4VxivQDwAVbek33JkoUaXHVD9sTbPP2wURWemeWU95074UECXemDFNAwGVxjHgEg59NuLlJpnZzL7Gz7wim3o7ooQDTGF6/TbtA/OtPjJctfu2QzRrGIOQU9cLAmHlag5Zu5N+v4SftnkP6e2rjeobtIQ3tgh3yYavANGIIE9Zslsio9WCLVIJm6q7x3aWnskMGSEjpUJagI9b1NuYQEUT1nsjmQ7Y3zz6N2sqOg/ 3DrT8tFT zPanYw+YK0SBopYX4xseLcvRcPDobyoYDSQSWb1LS3cu6eynfHsXBAXtiMIlUP6GslihQ2brJ0tMDsyznw3RyuZdBX4U9TBY3DLgjup4nedH6eXSkZwtxB8uvEamg0s8tJFG3anPkKLep5MkFn9NorpdEYFAMvZCVSp/tokYpVR7u1JtG+6ttgKHLoWGHa0EDSQgUSiXVDkrWpQ2YyXDHRFxASbqlgt/Hr6GtIC+lg9gAmSrWQqy1KCqrmDtZjiLUlpI2NIhzaK5jtEN95uCDMl2lItM5+GDjGyK6v1AJXSQ2RHMA3z9LpihpmV9o9f1M+8vwAnzz5EET9HopbwGXfWlqyqWbyL6ob4nvj59y3blms+fBc3Dc5dBa4ISs+VGJnamSoT8gko1D1U9exxX+4tMkDUcMMgT4Bm3U5/Q2aKb2ygwR/oQCq1QtjOUHDRDhQZLzV+QmWLpUiPc= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Now that all callers of bio_add_folio() check the return value, mark it as __must_check. Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- include/linux/bio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index f907d75af205..c7a9425d19ee 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -467,7 +467,8 @@ void bio_chain(struct bio *, struct bio *); int __must_check bio_add_page(struct bio *bio, struct page *page, unsigned len, unsigned off); -bool bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); +bool __must_check bio_add_folio(struct bio *bio, struct folio *folio, + size_t len, size_t off); extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int); int bio_add_zone_append_page(struct bio *bio, struct page *page,