Message ID | 924dff4077812804398ef84128fb920507fa4be1.1685532726.git.johannes.thumshirn@wdc.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FF23C77B7C for <linux-mm@archiver.kernel.org>; Wed, 31 May 2023 11:51:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED44E6B0092; Wed, 31 May 2023 07:51:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5CAF6B009A; Wed, 31 May 2023 07:51:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB0416B009C; Wed, 31 May 2023 07:51:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 96C406B0092 for <linux-mm@kvack.org>; Wed, 31 May 2023 07:51:50 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6CBEAA030E for <linux-mm@kvack.org>; Wed, 31 May 2023 11:51:50 +0000 (UTC) X-FDA: 80850385980.10.F5A8E34 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf21.hostedemail.com (Postfix) with ESMTP id 540781C0017 for <linux-mm@kvack.org>; Wed, 31 May 2023 11:51:48 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=FO1e3sfq; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf21.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533908; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=JV+QfbhswWYe7PfMrv2Yu8Kn7ZidQZ3SJddP0Uv61YU=; b=XKwPiD3k4vK9bFsjSVyK+d+9+th4JNcQS69gLMCMDwjH4Pucm3LmshrmqKyfYzGNhyEQMd SAzDUIhRLYH42x0Ztu8s4csjmfF3i6QbC9/gKwPl7hdnGslnOJbSzkG6WNsy1KvWorBUNb XOrvR/zeuTKhjWxaMvT9bkZhHuf+gFE= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=FO1e3sfq; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf21.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.153.144 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533908; a=rsa-sha256; cv=none; b=vqfxHDT7iBKnSeJPhKJJUr+7KmbfAp9L3Id4H7xPi5sAdeHA/iQWvNKvxTu2bUAFkuxrcI Wg5P+tb96DEGZ+WG0SqPz1zpoPs2SF8SKGpAaIpPQChGycy+HG7OuW6Nt/o7pS79VrLM/B KOhcKQ5zNThcL7Um2LXjk1zbbCk0tNQ= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533908; x=1717069908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cYPPoEv62NQazrvih94Ycv2rGmT7BOuXvS8lrmnDxSU=; b=FO1e3sfqGO7HWb3HsnqJDua7s2dUjvkEqLT5l8M4L7r5hcbMo1Ts4pGx 9UN2Tm0A9JRBHKVXOs+bAHKqV/Hvn//SqYA9zTnI1wsxNORbSXQDaZjZ9 lDpnBCEWaPv5yd6GFM+I30rfvmY64ejkdfYicEG1Wxo0w3/e2xkq0q3X1 lpYvF/LC9HqwgAaCaN8K+l85j9W0HzrOwS1Q8poXyP13Km88VoXVosbUe FsSZj9v/SRm4WVlqWv3Mr34Z/1saQcYVZNGdgWDVOSiLthiyTl3s6/qxv fu31no2qNwuN36+CjjP73OfdLUnSozbekapRsKVo68Im8DJF6R68zF1Ik w==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="231985157" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 May 2023 19:51:47 +0800 IronPort-SDR: t0a6cFvmGv3apKDls7m6vH1ogMVEaziCB9jCzduvzHd5AffXqqssisKaZ5gA+AeqbvZLKieZPJ N5KcGG2IuvpFcmQKaAxFnrDQriMp8QfYX/Uti6W9Bip81n06rg9X+Pt+unFexmoVopMf/WxZkz GcbGd8a6L0/5ZWDTch1/hLbuI6bXUv++5SY+oCpW4Nbmkj0agDGcVYHKW+7hmDFgPYyFaL/k2e zhEIutOaxopNsTOHS1Gu82ezrkgnwZBgmb3RU3t6IScyvqzwRcD8XOB+DhHifAZFuvR3S0QAd0 X6c= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:06:39 -0700 IronPort-SDR: QS61h54T8yZW50RLo6/tAmhIU9dZKUSaD+j7SLLE6DJcuENXB0nA81DplHQBb61D4xQN5z6YYg lyD4dagzoF40PNFlLjzTZJ0Zg7tFZiGl11uz4H1TbZVmBSoN2y+wo62ttaYHvL6KiHjLe0+6zm FGyHqtygisbhzUI8rq/fYFXGU3w82UmCTVNSYk+2JCVsdH8VqjYSAJfn3rSnoQGKjalA3DHPXh ec/1PSkgm/XAUuzf+dnf+/NfDPsket5c3ZH5oLqRyfJ8DIpHZ5kI0+L0iQDvqE4e97x4r0cURX AEA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:51:44 -0700 From: Johannes Thumshirn <johannes.thumshirn@wdc.com> To: Jens Axboe <axboe@kernel.dk> Cc: Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>, Chaitanya Kulkarni <kch@nvidia.com>, Damien Le Moal <damien.lemoal@wdc.com>, Ming Lei <ming.lei@redhat.com>, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu <song@kernel.org>, linux-raid@vger.kernel.org, Mike Snitzer <snitzer@kernel.org>, Matthew Wilcox <willy@infradead.org>, Dave Kleikamp <shaggy@kernel.org>, jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson <rpeterso@redhat.com>, Andreas Gruenbacher <agruenba@redhat.com>, Mikulas Patocka <mpatocka@redhat.com>, gouha7@uniontech.com, Johannes Thumshirn <johannes.thumshirn@wdc.com> Subject: [PATCH v7 18/20] block: add bio_add_folio_nofail Date: Wed, 31 May 2023 04:50:41 -0700 Message-Id: <924dff4077812804398ef84128fb920507fa4be1.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <cover.1685532726.git.johannes.thumshirn@wdc.com> References: <cover.1685532726.git.johannes.thumshirn@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 540781C0017 X-Stat-Signature: owt9ahcbdqrtf7r8tmpz79wnun9nd6je X-HE-Tag: 1685533908-784506 X-HE-Meta: U2FsdGVkX1/AjJY1WufFbr905US6Y1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8nSVHCKYqKP4gJsNXCrnYIuVUml+64+yZjJUJJAPpVOuzbUZX4jeYWKPcemB718xOb3oJK4PSPYCdfUULMVeiWRMBQU6OOGeZy1ZsAp9ZQ+aeL+2n+Rd0NMUrJ+X4akgtr3CPeRUFslucoSBnK6i7dRbmRsL0ZE0nsLI/myccaWpAAq9U3sEx1iioOVPX6pQ+/72tEe15TcKxvGjrvWeFNt/5DcrLozgNgBqd2MnHFzgWcxxdculYbcFIclZOboWanObB3ywy2py6dHRtZ+awNQplagpwgg3rUWHf3gBwHKh4wqcpr6Bbh3VL2uGxwO/zYi+R6xNU+/j+2e/om/YxKdIWdDMQ7wyUhc= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
bio: check return values of bio_add_page
|
expand
|
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/block/bio.c b/block/bio.c index 043944fd46eb..07bc5139f9db 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1138,6 +1138,14 @@ int bio_add_page(struct bio *bio, struct page *page, } EXPORT_SYMBOL(bio_add_page); +void bio_add_folio_nofail(struct bio *bio, struct folio *folio, size_t len, + size_t off) +{ + WARN_ON_ONCE(len > UINT_MAX); + WARN_ON_ONCE(off > UINT_MAX); + __bio_add_page(bio, &folio->page, len, off); +} + /** * bio_add_folio - Attempt to add part of a folio to a bio. * @bio: BIO to add to. diff --git a/include/linux/bio.h b/include/linux/bio.h index ea2d937d3cba..f907d75af205 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -474,6 +474,8 @@ int bio_add_zone_append_page(struct bio *bio, struct page *page, unsigned int len, unsigned int offset); void __bio_add_page(struct bio *bio, struct page *page, unsigned int len, unsigned int off); +void bio_add_folio_nofail(struct bio *bio, struct folio *folio, size_t len, + size_t off); int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter); void bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter); void __bio_release_pages(struct bio *bio, bool mark_dirty);