From patchwork Thu Apr 20 10:04: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: 13218300 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 6381EC77B7E for ; Thu, 20 Apr 2023 10:05:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E7CB5900005; Thu, 20 Apr 2023 06:05:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E2D19900002; Thu, 20 Apr 2023 06:05:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA612900005; Thu, 20 Apr 2023 06:05:54 -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 B6903900002 for ; Thu, 20 Apr 2023 06:05:54 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6AA8E1C5F93 for ; Thu, 20 Apr 2023 10:05:54 +0000 (UTC) X-FDA: 80701338228.06.E58EFF2 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by imf05.hostedemail.com (Postfix) with ESMTP id 99B3A100015 for ; Thu, 20 Apr 2023 10:05:52 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf05.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985152; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s93ifE1gU+0FrrRIOdnaALh6w14X2Hkv+dazvnzybyI=; b=OiDKDF3xni2vXLpgvCSj0BE5WFfHqkAYtD0PzHcSZXhFXuYX0HuGgk8vBUt8iZirk5Cm0B ickVp+FC930blvfnRDlK028KemifMPY2+BTHFXoLOBGPUjmylPl3311fQtD22nJtEkSE3L EEWdk6Z56Rl3sAaiUVyC80CHauf0s6E= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf05.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985152; a=rsa-sha256; cv=none; b=hRm/f7u4a/PIjHRJ393soGizgx3BYgU03Vvu+XLxJoCiVdEYGilYR+y2nMo2C0WJaee7VR LDmo2itzjiceL+q/NsD5bgFDpd1EZIcT1soh5alGcXIbPlfO65hyn0ss04n/iAeQbh0OER 7YZ2ng/+GFtRHPbiBU2UUNkgPwGlyuE= Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-2fe3fb8e2f7so289692f8f.0 for ; Thu, 20 Apr 2023 03:05:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985151; x=1684577151; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s93ifE1gU+0FrrRIOdnaALh6w14X2Hkv+dazvnzybyI=; b=AtrrCFEa0rO8IowTzDww8HyMbWXmag6FHlcAad5+KDAiNC0UH1bGrjpn7C7AGreYpG WfT8zP1wMPYvgUFlglUM9hhGw/UtpF/nQQetsFbGbdlWdyjixQu4JN1i/DFf5QNpsXWJ ZuoIP63iAdZLBGdRBzTa8+x91fwOsIRrWQ1j5ygcxeuewUcCgEJmcbiZ08prwRxn07lE fVggXjp6kqh7wyYGzNId57a5kmV/TdCAGegohicbKy7Y/zaRQxznigHAsoGGQJpF5m4A tZiDq3lphycNaQzdQhk6/H6q5VxBpynnceMwEzjNZe5OqTQAy1yDseJeOf8OCVET5sXC cirw== X-Gm-Message-State: AAQBX9fMoyCqxBLFcQHwKje9PXQZ8r/pJNsY88gW0eeLLDcCyxKqHl0y msS51BjQs4wx1g3oQ2LDtaw= X-Google-Smtp-Source: AKy350ZJizpAlK8UcdkIuYKpQ5Y/PZoh+EKKcTgVEjvN6d0zqGLWnY/auHncEOXRAbbDYcB+iyhuyg== X-Received: by 2002:a5d:6149:0:b0:2fb:9dbb:3407 with SMTP id y9-20020a5d6149000000b002fb9dbb3407mr833176wrt.51.1681985151089; Thu, 20 Apr 2023 03:05:51 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:05:50 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v4 01/22] swap: use __bio_add_page to add page to bio Date: Thu, 20 Apr 2023 12:04:40 +0200 Message-Id: <20230420100501.32981-2-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 99B3A100015 X-Stat-Signature: 7gu94x4k6ueu3ht1hq8z6dmena6tucq3 X-HE-Tag: 1681985152-271936 X-HE-Meta: U2FsdGVkX19FSPZvaVJfRJPz7wCs8zjDMGfMjRBkigjUASpYKHorqlLS5ykaf9qBICaCUTl+enUDkN2ZZelbHZUSNalXKHI9Zv5tsZ1vtLKlAZRR9aHiH+wTGCEslJ8hRHHH0sEujSAs/gyF45jHQnkFYI6CLAv4u85w95dlD82RGS4AKcyFRwZd9/jwtcQ/1BctFtvXZlWnKtv7fg0MwMmeguMcEQkMF7Ig9c6MtVH0DtLaoYy43HdvWcwSbO2gYssLl/o1We/+aIZYYIyha82hqlIyAfN5Ny0d3auFYCwmV7RaTNQHh2DFt+XMKGNftfDk0WXqztH6U7gWTbWhrSx0302wiIHBp4HvAuJoQD2Kn1t7yWGyvNzOR5arwao1ubEoS6EoPl5q4A6t3sxeJ8qejCNHTO1i/n3x6NHCm+XlZ6EThQt8+voIionBo3OH2hlrMBo9p3sYVW27EAGQB/uUyIolkt5DwxNbSEVKCteQjbcGQMMDoSzowOLQJRMmF5cNRsY/8rnMRWSh5Y6GEfD/Fcc9Ti48/nVwwaD0azcUv/wjYoSq678uup3HlL0inYwtwpD1gzZtYM5dMfu9JvdKb82TMAPVMKM86yfJG5E+4Gsas2bKrk/wUSnoVeRj69V/1Qa0WMsX/4R8GvhmRJYYs8A0NrGMsfY3i+TMBF2eWOaoOb++L/HBTFpucLGAUxyNNFrX9HuzsvppZG4s5OFSE4hI3QhI3SRlJbKn10cBE4XHzwL8uFAtMnh0kn/MzFcoJwd+sJqB8/KMBrMBhBrxRJx1jQCGmkjISXZzPREhc9ijb4soXpqBElVS9GSU1Q2QJizv6m+HTI0LCn46z0YzK0MBaXVBKkwGVWvNqrrZxsaH7LgvHoP6BvR2GIPNjc+r+1HYswrFRRNQvMtX2oUtiPE2qnYarr2u2/WOcPU7G1Et5W9xskRc6kf33Ct8Eqz6J4rJijD96QCqdOz BFmBRxBb EE5Qxbt8BOEfI+5BRk/+WAqQ8rB/co57WLK4zp/cDR2O6A341h7Cu0BNBe1ZKvkuDIEjtkuJlmUMODE1KA72JE8ypJGKBaQilUyTlI1lFc72opZounvl5u1A5EmDPemas9HlddMGZ8dXRZtr6qCn9cMHw6VzSuB5SvUgejYrh1Qi+K61ztIxIXLtsXod1NUYqqVyL3GgUGv2yjzYLXcygIqbL2fbgkboNCtU9WgzkgREmPc/LwSHyKgixsubtEEByWa1KiHiaok53vPENV0Gd0GCvl0/yPiQsC+QW0Q1JKWiut6GLhFeL3VMVU3UpK1ldX0hha9IjNAGI5JEYq/q8bRi9n+Z02v/fvU9Nx3ist2xujWU1kLhhplxxS3r6/YBMAdujZhZ4xBGdQyLy7Af0QDV6X8s87QUqiY+dLLx0ugamCSwhX/XMc8t6jVQE299U0HyXHWvu2LMEu1Hl6CcBsk4yu5w8womMGDL113cQw/+x2wvM99sIALwyDxModybRjznUG65RMeZH1t+z4rqB8JrX7usPGxN0ZOa77XkX1qU0GZv5wrR28CSaQrzb1tD+oAeq2y7i8iVL1Ntg3IGitqH5MqdI2PiFZ5I24tk4kcVhpTuBTLU2VoY3AqMd4uLwYYWBM/wyqgl37iiLE/1taBBSmZK4S5RxYn0DBf9+bZmcKzNYFnT5MpB20+X0HtlebWrd/8J04zzpKM7rrf7/xhc3Z5t/GZNBCKLOingBXyw9IrDVszSNNuFC+buI//+U3UKB X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn The swap code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- mm/page_io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 87b682d18850..684cd3c7b59b 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -338,7 +338,7 @@ static void swap_writepage_bdev_sync(struct page *page, bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc)); bio.bi_iter.bi_sector = swap_page_sector(page); - bio_add_page(&bio, page, thp_size(page), 0); + __bio_add_page(&bio, page, thp_size(page), 0); bio_associate_blkg_from_page(&bio, page); count_swpout_vm_event(page); @@ -360,7 +360,7 @@ static void swap_writepage_bdev_async(struct page *page, GFP_NOIO); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_write; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); bio_associate_blkg_from_page(bio, page); count_swpout_vm_event(page); @@ -468,7 +468,7 @@ static void swap_readpage_bdev_sync(struct page *page, bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_READ); bio.bi_iter.bi_sector = swap_page_sector(page); - bio_add_page(&bio, page, thp_size(page), 0); + __bio_add_page(&bio, page, thp_size(page), 0); /* * Keep this task valid during swap readpage because the oom killer may * attempt to access it in the page fault retry time check. @@ -488,7 +488,7 @@ static void swap_readpage_bdev_async(struct page *page, bio = bio_alloc(sis->bdev, 1, REQ_OP_READ, GFP_KERNEL); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_read; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); count_vm_event(PSWPIN); submit_bio(bio); } From patchwork Thu Apr 20 10:04: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: 13218302 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 B7870C77B7F for ; Thu, 20 Apr 2023 10:05:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E262900006; Thu, 20 Apr 2023 06:05:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 444D6900002; Thu, 20 Apr 2023 06:05:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29660900006; Thu, 20 Apr 2023 06:05:57 -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 1AB37900002 for ; Thu, 20 Apr 2023 06:05:57 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E32A2AC0C5 for ; Thu, 20 Apr 2023 10:05:56 +0000 (UTC) X-FDA: 80701338312.27.C13F2CE Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by imf13.hostedemail.com (Postfix) with ESMTP id 0D68020018 for ; Thu, 20 Apr 2023 10:05:54 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985155; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=asKpmswp0ZeanhVo76Eo+6VNkXdxI3jhQK0PDuQZThY=; b=sdvRV0wCnqN5IUGhek7ZXHdaYFMgwnmSo2b0UK2TGCB1srIISgXPfg4729zccwaLWZxLQX nYuQZ90RtxH86+qjoisWGiI7ZhdiOWVWaRf/Gaq9YiQlpRT2lflGOcocroVP82AnZYp/WA 4WKHakC+JD0C6htkeMpsWz5PtBJhpOI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985155; a=rsa-sha256; cv=none; b=2LaOgwesIrIZDHhm8EQdYsfEsFr40WxIv1MEMF1M5jPRAJ4DWuNLJSN7sq8UB8nCN4nyjQ wDoWCtlHTxkMdARSgCjC11iFDD/oLkGNy3hlFrHLi6/FNy8xMbfnNmswgC7shCwJK/Yu8F QvoNcngO9/AUR9KlGVUZJr6S1lOIV8Q= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-3f17fdb520dso5382565e9.3 for ; Thu, 20 Apr 2023 03:05:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985154; x=1684577154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=asKpmswp0ZeanhVo76Eo+6VNkXdxI3jhQK0PDuQZThY=; b=Cp4DiAEUVxTAxqTXk3dmTZw4hYk8X4o/Sa/7OerBoMis4pvDzsa3bKgP+0pRTtHiec u0e0R5DqEPzvL1YShB6LmoDltW29Wxg/KpDANZhEIcTjgSkVEuHtlF11mVJIRxQhuqjQ /JxN/bWhB5MzpicD9rtnKoFjtJZS12rN9hnIftRjvEDCWOzWFHUuISOArQsforSWbyGn qvXcanEde4HZV27TD1PkTv9rxgEFbEgiNfwTG/Xnu/lkhjgL47ZvIJJBnzxzsC/Vkn2A rraDd2Zvmq8uLbd640J2UVfiIYzXdqm+eaBzsM+tv+lEGO9P/YdSao4UVSYDhv8yYi4Z PBQg== X-Gm-Message-State: AAQBX9c8u9HpEC2PNwV4nLaFtD9Begi/Usmg6F/ZG13HeUCpY/LlBiTY bnuafQ80v3d09xHHKyXVv+c= X-Google-Smtp-Source: AKy350aEPjl5npFp/5W8Iqf2usu87C/1xVbllQj+JBJFP+rdftTKzTknJoS6cfDyj7W7tb2o1uXlCw== X-Received: by 2002:a5d:4ecd:0:b0:2fb:4121:285a with SMTP id s13-20020a5d4ecd000000b002fb4121285amr782830wrv.57.1681985153608; Thu, 20 Apr 2023 03:05:53 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:05:53 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v4 03/22] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Thu, 20 Apr 2023 12:04:42 +0200 Message-Id: <20230420100501.32981-4-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 0D68020018 X-Rspamd-Server: rspam09 X-Stat-Signature: gcdascgkske7wcww88dpswbe43gbwnex X-HE-Tag: 1681985154-58818 X-HE-Meta: U2FsdGVkX18//aRg4mrDllQKa4nyhh1GbDRXnpv7bXpMUDybA62zdK1NKUMpD8UlBl/XbPHIwQl9wwehCrSq1oKv+3PZ8gDpjnfZ9/zv7MUG9fbUHOgQz4TAKHkh2WFjd45Fqyx5xjEtOfPqdxgbZfBz4UqeLLJy5dYVDLUFoy2PsI+nfRIIHANrFscbF+x4/khQlXL6nFyoFi0gAZ/ab70we8BTCEIauPVCNInCJ+Ce8/ysflI5z+HuAenkRrpwZRMLQdriEL1FZ/Fm6wwsSaoi3KUy3PpixmVQX0RE0Kwpu1kbPMc/qtS8CBTs55n37WJqOrNOtRr9Rh+sJnxSruHwr7C5t3qxVax/j2GcPWEGm9RPm5NAYqsN8VbADO2teXYhC4gA0NWQjb061KZmPmIVl+y1Rp68l/azavfuAG20J5r+Dij3XmK32BITI4bqFNF6hE6XoBvbWmtBqSypN5/OUBf7MX2ae6xXDdYt5es2/SWeIdf4tib0OReJhzan6BirGrHi1pgTh+6yio9rZN7Vai9T3B7x3FahReUxoVScdT2tX89zZTM/EIcZHndZ1uIboYNEIG+GYZW5Pj3yCzvQJCRJvaYcX724dEZcNCepofxNz8e0cKEHYwfX7EkthGWzqEakimwdORjl1lIR0D87gmAm8DzTRLAReWe6gzdPC1buM9ig2RyO/TPs9dUAM5c4bZ4yILozaDy/ENtF66Npz7hfN9HCJxo8WutUrTOO5N66R4Jc4XwNBcoYEvx3rb14Enc2OgKPvhU0ue6X2Ijv5CgtbdbY2LONVz/b55izhR8QAmjRDVq6QhLWTT3yfcC6kR2EWYCHR3qub46XxMO2lno0mTDdnFzPj+paMO3awq2MEl2Bd1mVETjLuwyhz71v4JX+7f3Q8K8jfLEP9DPGMPbsIGPC8hGcYpD/+Qnx2rcJuHpVLFHd4fthJ3M5jlBH+EzZZrz6Kwv7QkC ozyf7d8n fdfgU07Fn863gXCZv3U6wGbWDHVvo1x70pQjL090sqnjNKx6ETZNAIPHCvvy7UuFK3ip3F94N0cSDqwqOvhEjco/YDOKUCtcIjpAmDO7zbijHWEcIOxYO/Ybgp19sSFi9WJg5QEI6r1pB+KEt3BzmtUckLTyOWylGTB+NIIQO7S0Cuz/+Oq8dtNkHeT088Nh0qO3GsH/nW6Dr7mrUQeTLzZISMy4f9eJipBrxRzo9JhEp4jtsK+o/xeOK/ig+IVBJ2/ROMbx5VtjdPuI0m+HLyQ1ZzDLwYkAJQvvXDDVlbCRoq4HdCLGOyhUpoER2O9L/9bj/HnboUjfwyi3awaTLGTO9Hy4JZzkW4dtL2c/QU6FqIFyfM1I00byvgNMUJNfGlnsETQGoa4NLpQ6b/fLcrtqBBwRrQ2aU+08qp9eZqKKcvBt/I7VUJEeMjuxXkH5ecPVGZZOHvxPcUm4ECK+bnuNRbHkO3aZXN0nIqNZ0052D6sHsCzXJhUXQHjwu82qzgfn+YdbLgy4FyCcK2M30HOt/5bChd/sz6AJ1nU/derMYwCko1f3YwvlSzPlzccfy6/DTDfpNnBPXkxHLOYvxX4lQEtWYrtRSwJ/syqm7Hwevo63/p7vw2Gf8hrNRSPWv3uhHjQBOsPQF53ixPZRkWb/hRwCM4wcH6Jx0W6CGJGFqycA0mRhbnlsJJ7YYXMh1B3ADI+LgmU7M85XcbOX5+1SzBsqcTgIz2QOTicQ1RfKRyrR0Qc1zsD9VYpTuwN9fxsuy X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn dm-zoned uses bio_add_page() for adding a single page to a freshly created metadata bio. Use __bio_add_page() instead as adding a single page to a new bio is always guaranteed to succeed. This brings us a step closer to marking bio_add_page() __must_check Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/dm-zoned-metadata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index cf9402064aba..8dbe102ab271 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -577,7 +577,7 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return mblk; @@ -728,7 +728,7 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return 0; @@ -752,7 +752,7 @@ static int dmz_rdwr_block(struct dmz_dev *dev, enum req_op op, bio = bio_alloc(dev->bdev, 1, op | REQ_SYNC | REQ_META | REQ_PRIO, GFP_NOIO); bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); ret = submit_bio_wait(bio); bio_put(bio); From patchwork Thu Apr 20 10:04:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218303 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 DBC3CC77B78 for ; Thu, 20 Apr 2023 10:06:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 750DC900007; Thu, 20 Apr 2023 06:06:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 70149900002; Thu, 20 Apr 2023 06:06:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C8FD900007; Thu, 20 Apr 2023 06:06:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 4DBB7900002 for ; Thu, 20 Apr 2023 06:06:00 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 27EB61403FD for ; Thu, 20 Apr 2023 10:06:00 +0000 (UTC) X-FDA: 80701338480.20.29DBB99 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by imf01.hostedemail.com (Postfix) with ESMTP id 51CBC4001F for ; Thu, 20 Apr 2023 10:05:57 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985157; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EWddmUi1sUqAJfDu3vTNgbuTywHhrfsi4XwupHN4WwQ=; b=Wbqv2FGeq9bU1VOkCTgMfW3OUfILvVwcehsTryH448LsEF2QZ/15TOrPKzoPlDAPX1sVHJ nS3XJkGJ6nHWMSXGx19J61TzluHTh4ohNr25JRJBZapQkIR5nxJ/EYoHaov/up5iVHmXjN U/DVXTNJ44ujpfR9Ah1Y/27gwgu4T7U= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985157; a=rsa-sha256; cv=none; b=feMpPUxmTDhO3JxejKb/J//TrnPuHY3qNCM9HXAmzrDH3pMOMdpOOCTwlUFP5QpXXMBs5H BWTwFSWlAPR2wt7KbEfceI8T6XgqfunDUcohb/UFHfPRFFRn0CB8hRj2ikXz+S/NE8P4mD oua5mEyu5DRCC/S6l4LfHFLLP+8+BKg= Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3f17b967bfbso14824485e9.1 for ; Thu, 20 Apr 2023 03:05:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985156; x=1684577156; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EWddmUi1sUqAJfDu3vTNgbuTywHhrfsi4XwupHN4WwQ=; b=LRzX5h6FqEWqWvbf2rc5uGmuWfcU8Pxd0O5kR+TZk8dGacjQxIpuhhMSlmOWuZMc4u h4ITVnqTXk+55QjOwlP9GDockYXTJdMZ6CE74pSEwd/qy7TxVhCQusZYBQ0vlWEUEhjS LK5Al7raygENwoAzVIzVsRm6YvV9wOvg7sLToUR+3uAEjOTg3rnJEZZn5ZoPWj4Itu4W JcdKFCGKioDCfHy5XGMy/QWBDonp1mZF0Vk4664/t5eJ6BXLxy9BwSiH3UYlQ+zyDRQn vQzuIbONJtqrpD/o2fg9mkJnK6lnLALLB9WKaJfKNH0TU65Tmuqph8e5mejG3ADcr2kH Ilrg== X-Gm-Message-State: AAQBX9eN1woZQAoNgC2s+j8+PiUXhp23XOe8pXSpR9XD90b6kf9P951O j5YDaA7gK7/OIxQ0/btL35M= X-Google-Smtp-Source: AKy350ZauLkuXWs6kSjBHCPBBCSAVBhubP5jzpCR4qZ4hYu8gg1Jhd0aZ4abYsMUbuSqsM3DfmG2NQ== X-Received: by 2002:adf:f2c8:0:b0:2fc:114c:76e with SMTP id d8-20020adff2c8000000b002fc114c076emr899567wrp.27.1681985155941; Thu, 20 Apr 2023 03:05:55 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:05:55 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v4 05/22] md: use __bio_add_page to add single page Date: Thu, 20 Apr 2023 12:04:44 +0200 Message-Id: <20230420100501.32981-6-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 9s9616oxwn5s54558eq88fhwmui6715r X-Rspamd-Queue-Id: 51CBC4001F X-HE-Tag: 1681985157-432276 X-HE-Meta: U2FsdGVkX18mx9+rbsIhay8E8ojqf042ztui5VaWoTYFWHBBG5t80LnfxX2GNzEdQwW5cxyfXfVNSs+NYkzod0DhQ8QzJyJrSPqLJw66f4tbH0LEbhyBc1hOhgaHSdTA1VSu/BxXtA3TwzgiZkk/ZZWvn7rIxGCRezlOP2Y7AT3qwO7HWbk2Y0WAoKOlhxtl1m9+bWJ2tVFxfgvFX6qwqEOUyk5R58ylnDqNU+dpm6wNuE6D0j1V18TeDUbk/cQ+/SqRDPUUYD7zjpIpI2jjRiMwN1nZg6J6wk0QsJmY5qUMIoFIiZNRaEe8KKw3cgtfm9YwsQMlRlClSe9yKR+NyW7BryLRdLWYHXEt8vm6Ff8N+xn/Ve2kSqZ9JrUj7vhlOEijhw9Em1RZeyiWq9Fx1LefuSVDlHEG3FDucbJ6s8rN1ejqUdn0NrI3R8RoAVHAzie4aOlNd4smN/GX8UFoEMCd9mg1PgKU7Kb2c8D3EuUGcxUWpRyr8f41w8MkG/I5rk/nyBQDuDiplPu3VZG3Wf2F4vwH+cmD3tjeBUZMAEE6Jf6UHnKpVnk1O2dbhMJUu9G/1FJNSwfFAQTd+YLbSJaLL6507KTaUKQzbiBtVPNZLnS60wR+LSaiOxROIFoDBbfgJXjbBV3r7waXYQwVR0Hst1jZ3d7rT3iipefWPKNj5uOisj1wMgoWID7X43BnXuGQLzwz4W1h39VPeSfKBoL2231/OPo5lTqIE8PA7CvHOtfwLMyNDiTOUi1scVHZ80PgiIC7MQn95Lc2IWurQI+dUCpBEG0cEn0qh9yKAc1umrD6Bnl0pzF1IbWgyi46FbjD5deEk4VQSncTt7HXOFhou9HApEY7KjmgCzN4FJ+rJLDwaIw5myS9G7R2Q/DR6Bn/19mbhGj3lvr8aS6w1pHj8fcPcSLI0liv0A3POOPqb9I76AtAvygAnPt9Db1hV51PIp2jtXFwReC9QgO hVwrlmvS toqGkO6XCXMGjsn+6YO7lZFZDgnvqJF5Q2j4cTbtRiGar+mRiKoWLv8/8LtNWEa5ybeq5mru4Ray76aJlfO9Ky6cErAeJ+pl1mznOVybkL/eGcu6Vw/o+rGtrkDiYbLDA0ngdOkqKHWFvBMralNA43trkUuOfM5wwe17Fevvl5db4ec0x3RAksOsIDSEsUJbQTRxMJ7VPkHBn7158oLPzNPt3yxr4pFu1aIy3HWplJwFYMiHUFaT1PmdBrmFUXonm6MdFMwQbNk8d/skqMD8fxZSkFmvSjP2SSK5fFx9OIvqEaSLlufG9IkzTJoqNehHlNlTlK57YsmSlh03yAbRj4IO87v2ouL7B7CutnD0S+8NrqTxtbUh9k1F1HlBep43E2e8P+qhegcs7tFTLNDzV4icoiT+Ta77Hx+1INHW1QE554E9qbszgiZKRbkyniT77xXLmUPNQOoYs7jeZXY+YeM0avC+khi3myxZY+oCjOcma0OIkjHTG/KDhb14xUcEFgdpAxw7PAylA7PITnqF85h6hnHUMpEHkX1OXg/QAxRDUFf99Is0SX6tfuBSgytb05K6/mbpBYeKkp4Z5aLH9tl7d4qUdgw0+DXf1qVhjlK0pRpQRjsh+HKZE5hN5L3LTyxfTvhHUHdocTC2WBLGHJI9KdFpGmS7pMKqkFTe60CpvZj9zKTjHSpj6Sywpqgj94oHnK4S6K55Y0yQaV3KMVDFCv+pdir6aipnjxjSYcDY4aNheqrBk4JFni6kImoHdBEgzJB26ooAeoLl+OLqZ6+Tv+EKBKI4IyblF X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn The md-raid superblock writing code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-of_-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 13321dbb5fbc..20b9cd7c2f39 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -958,7 +958,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, atomic_inc(&rdev->nr_pending); bio->bi_iter.bi_sector = sector; - bio_add_page(bio, page, size, 0); + __bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; @@ -999,7 +999,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio.bi_iter.bi_sector = sector + rdev->new_data_offset; else bio.bi_iter.bi_sector = sector + rdev->data_offset; - bio_add_page(&bio, page, size, 0); + __bio_add_page(&bio, page, size, 0); submit_bio_wait(&bio); From patchwork Thu Apr 20 10:04:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218304 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 B940EC77B73 for ; Thu, 20 Apr 2023 10:06:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5CA76900008; Thu, 20 Apr 2023 06:06:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 579CB900002; Thu, 20 Apr 2023 06:06:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41AF2900008; Thu, 20 Apr 2023 06:06:06 -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 3543D900002 for ; Thu, 20 Apr 2023 06:06:06 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F2B151601C1 for ; Thu, 20 Apr 2023 10:06:05 +0000 (UTC) X-FDA: 80701338690.05.FDC699F Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by imf01.hostedemail.com (Postfix) with ESMTP id 332FE40025 for ; Thu, 20 Apr 2023 10:06:04 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985164; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3G8vgZAFagEXL1mcgIvsIV/u4Cz0QizBZkd2HYzCGxY=; b=MGiCnpD+3rp5XYb4nTxY1fos5R3lRiwVU8MS+B/VGxTI8YCnaPGtiXwiep1wU97hsGNsPV VSXX2ZiYL5sPtBF6fpVTLLVZgGwxViacIS1HrEMk9b00fempx6yURBneSg+cfa2EYwVGFv BbzbuBAXbUOGTMoQOIc6pUq9zqbfvb4= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985164; a=rsa-sha256; cv=none; b=OAhUovHONENupBFMtlu8uF5Hd4IGMp6gwW/1vVOC+vhAuvbowX50PWH/B0eldvSQN8Zy+s nFDYE9W+/LF3Ac1C9L9xlBZomn0Db59TFZvCgRsHazlXa7UZ9WgEBcQlaBVcJrCaYGsh5x r5AMbxjYpyp3pw6PNuH3H+VHt7FuL8w= Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3f17b967bfbso14827115e9.1 for ; Thu, 20 Apr 2023 03:06:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985163; x=1684577163; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3G8vgZAFagEXL1mcgIvsIV/u4Cz0QizBZkd2HYzCGxY=; b=GNLq4s2kl/m941UlcuciLoMpSiJU0oqNo9UMe225JsKo8j759bvsnY6le7xUhXFhOS IkW6oFWJsKe4M37GMwUesEOb4z81wpyf6sayxflnSodZf63fOXn8K+y3U5e3D4ZCMvn7 rANtvjE254ywd8AvTlp9tOub35ocvuSHKK5XqwFXIk4HGpRTNgzs1XdXN6EhcvFlQjBg fk/V9/ImhKLkKUyJ5h6tbcpVPcpH/RtCvw4DzEo37RvqTBltti+GnsZptr+xkO3tl+GS 6lokBq1/ANlz2equ87ylmw+w45qb+oqQPBcz3Fo0YgzqW6W5nWMjCNgLn0IFzUm4/N01 c1JA== X-Gm-Message-State: AAQBX9d5Mnif/YbiGe3m5I1FqQ7g8qrGACC+oqiMgm7V+KitoPZXvKpP bjQy8B6wYZmKW9G3L60nsBI= X-Google-Smtp-Source: AKy350Zwu6RqojLD2/82sYHKfY3An39L6ReZ+83ih6pfN87F+BwdyWXKO+szShokbvWeEtwYoIEk5g== X-Received: by 2002:a5d:544e:0:b0:2fb:539c:5e89 with SMTP id w14-20020a5d544e000000b002fb539c5e89mr1022598wrv.4.1681985163497; Thu, 20 Apr 2023 03:06:03 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:06:03 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v4 11/22] gfs2: use __bio_add_page for adding single page to bio Date: Thu, 20 Apr 2023 12:04:50 +0200 Message-Id: <20230420100501.32981-12-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: gk8cuzmpmokx85ar3g194s4qphcffymc X-Rspamd-Queue-Id: 332FE40025 X-HE-Tag: 1681985164-606443 X-HE-Meta: U2FsdGVkX1/07JrRI0bCQfxdYvVgjZ9vzb0r7hHNxYxhXMVWdxsl9F72lMcdGGBXEqYASD+dTtUUDqSFMrBvV/xnDwZ/OSCV9QMFn0vXmsQNdWoAY5mcd7E4MbEZfIdk4MoAEo/sQLKUpkBBFj8F9ryZd9fDzRgIKb2Qh+VniPGb2pX0u0jMqieLjX7xQ4Nc+AtUXlBWGpgYLBKG7WNr/ckELqUIy7gBhMZLfesMKKiCVtXfeAtkqNN9BUus0t+9D5kykHKcsrwyvw0Mo/oU1T88nRRk5zjy8Y+6UIDIaSJcUS4QSShu4raXEy0lW7UqfxIfImCPijbvZXKPV2TNpw5ZmYBQl2vDKs0dztJrxTBe/hQ/ej00+LGgoBAFtXk1Tw+VdQ4dIetmrLPVNTOk3YVw7NgYeBer8idh39knZygclB0ZA5DT9kf5XR9QkbWIc8bQa0WllKHZlIedTPZK22fPHr1bLRmM7We0RBLIekH2gcJTTtlHFy2gbfhVgFJ/95qIS0WrQIfkwXK2M1lMVxZJBTyCoStCZ9o6XHvkcqgbPYRYSSHtK9JaoUWQLRKo1JcLZL/WrqngBlJtPCFbi0paUTQdtFwWFjvYW0Mi03vmWBmC7A8A1SCly9ysq6yfgde3d8uJe/bL6xxNpJwwSITlV5YIGEvKNZ7XQnHqCxr6sMJMFN12FnDoabbPlsdoAnFp8w3UMCSYC7cxABAoVtTz6o935z5M0mXEFtMH4w+nAFPurshtisYthVaw45Ivye4QLPwp19BW2MIDUm5t9q6QxCMW7V5SRO24KSBqKGlMy3fS7fqYowvJ2ubAMse4ui5YUjgMuM1iqmtV8kAcvVswp0usnFpDZwBOGILHy5LaWmjjlqLWzHM8cPpGc9kgX6agLK5l1dALS8OODLhlg9jj72HRHu+vPaqteLDKPLJQ7W79lk+XbczJ7e2J2iD9GbveEoPukJeoFyZwRxz WFHbsP4Z Ft7E7Qgp55iYX6vighHONJXufWUoOjjIXGLVz//oJyEXY4wMLRD/q6YxWNaTJVTi5RMbwXQEaYDrD4+/2HBOjCXE/OZWY6vFuQxxQJn3FOwZLTXxloXKGWl2ADPjU010GKRJNmZlKwXXEPy39sOEyyakXM/0OVa+3r60i4DnzdVkpyC5NXhWIvkBaL+HG5MIioLXHnR1yahp8c25XbCGXXzsi7HdF4uF1L/is4+8bww5G5B81z/5IGpQ9F5y02OUdfTA59rXAAAUES1dNiecLlJqomcjaKmoJmmONDlS3QegSrTH3pVguc8KOq9hgsWWHDPmw6YhW2kctCJ0iQ2ZOY0CjcnLxmj6gncizrIWYrzSV66lf+eJxOUKxaJ2ksgt4FrBgqwb3fmHX93m5PZmd9cnjGNTlS69XBNwpgeWEFcPdGrl3PeKoH13aX8ugUYb50OkPcB830N5zWe35Vn6NaeKBuf4TlsuqQHWfKG+Pb5ia1PXDmn8ISkbRI108SLhXoausCr1Vjym3FjOWQ4ei49CUyuAMpRTeKkK11zSUoIy5Ll9jIZChwbU7TJi0nJO9KOaitsGw22FO9wWGgk84uPXx5A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn 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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 6de901c3b89b..e0cd0d43b12f 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -254,7 +254,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio = bio_alloc(sb->s_bdev, 1, REQ_OP_READ | REQ_META, GFP_NOFS); bio->bi_iter.bi_sector = sector * (sb->s_blocksize >> 9); - bio_add_page(bio, page, PAGE_SIZE, 0); + __bio_add_page(bio, page, PAGE_SIZE, 0); bio->bi_end_io = end_bio_io_page; bio->bi_private = page; From patchwork Thu Apr 20 10:04:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218305 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 4EDB5C77B73 for ; Thu, 20 Apr 2023 10:06:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E07E1900009; Thu, 20 Apr 2023 06:06:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB76B900002; Thu, 20 Apr 2023 06:06:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7FEC900009; Thu, 20 Apr 2023 06:06:10 -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 B5E0B900002 for ; Thu, 20 Apr 2023 06:06:10 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 839E94018E for ; Thu, 20 Apr 2023 10:06:10 +0000 (UTC) X-FDA: 80701338900.08.BB0E40D Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by imf01.hostedemail.com (Postfix) with ESMTP id B865A40018 for ; Thu, 20 Apr 2023 10:06:08 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985168; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u8TpFiJZXriCSIuX4H6qm/DmnDRMN3dAYFyNsYcZw7Y=; b=JEWZ0q+3UU4e/xJ535DpLwytA+nRHdzwucl5bbd0W0gLOq2GKR2d4fbgw2jGYkFdWUL3sq zPTB+EsC2uFzTPa8GuF11zOHGKcVF8vLf6aAqju/6ffsoLDA9+H74qWlEEfkF4taq6uynU m476x8n5UOYuBFa0cGYjAbST6CyMKmg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985168; a=rsa-sha256; cv=none; b=uyu5bR1y2+uYzp0ou5vmWrn5YkmFdPDXSWg0Gn/iIy9YNunYAw8ie+zk/h5RkIpDPG5D7n VSxdwwIGuFX7XeKKMszzOu5BjnEXFEVGYyW6AOL4dDQwgY69zUAqNYgheMEERxOdOWeoR2 XEdkPlrXLObFxW7duUc3ODNMnoFMQHM= Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3f17b967bfbso14829115e9.1 for ; Thu, 20 Apr 2023 03:06:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985168; x=1684577168; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u8TpFiJZXriCSIuX4H6qm/DmnDRMN3dAYFyNsYcZw7Y=; b=bndG0+UJkKXapkWS/Aoa8q2PE81zkArWhHyqUs1R15t4r+oyER19ok7WPN2Lmcafwq jzWPqn0VcPUIVi+JmA9mBEfl2VUrclEPQUlgUz83dsMsFLmyLuXD8FKtjlatqLLONazZ WVqKE4zyMFg3/BiZibqalynJOSiTaYU+O1QssKwLRS/ivS5LA8Osd62yYUwjQ1alnLsY dHYo1xAlwy/a4fWcDiJLooXxJOJzdenelHQuXBw+MO5p91ZP8LyCyQuUcGoWvSFzULDt s0PWc6hOtFp82fg/H5hzjee75Uq/c5k3niov2VH4zkCJXNLTS/u+zABLJYqH/gG67BAi FwAw== X-Gm-Message-State: AAQBX9fHnvPsSF+0dclou7K/XGkCsR9Edn8vM18H5ZyzT6R7SE+bHHZJ yaNXncxdXB7rjyKQvPkVVL0= X-Google-Smtp-Source: AKy350bW2EgyTCeppAYbGJgJ4MBVKwGKy3Cxhhh/Q4CkNUysK8MiWFufZI+smKPXyAJBB06Awe3bOQ== X-Received: by 2002:a5d:6a11:0:b0:2f6:661:c03c with SMTP id m17-20020a5d6a11000000b002f60661c03cmr996930wru.28.1681985168177; Thu, 20 Apr 2023 03:06:08 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.06.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:06:07 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v4 15/22] md: check for failure when adding pages in alloc_behind_master_bio Date: Thu, 20 Apr 2023 12:04:54 +0200 Message-Id: <20230420100501.32981-16-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: j6d8wtyyohmg15ss3rjznnz88dcjx3op X-Rspamd-Queue-Id: B865A40018 X-HE-Tag: 1681985168-944807 X-HE-Meta: U2FsdGVkX1/3jSr3E23iOgOZZLrGjaVEeIAW/DCLkV0rVtYxu6Nns7hgg62ZqZU6hS9RDYcSFp+d1Ku47gEslx6BqSGxZvri7Dm5+mL/Uj4CBoEdnvYPYbvN8i7V/Kl4cUFsCtg150S5evFVBv7eEqg8p0CCZ0lIoCKMpcUnt0G5MjqjfOyLT2cDdtbQhvej17LSYFF0XZCe9eJ2w6Xg8fqHHXHEGOAi1DTKY1vOdd2OsCHbz4NafmLI6WJU2jh9d8i+vrcKfJTXvJaQphrKSWgSWpHaOcfw9hQcUk+WGzJiMr7Eios8tu9EnzvMa3mlAoKCQYXtQ2uu3nAXOun6c2yy0uMNMg8w9oSt45P0tRH6Nf9WIdVhl4PraGIl2u5LCRqK+X1DU//bM3/jxeUtMC1ZJOIBblj4B2Xs3sQ3xrmyfGsi0MiJBzc2xUN/mzyEMhkaOI43/Eejhr90fzYhuLyI1WlTYfxKVCNn5VQDkskob7+VeS2wSAj0LKbjRv2w+9x1+Q2t1KxV4yd8TLWsOpTVRPtnXTVg+zdaG+Qv/ynQ/S74vCIuDZiJyL0+J9HIE4w8GG1r9tXj/SEJWZxXt5E9lfmNm3oi0h8cRHedyAOsnW3kpG3KKIQ8AcOHsjJppT5sxt83RIPH8GwqSVNDV5fQDYdvF+oZPsr5M55PDzjVvEmhCFn6FP8TAoHwFAr2DQGYapHJ6EV8crhtNWOjqq6f2mlHSyCZYj3+oo2rADinGipvu9uRGElg9fC5s7U/6oYmFX3w9sG7xsmz5ekM4d1E2HG4FPLa91L/c6QX19rf6tKSm7AkKAOZ2gqlGSgokE3mVhODt7wpSO0oxsR13QlI/Dqx3hM1TWAnLDZ7+dS65usX84uJEjJlOCqcAzv6vcxGwyRyZkALQrpUvZFR/e8kGG0P5G0MOT+uSOBdVMWbZppmtpkGV5hibMFbr5GYvW3wXu38lkW5fNjGNU/ YPJ0WDiH gIj5vJbtWN2HcXA9kiH1UrRCOLz2JcEom/Hb9zJLR9texN5Sjvo1Xvk7ppM7gFzM94o4ROZOCKoAgNKMoIzKRsVNurAj6wqVX3R42D7xIlggS0RcgleiP3Bmaa5WXXszEBn/SpcOxTrGRRGDA/glr2dsj/rkUpngmVpgG64mgSYspgWEleAAGednQZYWEVJd9rfZ16KedP6HPBATuAWTnrCGxcuy6yjs7KTfXcKADNBXSMuBVEcQCxAsqlH3bUXm1a5uq9Svqmy7z6j8iizYygcHhMgpwv87TbI5lhTJ3dUda7gOzkz6w+M88/rsl2yym/MYSHM3jUsOB0J1wkUIeltGobjM/aMxfdWr4Lj4eEdsajuAEtMweI3cZEnz1wF/soUJKWDDo8USCIX5GIVk5jhH6jBicH4whsz/ezVUyqO4G6lfoPJnSawvZxCkY3CNjA5U+NA1DLNg5jePzwfkzNIo1YYxO9mm2sPbuf1y5tmTCfWGQaPNMWHaD5tdWO0uaAHfBOXftyIeUuMUozjKPrLHypZK9Ov9i91Ru0i/pis4pmAjgetbtOdEckAHW7Jv0r0kjRBfSP20+srNkSYfE0XE70sHwfFxpz0MbHuLzBEinKAnZZmelGe6aw90Y1Z4R0pasESAJATUzGdvBkIlAfuH2eNZuqK6dlJ1rxasxN2WIC5LWmtuLSaJCh5dYaerYk9q+O+0DlQ4+yLakgjFaFxhhejE2uOTaSuqKaUb0Stir9BJd0yNZlRUs6mW8fMd6AhUVB4vShlMIgMGu+aoelo4fUqO3nHtHb/XX X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn alloc_behind_master_bio() can possibly add multiple pages to a bio, but it is not checking for the return value of bio_add_page() if adding really succeeded. Check if the page adding succeeded and if not bail out. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/raid1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 68a9e2d9985b..8283ef177f6c 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1147,7 +1147,10 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio, if (unlikely(!page)) goto free_pages; - bio_add_page(behind_bio, page, len, 0); + if (!bio_add_page(behind_bio, page, len, 0)) { + free_page(page); + goto free_pages; + } size -= len; i++; From patchwork Thu Apr 20 10:04:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218306 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 8AFEDC77B73 for ; Thu, 20 Apr 2023 10:06:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26E7390000A; Thu, 20 Apr 2023 06:06:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21EF9900002; Thu, 20 Apr 2023 06:06:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E69B90000A; Thu, 20 Apr 2023 06:06: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 00462900002 for ; Thu, 20 Apr 2023 06:06:13 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C70B9400E9 for ; Thu, 20 Apr 2023 10:06:13 +0000 (UTC) X-FDA: 80701339026.26.0E266BD Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by imf04.hostedemail.com (Postfix) with ESMTP id E6B0F4001A for ; Thu, 20 Apr 2023 10:06:11 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf04.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985172; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NtU3y1Zr3yjzTsE4b676R+MqirB7TojNGzCXkCz9E5c=; b=75pir2HKUq/SfCgFfvQ2D+UfXKSDywo+JGsBa7Mgnpow1BkI8hzG50AFlLie/NpWIETco9 2jUQiiDrrksApdY4BYjcrzeGs+t4yus21Z7ZVX1U7mGnO+eL8rc1rsS6cpfESFl4uW3ZW9 ENbw/tJWM9vkGBsDY9YZkBxOcjVZfiE= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf04.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985172; a=rsa-sha256; cv=none; b=iamDoZWDOBT523yKDPAnctYy1hwkbkzLS5w2Z9H6B7yIoXfcYsbLyYFkbPwzPO1GTE1LCW L2gQKRUhyfFmSDyV//Wr5C3f0W2NJYynVPtmeYVQLejxdG/wPkwv/dUntawNWcHz0lzwJE LgoWsbvW7iJTsL12cB77MyZ+3dto+Ls= Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-2fe3fb8e25fso287325f8f.0 for ; Thu, 20 Apr 2023 03:06:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985170; x=1684577170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NtU3y1Zr3yjzTsE4b676R+MqirB7TojNGzCXkCz9E5c=; b=Ys1eWRQLfzJWqnlKkGUll/2Ow1dR8NVnbEMkY60mR7vVGiX6FP9btMs9kvd3QD2dF7 dzxjLXaTsMBw9dMd9rAqvWiWRu01WHuAYItDeRORJf5NjSSlzCVC8CnDTzS9QHy99bQ1 h0pSUJLw6981dPlVVxVy4LpGF2MkMYbyftolXRGKguOQXwrA60UMh84Ad5Ou/JBZyr/I e8+zoXgzKSXxKkwHGCUPCq/WNHFeX0JggiJrXmEHDPVz9G6q2bAFtqO3n3Ls+w7zVuG9 zBCOBOQnWETvxTXOg9dB4YCoJfVGA3rY/M+MaD2ytydL40ZtXNw5fALFz8GTp5nRMJdk ZUHA== X-Gm-Message-State: AAQBX9fsqL5yxSVI2ewDI3ErfIrYiFDJ0fJDYH9KWV2Cgej3lv1aFcQJ VukMT0Gq06mLR6T2KHHurwk= X-Google-Smtp-Source: AKy350Yf43FTKduuCP1kMcXqJDkEawnut9n4ItV54pfFrm9DNgw20nsuo8ykxVcEagPqAFCwlrvDXw== X-Received: by 2002:adf:f4d0:0:b0:2f7:e3aa:677a with SMTP id h16-20020adff4d0000000b002f7e3aa677amr912509wrp.46.1681985170733; Thu, 20 Apr 2023 03:06:10 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:06:10 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v4 17/22] md: raid1: check if adding pages to resync bio fails Date: Thu, 20 Apr 2023 12:04:56 +0200 Message-Id: <20230420100501.32981-18-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E6B0F4001A X-Rspam-User: X-Stat-Signature: e8mbms3x1o3kqizaeda65e1knp1iabsc X-HE-Tag: 1681985171-257464 X-HE-Meta: U2FsdGVkX1949ztYaHY2acczByjQ1BzBMxNabwMQZqcAwibAguqWOiZjwo1cfHXUxsdpmAXNK367lNThJGmkUcDOcwTbQtZk0W+Xnu/aR4MIzq5WdgeM1y7J9wavioFR4C/6qg3oN9u/nbQQrSYSHN/SpUJYg+/tLR+/2FcHSTK/vKRALKbIycblYKAM+78ryn8Cd0qsKJoxz3bteafpldJUwchYU881Igru0PKBPRDT6l/vnU/GUXPjhy/CorA4VcFZyowiZmvDOe6K564XSmzA1n0lJFvxrG6lNODJ3PKo1aKOXdu7mO62bJyRNsg0/mDBLwu3WTKJDa/Zs+BS7YeWuVewXFkqgoNC9b77myOEqeIN4/1GYacaI6MS4C05KTBenYqmVN293v9Fi3ZbkoiFfSikrxFtiFXTECUJxraykI2IwG0HX650/uVsH7zw8x6hUlwArRPeLiSCLKbbtfJt0pvtLzAoimNaGaHIeBmvGMgFjbpxKluQ4ClZvSgSuV+L/Vff3hOo+kwtnu03IinmOldsE4NmFJp7nyuJXpsENoSVldMSF9Wu3UkxaL/A07EOi6KC+20UbajYGLstg1h/TnIvsgnGWuLbZa5OcoBXjaPyVS8jUcTnL1oVclrEfkk51rfjnXO7aEGue8ssiFvk1I93b8/Xep8fIZmvSSkKypXImyofT+QSRwolG0Gv/K925lJ6W9hLG/D6KIB/OsoBELEuZ8wcP2YjKvetxvguYULFvR5e5tECtTZAwNie43S5IhRPaCLRN5hMdhCNLuSUZIGb162xP0H5dPYm1n8jgKiVT0c8TTPk5JrDq6Oqb8ZUvJEWY6PJomLCT9pKbI9OJ1S8JABz2VudVwOkMgOBSKkBMr9hbx7oqebu2Pl0cLHk7ESjWTTE5ILNQlU7/w1VirQpObKVOBerqzvzXHwKpAQNhQ+Yt934JPEn1nRnyffHzKhB/xIxck8rR0N wKgcMRlX jnSDXfXBvK/702pAhuxS8mTla7OeYPWb8DnhHbNPaSBjx9t4RNOmcb4/fzdtGMTUeQ1dgeRBiIQfscx5l3pArE5YoboChFQS7XCZ3Umh5CZrjqaSwEsP+FrPbjMmwogJmhAAFD4WoTJECPhpCy2hLwNTrQMxIssG1sfW07GbCiGAfTyUFz+5K/oOl9GmAGYsyK5Bc6Sej8ADVRRGol0pAyr6QkhaupAzlQB14hNZHji6HbfV2IT0mXzw83Okf24QkU+Fo3JGF0u/LQU7LS+aEP1U8tQwhrxC6fioe3QmeEu0CItue4A0tG0e5RegtHOj8vfMhFil2xM7WyNIppTIrff9QFeFPfCoT20CFZXIuyuYZUiYs0m7MJfdgrRjSdRfpvcj0OluUPLa150S5QOQCjjtGzeCpkrGXFanmzF2R3Ny3XRQKz5dks2CjoWtc3omnxca4yJEE4ruyKorEpB55h92b1GNWF/cX2BX6egAzFxkz4Tm9lLuDkbP+l2OssidHvxHVryLbdxUF7INlCH7nc/ItDZBKSXH9JTFOzG1fd+GEsIBaU5wUextw2C0FEvlCqlHY9z8K3Dr/JUk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn Check if adding pages to resync bio fails and if bail out. As the comment above suggests this cannot happen, WARN if it actually happens. This way we can mark bio_add_pages as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu --- drivers/md/raid1-10.c | 11 ++++++----- drivers/md/raid10.c | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index e61f6cad4e08..cd349e69ed77 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -101,11 +101,12 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, struct page *page = resync_fetch_page(rp, idx); int len = min_t(int, size, PAGE_SIZE); - /* - * won't fail because the vec table is big - * enough to hold all these pages - */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return; + } + size -= len; } while (idx++ < RESYNC_PAGES && size > 0); } diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 6c66357f92f5..59e52cf01569 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3804,11 +3804,11 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, for (bio= biolist ; bio ; bio=bio->bi_next) { struct resync_pages *rp = get_resync_pages(bio); page = resync_fetch_page(rp, page_idx); - /* - * won't fail because the vec table is big enough - * to hold all these pages - */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + goto giveup; + } } nr_sectors += len>>9; sector_nr += len>>9; @@ -4985,11 +4985,11 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, if (len > PAGE_SIZE) len = PAGE_SIZE; for (bio = blist; bio ; bio = bio->bi_next) { - /* - * won't fail because the vec table is big enough - * to hold all these pages - */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return sectors_done; + } } sector_nr += len >> 9; nr_sectors += len >> 9; From patchwork Thu Apr 20 10:04:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218307 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 CE687C77B72 for ; Thu, 20 Apr 2023 10:06:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72C2C900007; Thu, 20 Apr 2023 06:06:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6DB05900002; Thu, 20 Apr 2023 06:06:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A2F2900007; Thu, 20 Apr 2023 06:06:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4BCB5900002 for ; Thu, 20 Apr 2023 06:06:15 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1A05F1601ED for ; Thu, 20 Apr 2023 10:06:15 +0000 (UTC) X-FDA: 80701339110.06.C804882 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf24.hostedemail.com (Postfix) with ESMTP id 4CC1E180019 for ; Thu, 20 Apr 2023 10:06:13 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf24.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985173; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/zlw+dyGlfnLYWyTWZyG7072cksvgegzTzOhlPnlIpY=; b=oKmXamrWwcbgw9n949uPK1plIasV66PcpRCtwVC6kkSX0EoKJKlEjukhHPjZJNXFN5WBun TsWc+30M/EFVmFFrrIeYG2pXTJKrtzR37TbJgt08IvAR5dEc4TW3FrxC9UiPh93m/2GfWM tgg0KGW32E3Y49HrhQo/8DBi5Ai/ndE= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf24.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985173; a=rsa-sha256; cv=none; b=DlUdK3Q9vdp9dd0s7voQ2MdUR9OPxD4H25subo1RLlnxryBUpUYPsG3gKaFfRKyD59Myq8 B9R2EczCWDqisIWQ6RprlIXPt6noXQ08rBL7ueZyWiVfskM+ODnXYHrPLUrcARUjx5TTgV 8By7JBxqoU5cNuiUahLlnUQKaHRj4z4= Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f1738d0d4cso3389555e9.1 for ; Thu, 20 Apr 2023 03:06:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985172; x=1684577172; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/zlw+dyGlfnLYWyTWZyG7072cksvgegzTzOhlPnlIpY=; b=SLH4fjUZd2ElL4Egchh5j1H0gxYjtMZZtNmca2NdUTu5MoIF71LyciAG5sWXnu/zwg jr+Ejqr0GuYG/BUPTrCeCMlV/muVRGO9/Mxb6ouQZLQhrBj0nYsIHdC4AvcjA6LmhAxk VfZvJ+cDPxQwv7GHrsLdHswNavKmVH4Pde8psSIjEQKGxYqoKXAeda3aUbNEGCftRfoE M4V/JVScW8kEf5whhdWXCUIXnwAjUPpQCb0w5cGyXSvlESsHWKylAuKpHN9m0+MvXuEx GXJdteF3VFJiYA40ti2vYK2J+w4VFoDKQU42jsHGhcRVCcuX5Nif+pbeS/E8gajibD0X phjQ== X-Gm-Message-State: AAQBX9ctrVOD3ijslwsArQN1gPRms2E0rPqI8BK8bn0Uc0Ze5nSXflW/ /UUtfC+wbXQlaj4cKqdNzKo= X-Google-Smtp-Source: AKy350b4+pGxVTyaXt7ZP5FpDVVarQnYRrcgBCCIE1KFKr5Sq8P0zgMU35+ypve4Bt1qBgDPW2LUww== X-Received: by 2002:a5d:640a:0:b0:2ee:d53b:d9ef with SMTP id z10-20020a5d640a000000b002eed53bd9efmr813643wru.55.1681985171893; Thu, 20 Apr 2023 03:06:11 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:06:11 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v4 18/22] dm-crypt: check if adding pages to clone bio fails Date: Thu, 20 Apr 2023 12:04:57 +0200 Message-Id: <20230420100501.32981-19-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4CC1E180019 X-Stat-Signature: 77zt8eff5xoqo47z1chpupki7yh1t73x X-HE-Tag: 1681985173-449157 X-HE-Meta: U2FsdGVkX18aJpoJmfix2Ui/lnjxr6vCURMqjvU5bKTDE49LQeTMBlsTSOBAROtohbSgXTYvPEDcoCYi929BOIhfmF8vfsACKR+tz4yDu8mMjo5C2uObdpG1Ab55prUHUQLs5IXcyx4owB8TK9uqehihIstxiqlRhN11QCuaYuiy4oVDZBUiaZ+7cettaPlnMeUMxLUkrUbZ2mtOih76tTDhrDJ5BbEYBAO4Cktf3PsIw1fse0fMvGiY6ZWDBDv/+aQ97hucZLsM7T1AlTdEGxfqICzsK/Gr4etfnChSd2gXP3GJlAscFL0tcclKuaoAG6I+D8BzxcFVJPi8r4jyTaKpMa1IiyC4zBZ4mxz6v6PiB3AlYmigrJvtsE3pbPDocE1tRIimvruR4mNWnNGXmn2BUkKq3wVwmMFB8C7WG8jKoK+J68em9yTD7D7uIgKUyRQqKIXoJBp12MWoGKqGNBKCBDmsjxS2eL1Bci2ipJKU8BYctiG5DYOKUJ8QQoH0hBf1uoWhQrj+agoNRrb2J3bT6WvgREqhDEmC3no12tLHt/hns3LOL+IWwuHJGS4DLDvLOVJKnY2gGPNoE2AtTSEyz6KOwgpkzApLROjKvNU6+JavwHENLzQxnJq0U2SVKhsoXXtG6cFQM5xAfq48i3oNFa1bnDZIYlJPtNkCT6pvIl6JBxMRwU15MsMTEkECOSGMJsmA1IR8DcMNunA+CzQnRZE2/zzAHVHbcm1xJx+pgTqS7XtmG+3iQDogcGXRBDqwqjeIBvGeOyRww6/WNNy/UArSQSv7WBsghywyHp2Xp6ZQ8z7tRceBUh9tSTNR+qRy/T+qH+MiIc4ejQPtmQ9uN2A4gmoZfUei5cmvUicqyG9eOfOfZAsUem4ZKAR86IXJPQ9XeTJ3azTmaKFv69B3cRV1FppejKpRNzTeKFczydMd6Agf8EbOpdlJEbPM+bhACLm577tDwK3Dpte 8tafq8YV iVg/Gm7MP031UGayfF8R8q/eCo8yTBD7p2uFK3/FDvB8t6TkmL2+JCnEPJMzu4rLFre8gJI+Tm0cYZZl7+cmW6xkxxSGFz2WUbiKy2P6qZT7wpP+kS0BwsYqbWpWi0Eu05k5OSH1KSUW0S4J6lu4+uYMN4r6cmTu/wo5LbmHrgI1vAYScKTpTMZAtML8viKAyirO84BVetLG2ecIWplmwfa9TOQC5wJ28QcrLzHagO4bBAkN4/82ezQg3dW7N1v2vrObSVc+lsHcaUsIgkrkOCbQ1sydFZzdMRyAHyTBOh5nNYZidh+G7xfN8LayFQ0U1wSWAvjoSSyDq75ShjPWlt9pOqGrjfujdlIanMf8pvgMZgfbWFHQqsD+3bphETbDBpw79+s7+DhpGdGbXY6twjD+VWHixM/pq+batMZBOQV0gOo5Z/D6A92ndB0JTQVN9qiWMY3dOO6bp3jMPS2PKSGNbpS4ri2fq2PXSF4q4cYl0wJXqT53ux6UlfsjldvoerKPPd0Rg84hDuXEX0nDokoae7d2TDs8XbQJ4YfWSisqjF/lOEzcJnDN2OcvftRnYiYl/duX9QnNq3pifHYLFcqNV965NHbmz0nJwR38mT7q/3EAwvHlXok2z2pTNHfL1Zwt1M9yeyLOUxWR4E3uMndcBuofx/WRCi4zi3LUXRTpaeTjmcW5IO5cKM4WV+Fgt/QyZeCrWriko5Dw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn Check if adding pages to clone bio fails and if it does retry with reclaim. This mirrors the behaviour of page allocation in crypt_alloc_buffer(). This way we can mark bio_add_pages as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/dm-crypt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 3ba53dc3cc3f..19f7e087c6df 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1693,7 +1693,14 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned int size) len = (remaining_size > PAGE_SIZE) ? PAGE_SIZE : remaining_size; - bio_add_page(clone, page, len, 0); + if (!bio_add_page(clone, page, len, 0)) { + mempool_free(page, &cc->page_pool); + crypt_free_buffer_pages(cc, clone); + bio_put(clone); + gfp_mask |= __GFP_DIRECT_RECLAIM; + goto retry; + + } remaining_size -= len; } From patchwork Thu Apr 20 10:04:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218308 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 5C697C77B78 for ; Thu, 20 Apr 2023 10:06:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 973A590000B; Thu, 20 Apr 2023 06:06:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FF49900002; Thu, 20 Apr 2023 06:06:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 68C6590000B; Thu, 20 Apr 2023 06:06:16 -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 58512900002 for ; Thu, 20 Apr 2023 06:06:16 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2F1EB4013B for ; Thu, 20 Apr 2023 10:06:16 +0000 (UTC) X-FDA: 80701339152.23.CAC2369 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by imf07.hostedemail.com (Postfix) with ESMTP id 5C3714001C for ; Thu, 20 Apr 2023 10:06:14 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf07.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985174; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ExnlLXqiP3hLS8bpFiqaYIxJLAKQF5DCX5VPxtSPsPo=; b=a4FwY333VVuJgAP1VZCaF5zqKZniTpL5I+wQ+KIh08iEoLBkxLhMdjsLHAk4yj2j0k/lHs FanypWw4Q6U9f4/q2ZF0kQ0kcmTBCx+OfIjJmko2cR3+Rj0R27OcIwH8GV4WEvtDEFpqJW KpbLraqiGEwAecw7xA+kAVEa27rkZOc= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf07.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985174; a=rsa-sha256; cv=none; b=QBR1RFQ+YeKriO1OhaTITQKAEVSVAAtyqB6LOHQoMwnIj2tP2rZTZu5lNQMT4f+JcxVJ80 KJfglEHaxqYnQZIEkyBAtrQD9cgR3xip8wBsMnfW3rozvWVNJsdjuSqeg6ndN/fwo4p05a 9CeABKWBwSiWTPS1srNqeTO72CooZyk= Received: by mail-wm1-f52.google.com with SMTP id he11-20020a05600c540b00b003ef6d684102so2781073wmb.3 for ; Thu, 20 Apr 2023 03:06:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985173; x=1684577173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ExnlLXqiP3hLS8bpFiqaYIxJLAKQF5DCX5VPxtSPsPo=; b=M5Xwo7xPORSCMMzhfg8oqzYJdciLzq8r8R0gf25zBF5R6z8s/pEo+7QHw34JrK3sPF YO731hBTQgY+j9TwXAHunklJ426nDq8uFSrGXS6oIuqRSQPdzgWVMn2CPSWZGsCUKIBD epF1StH8gV0DpqItFge4caSMD3oR8xI99E5meEWpKylD6KrCSEVz5KfIvvvZWsISyCcE e1p0ay/NR+bX6E4lwEAaifM3ehRYBVSCaVG+ETeN4YJ6aLDWMS1XqweTFX6V+74L6eDQ CGxIN1r5ApuTczpvJab7F6ujVn0lvbSiJjsooH2cQMpTSEUpTqAe7DDGAmrfDiDIp4MR qKkg== X-Gm-Message-State: AAQBX9f1MfAgldXV1N3lilI7XAtnpSKCHqhQpt2IKYwl03I2TZF3Fwws PyHzC75wqK7Hf3QGa2quvNg= X-Google-Smtp-Source: AKy350Y9Lh9XIY3qybGhOCpyPMv4/qCxT9O5teS3GZxkrMtKC5XpeBENII5mka0Be7VFkgyszAIoCQ== X-Received: by 2002:a7b:c4c6:0:b0:3f1:7006:e782 with SMTP id g6-20020a7bc4c6000000b003f17006e782mr804698wmk.25.1681985173032; Thu, 20 Apr 2023 03:06:13 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.06.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:06:12 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v4 19/22] block: mark bio_add_page as __must_check Date: Thu, 20 Apr 2023 12:04:58 +0200 Message-Id: <20230420100501.32981-20-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5C3714001C X-Stat-Signature: fyb1yga3mt77qpn8655tbc4gs8tpnq59 X-HE-Tag: 1681985174-815256 X-HE-Meta: U2FsdGVkX19p1ExWO7MisvddiXKmPNPOc0SxieF5QVMfc/86o7LZ1QXGgsRemdsw91H+7BvajihO46GfsG8ecU/aCuYRb/PrqiCGkqH/Z5pxuUvSYiPz2xUfxAauS5LfH9VELtP5K0KWj0Rfb5Pm18qZNCo7ELPnbrpst1OaKVNnfzEhilM248IEL7cEpJvyhLsudmoIDXn7l6ftDMn9JzOqAmIJglLDS69PA/BCu8ByKhhBltfmob62jUl8UUxXwoSIqity/OfTPK7mchtggsSJ4hc2X1pf26XiTM1lNID8TVUE5zfhewxxX4RXnc6Gij0Q4w0107r/Mchnut6dc1EWSMx9K4o4n0R/nGan39DSpu9oh2iMwb3Zd5/TTwalYChdHfXK6oXEGIwaelFSY5tqQt7TScNFlrLhPnMC32eXob3KTP0s7bMjFjukNtIHxRNcB5YvBY7189NjEkC6B/LDqfmHpmXqZLrhR8biJh4xVPb2diWT+9Lc6x8zuYiC89Yei83S9eN91OOqSsxTGWGn/+bEFah5Xw8dDHihDzvDLhvJZPkSdb7itW/Jp3AztX1bHxUevlBzY9+jVok2C7rH+6Aa/Gz5syS8QdW/jjuAiyAtR2Py+Bv6O2lpptwVayJsU2MCCXQ8ruFBKlBm9brFvPKNNlzjDIjf/o3dkIF2KKXUNqyxp2qtBSViPWXRBGZDMXpF9SUoa6PXPbo4XIYtuhoTe4s6W8NbA3aTK0T3+N66kjCFwd9C8EB7crLrEM2UjtSArPvpALZENEZAQkkKebKZ/Yei1PAY04+WIZaGIqWnLEsbDiQkjz/WUy4KVzMwIJNrz/FJMItF3zgkqOC4roaJ9HGj+cXXuvM+JtqpK0uW6a7ZcDuZId67+bZbRQDGxDPsgLSwo8GM7WircoMvXJQo9qt+wE+p8XuQAkbGkSkrT6XQo3h+NpCXFjNWXo94zmZlvJ8HLAcfQkq WqgnUd5i mt8NnUqH75QVaitRfOxj/7BOUvxarHbeJt9iinyP7g8pa4kP9w7Uw3O4pBK2H3BMsavqL/1SIMDQkiZxtbaCpd8yudroEoo5oiZ75J8vrKpVv1rEzCob/4BpCikN5zQMGdQUtBL3JMjtG+AcsVI2phh7RXR6hn47J0TKWqyfYucrQ1xrcMpTBVG7KuXO3/YJgZ2+fZF119GHfbxN92pKe1l+4vf4kH1i2I0BjAgyw3I9VZYDxMvhTn1rNLXenQ/ZHMlM2/2mQqqlAP8qLduugSVWLnV+yitFaV+NZP5sxT7cK6ZYME2qH+PqAkOIAEyN0RDtwp6foW3S8flUZB5cAF4KIsreDyX87LCBvylJ4P39xEqBT+tXLH+6GasQ+Tr+MDQldXbXsaGxOhg/jBQiPz1huUYwvVMOmW0MbCcqzqnU+gC/hgjosRgWesPLr3DhzATH1hoPDvoQGQYIcHap2oNV5lQhlXwXW1PZNGOPFBDy33PPhFKqOUSFYMC6Uq+Ownxn9lergwXGKJ53qRGigf/p8gcfroYChkkHDt4rFvpRq8pQtcMZEFwIW1rEuMCL0wLnNohZlYJbZJ8wFkSE5E4O3klPSM5rPG1o2xqBuQpzdEnlPZTeyzvkIw+/VgoMvhcdRfXlAkqhQjMdMQCxnKa0lmtXwQFPuRdVYl51wDTMfnrZ4Su4mH3/Cv2CZwULF4v4zCbJ9ceZ8ji91jlFkA3aeMze9iVD8dCfJ7badO9KCskiCXDsWQOQIxt8zzW9QIUoR X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn Now that all users of bio_add_page check for the return value, mark bio_add_page as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index d766be7152e1..0f8a8d7a6384 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -465,7 +465,7 @@ extern void bio_uninit(struct bio *); void bio_reset(struct bio *bio, struct block_device *bdev, blk_opf_t opf); void bio_chain(struct bio *, struct bio *); -int bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); +int __must_check bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); bool bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int); From patchwork Thu Apr 20 10:04:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218309 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 26E13C77B72 for ; Thu, 20 Apr 2023 10:06:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D49C690000C; Thu, 20 Apr 2023 06:06:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF71D900002; Thu, 20 Apr 2023 06:06:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B21FC90000C; Thu, 20 Apr 2023 06:06:17 -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 A3BAD900002 for ; Thu, 20 Apr 2023 06:06:17 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7088B401F1 for ; Thu, 20 Apr 2023 10:06:17 +0000 (UTC) X-FDA: 80701339194.05.A38AA41 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by imf23.hostedemail.com (Postfix) with ESMTP id 8BE18140026 for ; Thu, 20 Apr 2023 10:06:15 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985175; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ybte8ln4cL1imogQbfLUc6IIuAFaJLWmv8LuzJpUUJE=; b=2cMBHZdbWfWvMfOkFha6PWD9oaXPwhvzn9wzZFB9Pm6tznt10UpSwoCo7f+irYVTUEWp57 axiKQKL/kzebudYFiJ7UButKD2WOc9Li3pRnEWVAEC0yVozSUKyCZMGa5RiKEDcVJp3v6N 3SOwYiy+7pNzWuUByDkvr2rgb2GT5fk= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985175; a=rsa-sha256; cv=none; b=qOwJVILqEJRuq2muF4pgsNup14m0KaMOf+002DInv2FmyBhmjxXWY8zCOFiA2bX1t2r6l7 kTAXczPu4e6m8jhnP6n8z0yJVGi2qmeTa8UWXBf83aMGlhluN38WuwfXP41PxMAjgGXQ9W VhJQXn4PIXmJyCAQ3d8cPn1gGMGDuT4= Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3f17eb6b10fso3445445e9.3 for ; Thu, 20 Apr 2023 03:06:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985174; x=1684577174; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ybte8ln4cL1imogQbfLUc6IIuAFaJLWmv8LuzJpUUJE=; b=BMX9ssqJBED9NgEgpduyE0XzBfYkXLkGEqxF8+WWl+Pi1ahu3IH1fli2MgJU0tNA2Z 6M4Sv6ZNTSrGKKQtevXVp8NPDn+IiO+wYV4rUzP9QLy0pBmgqYPt/w0xTKfbX2lWq/rP kH81504QhNDKLFXo1ovGDcZlTh+/vv8k3BSEIwmX4XsndWvr1TagZi6qe+mNAnUuxfQo jtO12F4sTIWFcM214WaFlvaCxiqJx/ZvqcdObmv+N9oSjeH7rEGqzhMaKGF6QGp4EVxF 4JC5gusd5gT1jpMcaMBXkvgp6GRCTitYArRh2hfj8egJ/56PR/cdogmH3p6VHp7VQPJY MG7g== X-Gm-Message-State: AAQBX9fq2Z8RUQAGUugF3kjIY4u0H7TrgCOhsBkIB6ri16K/XVRfT+vG cX9XDnA1+JRk4m0+ktt1uSA= X-Google-Smtp-Source: AKy350ZrFHrJO95XpjLsqvNhaT3Lj7em6PpVK0jNKwO81XYdkMaIRUgqMSWWRox8APZBVDphzDkYwQ== X-Received: by 2002:adf:f384:0:b0:2f2:9198:f0f with SMTP id m4-20020adff384000000b002f291980f0fmr833210wro.10.1681985174142; Thu, 20 Apr 2023 03:06:14 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:06:13 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org Subject: [PATCH v4 20/22] block: add __bio_add_folio Date: Thu, 20 Apr 2023 12:04:59 +0200 Message-Id: <20230420100501.32981-21-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Stat-Signature: q9ijfpa5sifhqjwcyg41jzq1sngomggn X-Rspam-User: X-Rspamd-Queue-Id: 8BE18140026 X-Rspamd-Server: rspam06 X-HE-Tag: 1681985175-555937 X-HE-Meta: U2FsdGVkX1+2914xHz/l6Y/cCoAwWGinx69w7w6pu5lOMUXjXtqMtMdDHtUcssWBGAvowzY1WoDb+c+DrRQTIORHLQrXjnXcRrEPuJQqIJPS280wwmSFWWkoVh8ojMnN+SaCmDjNwXEWcHA90HBmbxdm+S0GJqqSy01Bmdfi+pIJDMJHCa0OcFYxYBNDdElxfTxYsp7abONesriiA8S8UlVHHsM0yia8lI7Amyy6gI8gIbZJo1HXSfq6pHqPdyPchC5q0abWHhC6xf2Fiqcg39hniTid9a4DvkmuxlnjdT5sLtie5O36EuKEn1pGR6iKvPlXwtPTSJCFYc53KB8fI4sFPZhNpyrqAcGgCXI7Y6Lt9ZxZAt8gsInLlIeE2I0Hb1WTgSB2knXNKLaKrl9tM7bNmpdZWlPv1rwE5ZIdFSogLLbXxipvdV/t+K7oPslCM/O3a/J6PUEQK8QgZN2vupWWyTRESmXF8o0vcDh4FK+VXPdoNK6KanCHr6Yg5UE9lC7Tb1VaC3AEG+AHJdTTVcUYcCcB3WRnFw/qo2RZl3Jnrybd334/FG35CC9RCEZ+9fMXemhUtwH4klbqnvhNWF59u8DpVDuiMPblzI6ubklhFzVFmncZJWgBD5Z6fJFsgI0VHDNDwB5OGNHoWIbBpeHKsFgSYZwBnYHGiDr8Exb0bDpQCVBu8pOL4u+AfxDALQW/RIHKPOvH6UlVd3n4NhOcJQxxnFXW9PrZYgiYMDzILXrhO+BMaPsgUlhN7AR0Kr142ZFdsLlNuNz2TvMo2NbtewwTSUzxtgyHnSqK1iG0KiyGGXzdWfQJCIRJgmiKD1tZSwdT/HO1blHW15EkOLI9TQmgSrDWhg8hBFjUmmlc7RWgEWXOzTlu5iZa+dlZAvFuU1a9V1/4jK5HxxD5pBWgntV9DW+3ZEvE8N/oniTm4v61YUfmE8ckio2/LQuyRD1ZMP0Jq0IrfL8SSiT qyd+SEd0 Ka8JLicMMuDMIO5e1dF4GfXZKfdr+U/swJW5RLZzLw13s59uihmfZkN0U8tKiALjIMQyKlm+xgG5xzHqddBbTH0RnQHf0Qzr5eTdin57CDXe4ClY+Ju+Vo9re2sdP3sJgckz/4iakMe0zrkcLZxV9mrCX2PXJeFUecPoPKVfW9HL4d+x4qi7LV/8h0COdpprtUy/b1wca77lwL2NeAj+jUqMbxwbXvVNvXiyRtg0TPIAzCdIk63e/byA5ei7VCaCQTi4XQ6szQxDcOkgvE9oZ/JBWcaUlFkVRjDxLe66RpM7RHiL3A0ZUMUx0tN/L1aWi2aWrNKD4PGgwdiCy51WgE/Ea2RVPLIe7lmGlndEY/vTNPtNImJy27QlHgOgHRTNO/ouyDa/LYjGdjBflt3o+7gy0WAYeYh1eYlrE+3qkUgq1LYZiesiOoZTRV7GAXpuxPbZppu//T2dQfp2UNfHomH9fWSX1HWy59zDGJwBZXXx56IwQ/7YQJhXA7TMk8oayqxxdBBQESjnX1a9seVp2/YiI9Bs+dGOJmTFqsnHvfT0bJ70l4oKes1jPpkHkE1kE6svJ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). Signed-off-by: Johannes Thumshirn --- block/bio.c | 8 ++++++++ include/linux/bio.h | 1 + 2 files changed, 9 insertions(+) diff --git a/block/bio.c b/block/bio.c index fd11614bba4d..f3a3524b53e4 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1138,6 +1138,14 @@ int bio_add_page(struct bio *bio, struct page *page, } EXPORT_SYMBOL(bio_add_page); +void __bio_add_folio(struct bio *bio, struct folio *folio, size_t len, + size_t off) +{ + WARN_ON_ONCE(len > UINT_MAX); + WARN_ON_ONCE(off > UINT_MAX); + __bio_add_page(bio, &folio->page, len, off); +} + /** * bio_add_folio - Attempt to add part of a folio to a bio. * @bio: BIO to add to. diff --git a/include/linux/bio.h b/include/linux/bio.h index 0f8a8d7a6384..99fa832db836 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -473,6 +473,7 @@ int bio_add_zone_append_page(struct bio *bio, struct page *page, unsigned int len, unsigned int offset); void __bio_add_page(struct bio *bio, struct page *page, unsigned int len, unsigned int off); +void __bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter); void bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter); void __bio_release_pages(struct bio *bio, bool mark_dirty); From patchwork Thu Apr 20 10:05:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218310 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 F3365C77B78 for ; Thu, 20 Apr 2023 10:06:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E85790000D; Thu, 20 Apr 2023 06:06:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 070DC900002; Thu, 20 Apr 2023 06:06:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDF7790000D; Thu, 20 Apr 2023 06:06:18 -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 CE9A4900002 for ; Thu, 20 Apr 2023 06:06:18 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id AE71EC058D for ; Thu, 20 Apr 2023 10:06:18 +0000 (UTC) X-FDA: 80701339236.24.B202919 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by imf21.hostedemail.com (Postfix) with ESMTP id CE67A1C0011 for ; Thu, 20 Apr 2023 10:06:16 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985176; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R6+NeAX2XCjGoXZTYs/vHx8pZBcBY0nCsbbwup4DNoY=; b=3ZJYBRCsMhYWnD0Kt31MNaZfMq6KM/2SxU7dpQ7uR3mZceh1SwliDWT3Tk5ReUZ++x5Nlg kMgDvonJXPOR5junCG9BnyuY3dj8/wCX6KnUgyRWBCncBEAo+z1Hd8wZUOCjsUZpljMd04 ffywVt0dYCz8p2H8MIwf/Oa48wuhm+U= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985176; a=rsa-sha256; cv=none; b=gElBWIZieCeQrlfMV2SF3J16zFiiKcdesltNHq7ImtNOjIiXmnn3ggFiaeL3SRkp7zBOrH mmcFQ1nmFAv0dF/cYSl959U1exRmtsrCqKKRPQ0a1/fHDPgrRdYx3ZNnxBuuN1wcJnxwFB 9ebJjIBghPU0M2sSg/wIGaZwAaG3dHM= Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-3f173af665fso3391405e9.3 for ; Thu, 20 Apr 2023 03:06:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985175; x=1684577175; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R6+NeAX2XCjGoXZTYs/vHx8pZBcBY0nCsbbwup4DNoY=; b=ayARhWH4U4uac9xDHIrosO/3+hJj3h6bAcb600JF8uVU1F609UALzURmKly/OKWmiZ uoZTrGzUBIAuvc3yn0ND/HcUWmJCzc531lode9vzY9f8LL6voPnTSqbl/HFdk6hhDL6L 5r+tgfgW/AUsWX+RJboNXXtICOrNFQ37H5e4wsYlD9LO3A4apJo+ctryggGfmP++IZKU gdjI4d0MBCpPoMRMtT90/FL1jU/Ea+qkXVJqak++6vSNpsVXX6EEMOQPtH0jhGyiBNrd gfz0ZcsTSndEhrKJ0AjOhi1EFBE67FvCrCAAWC0uzuutcVIGNjAaislj4+piWlf9YPxY 90qQ== X-Gm-Message-State: AAQBX9ccFAdosauSUE9mQWLYMwnwH5Bsz72AB6FSDK2xxUC2/NO2VUEt x1f7lqbmviP54w7zBTRjIkM= X-Google-Smtp-Source: AKy350aN3PsOr81dbQugpISlk+yjR+a+4/2N8Qu7GaXUJdAVlidoOhFCKUKxX0oN92RzWan4aBS9aQ== X-Received: by 2002:a5d:5957:0:b0:2f4:3b2c:1b2e with SMTP id e23-20020a5d5957000000b002f43b2c1b2emr951041wri.31.1681985175440; Thu, 20 Apr 2023 03:06:15 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:06:14 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org Subject: [PATCH v4 21/22] fs: iomap: use __bio_add_folio where possible Date: Thu, 20 Apr 2023 12:05:00 +0200 Message-Id: <20230420100501.32981-22-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Stat-Signature: 4sb789tfa8f41ns988qcuekru8j8p6ow X-Rspam-User: X-Rspamd-Queue-Id: CE67A1C0011 X-Rspamd-Server: rspam06 X-HE-Tag: 1681985176-89303 X-HE-Meta: U2FsdGVkX19aftCEEKUg3kWuwkxB4ygT2uP2QBbJda5lxp+6QdbDSSWLadHLl443wo/1YvBhwzBmlKpHZCNyzv3th/CHFFKTVcv/u76HnVw+wfMjrLoAjzQY3wH7mh94IDG8o9RWKIpD1QbaQDsxXXqmb5lhISiD0ftNeHHbKkSPX3v3dl5PeKlgSwFjsJpXbrpk/uM0OnVuIiOC/UfPEPy3dsIwl2tG3hjmLnkjmtcNiLf3sbdw7OOpMNy8NcObkbGx+VtnlR9JeIHopLu/+tBPMx05wn0rqe3+m8lo7oCf+PCLJP5nuk4FaIq3lm4G0XCpMWYA86SjKNjd7z30s5a3EcvmXHpmwdRZaPykFteAYohWDMpNXzrW1Y2eqEkYrk1+l7iF/OXDeBsdFEG0bxPjwFhGQCt47YjXGUqRnGeLPEk4i4ZUnrZ0nGdyIO7BEFUoVtKSo3lneZZJrEUwQTMovsBQ7KYomjsklAM1XvOlWWwPUZcwYX3k3uYFZZSRyHFVGHdVyLKBdHiax2qt77DgOULozq5jN8ltnOSxfVOAQeY9+iURrgFib8bnaEsvuTC3GIpQQAgsguG3BZ8zjGA5PlVU1f016KzB0Fehrxz7HIYQTP1Gz5z7qBKRoXq+CYkwwWdwEFzlRZjjkeyuk+pWnT9sUq3VusiVyChvnocEuCjPzs4V3tqnJxLXmSheiIaKXffbHgvkWeYA/DVCzGq5kDZv+UVIhXN7v87bxtjVHsl5DJlT1oK+lXPgYXnPMXfl4Tak4eIy+Sn0zvqpQimG+DCPIRShjjHxQuZx5F51Vn0dtG634GWdd502xeftp+xCP5tLu5rXMOOn56TfEYr14yzCGhsxHZrYFLqVBA3P24qkvNh/xW4o16xK2D+vygbM5IvpdIaC2Y3+Y2pASrSE3NYBS55k2gXQMHGyb8RlKu/vuJKNAt9z3k8cJnPfgsEMwV9q5xFDaL//zIC rjbMA908 /BDNPPxWPsax3eFQZdDsCEWRdxm6RQh4nZHfOnd1Yd4Wem7sfaGszXa8ucmdIgFcE/p97/UdQ6/fB08FEg/LHCVYy1kTKMb50DSQemhP7/Cp/mlN7WN/L2jV0DNYPadr6iuAiDIyV3U9ax/kyxU+ZqUZb/2t4OAAvO1FYYGrfUFJrDaXlnAWNB/OmD1s3KQoGsUJ6ABTrJuxZLWMnNVnK4twjF2ZMucC6uDXfsxnsWYNcKWDaCA9oOYSG9BOIeOEAwsU5tSAaG2/hBLSCFlEAqHvxHl8SgC/+g+U32S8GoTl2sQ8fpL+qOq25fVDYJt0Nmk2nOda+nWrUHfYLKUlqo5/3Bhrmoqvcn50lw856O90F+hvZKXWlV4qd5ELolvHdKd2KpLFSzyEKPiQSu8FSwGrPbLGhxxmBNrIMU4NZBLaSzPzltk8jksVlfXs/NjDuPVXB4laFEWXbK4Wjh12QGiAMlbtakgTuX1f5ye8CgQg8TC4LawM+FkgTbSHN0mIjEuaahpYLmGvaWd/35yJ+kWRbh3ApB0rzUNi3fO3G9FJ859eS3vY9JSeH3GMIl34p7+I/ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn When the iomap buffered-io code can't add a folio to a bio, it allocates a new bio and adds the folio to that one. This is done using bio_add_folio(), but doesn't check for errors. As adding a folio to a newly created bio can't fail, use the newly introduced __bio_add_folio() function. Signed-off-by: Johannes Thumshirn --- 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 6f4c97a6d7e9..473598b68067 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -312,7 +312,7 @@ static loff_t iomap_readpage_iter(const struct iomap_iter *iter, ctx->bio->bi_opf |= REQ_RAHEAD; ctx->bio->bi_iter.bi_sector = sector; ctx->bio->bi_end_io = iomap_read_end_io; - bio_add_folio(ctx->bio, folio, plen, poff); + __bio_add_folio(ctx->bio, folio, plen, poff); } done: @@ -546,7 +546,7 @@ static int iomap_read_folio_sync(loff_t block_start, struct folio *folio, bio_init(&bio, iomap->bdev, &bvec, 1, REQ_OP_READ); bio.bi_iter.bi_sector = iomap_sector(iomap, block_start); - bio_add_folio(&bio, folio, plen, poff); + __bio_add_folio(&bio, folio, plen, poff); return submit_bio_wait(&bio); } @@ -1589,7 +1589,7 @@ iomap_add_to_ioend(struct inode *inode, loff_t pos, struct folio *folio, if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) { wpc->ioend->io_bio = iomap_chain_bio(wpc->ioend->io_bio); - bio_add_folio(wpc->ioend->io_bio, folio, len, poff); + __bio_add_folio(wpc->ioend->io_bio, folio, len, poff); } if (iop) From patchwork Thu Apr 20 10:05:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218311 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 6FC03C77B72 for ; Thu, 20 Apr 2023 10:06:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4937B90000E; Thu, 20 Apr 2023 06:06:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 442CF900002; Thu, 20 Apr 2023 06:06:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26D5E90000E; Thu, 20 Apr 2023 06:06:20 -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 17E13900002 for ; Thu, 20 Apr 2023 06:06:20 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E064AA013C for ; Thu, 20 Apr 2023 10:06:19 +0000 (UTC) X-FDA: 80701339278.05.1587668 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf12.hostedemail.com (Postfix) with ESMTP id 0FA614000E for ; Thu, 20 Apr 2023 10:06:17 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985178; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bdnAdvAKJlDAz7pM0pp8Diurpm3+TR0sCY4FonfaEe4=; b=DSqVGkMzJS7kRp8ObjuD/kWZGEZ56Sn4pQpj57L/yPGlE68VHElnamyPhsS3b+M2feFIHf m71mfBJA7RAP+cyDubvnK+ZSYbqrs2LGCo/lGMJ4QryV+g4FOQ0qV7YMtTSYcMwTB5KVGP PVEcwDslYL/vG8cPxWudRUBFWvmPxpg= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985178; a=rsa-sha256; cv=none; b=AdRaa7TlXSS1L/80a4dfNRudimuiH9m09Za9WFlckerR658OuTcrTCq08f2EDH9pYmAOs8 pPea77zEUTe1de+3O+1qqkI7EXAu8FCMZAePbZCaWq5XF3i539EajOBzp3SJbeLBhPHrCM X4MjFsDhr852LGDk6XUElCRZ3ILCBxA= Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f17e5fe8bbso5485275e9.1 for ; Thu, 20 Apr 2023 03:06:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985176; x=1684577176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bdnAdvAKJlDAz7pM0pp8Diurpm3+TR0sCY4FonfaEe4=; b=g/t8K1j4M0r7dC1uZT4Cb64YIipT0b0i5MuLunpbtT0bAowmtrL70NfwVI2YLQpULl iyj+V83ZSK1lzvgFP8Rcni0SwjrmsgQG4W3j51frnVK05OuRF12LafQRTnprBTWMDcG3 sguPqlXA+UyBRh4tSmmpOSlp780uGK4VmUQLx+nAasvMw7KaZRCl2bFM429Gt/PE7Tue gjXTQ8qpk+C/+bk5hgCmjgV/QoiUl94KdwN/2GNv9Eggq07kyDEqtMXTg7jj4a+90pMH 9t11w0Rlzr0qPm5Gvrs7lPDb2BGgvXkf5Jd6gIM62KQRrh4FpDnHgqkkMPDchA4iMdiw E58Q== X-Gm-Message-State: AAQBX9dVuJmUyVe6BC0Xp7JpAeaw4eUTilczjKxKhWIilOdnrz9EeEPm 8+a7+sbJ0bMOHJE6AK6Ph+c= X-Google-Smtp-Source: AKy350bs2gtzNI5cB6yEjD27bAOubU763Pln69XpJllBqakY/TYBXJ5mOXnM5tQ2B75UHodvDIFK3A== X-Received: by 2002:a5d:6dcc:0:b0:2fa:43e7:4a32 with SMTP id d12-20020a5d6dcc000000b002fa43e74a32mr694948wrz.66.1681985176558; Thu, 20 Apr 2023 03:06:16 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:06:16 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org Subject: [PATCH v4 22/22] block: mark bio_add_folio as __must_check Date: Thu, 20 Apr 2023 12:05:01 +0200 Message-Id: <20230420100501.32981-23-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 6zqxbecpge7ifp75xa3ui69r8uyq8j1q X-Rspamd-Queue-Id: 0FA614000E X-HE-Tag: 1681985177-582014 X-HE-Meta: U2FsdGVkX1/9iY8pIKjD9+Pc3RZVblJ9Ip/KRhDkU6O/tZPwWOUnzEkE4gA8nDh1Xf4nfiTa1Gk67Myq27RehspH3xrgAXkZSCgry7gf0/n7ouYEY5Rl/1QwtL4s+pRDc2bPu5I8xDfOBYahoknyHCx9M/i+4AfELTweD8U6ekWvzP54nQFogIUaMuZX/SrU9GLxOfI/yRIEgg/czTOIf7khl3g/LLSFXd4s0g3QHoNNnRE2Rfx1lHDFg45ENku3Fa67oxsgjXRVq5z8qpcYEqYmu/Rw45P2JbelVCNE43WrXvjPbgU+D5vwTf/XOk44WwOkBJM2MA9xj4ROpZfr/csKOx5NY+it3oDKxH/lBzUMUXOBR4E/tfeno2sMwclBfjBdkNZ0JO7oKAcxyTF5qsFITUmqFF3hTOAUSKv9BbnR0+2KFo00478HRk5q/3EiilPeHL8gyYzraPYny+F6aoxt+pRgXdWMbChl6DbbJ/+tA0B7vhE3Dp22LII1/3Dx1IffPmYLxM8KNvYqwkD96NRWX46JEeFzwFQBhWrko61j1mTpbWWkuJWhWRkuQQZ//KjcymxfpHh7TxnE84NxYF7mxMiLcC4ppYSwTFdz7GyDJvkIZaAVXYJVQMFQrEkMwRKhL0D/CsPdaZY/RkRZuPb8O9t4C4rxJ80lBfhVdK3MxwKWxhNJaYinmjW7SBcamXu7WFfM9SvHbfP/nG785jhnajt9EjI4DqQV6fdTaxW+iDE2uChlRx3saL4lMCHM8NT2vaibl4+8fvge9itOiBBds6Dew9jOCcqbkhmbftgwuy2vfrDUZn/XiIePX4NWmnmshc8xJGzLt0MHvjr4dqbtPNDWQ+EPRszZQ5k2y6EhG7GfMD2ifKmEcqDbUiPCh+NIVZDxmMJS2VVodYZzN638EeRSR/FJCBGTb7AltlwkTIg4++E6iHQghaURfTpo0ItGxXZZf9zcab0D5vC b9Oy5zQL x9mVdrrHCJj3QePXVGiPyPF+Sds5k7M9UQzAkHDjzWWTi3y4GrFu8BziAslcX009/X5B7fIYrgjqo9SDmr1u2fhDO16lFa8YGvDyPp0PjPZFvbwz5Cvzat5fpyECnA03hM9lAg2DplglEbQqio2+E72IEcmoXWESMxH4jWqJafPyekaPhOB5Hkwu3tnS5Prkj5xTgqlrv0CxR8FvUzFt9c7STCBZmv7CNf+ketS2YJnT/xGfuL1MeiBomxcKozo/zjvsitK5chjiNrPzfYYjXMd9ja2qDYcjSJIu2lst9T/0cmpYzKVvbrS+zN3AKMK1jB920+7gr+RQvW+Ky71EF07EdQVEB3cX9qVwUEwN5gFxBKPJcQ8+2zLjaH89DjNxk32CG67IM4/ndLSDdsXmh/NgRv7ZJMdM7EN+Cugy3wzqTnGuxTh8sbqtWGtCe9jdxBuOg3817hr+ib6sbngBwbef8cYPLasHsv8WnvBsUBL1fBRUSeaebRZMC9JYom6RyB0cjqxAIN/vRxG9146NBX6SPUDAlIz9BLq+a1kgXJozRja97NRDEL3BWxu7yGCEVyRGY X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn Now that all callers of bio_add_folio() check the return value, mark it as __must_check. Signed-off-by: Johannes Thumshirn --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 99fa832db836..36cfc091caed 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -466,7 +466,7 @@ void bio_reset(struct bio *bio, struct block_device *bdev, blk_opf_t opf); void bio_chain(struct bio *, struct bio *); int __must_check bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); -bool bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); +bool __must_check bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int); int bio_add_zone_append_page(struct bio *bio, struct page *page,