Message ID | 84973c41d58473dd50324853fb88a7fcff55745b.1680172791.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 81FB5C77B60 for <linux-mm@archiver.kernel.org>; Thu, 30 Mar 2023 10:45:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 244926B007B; Thu, 30 Mar 2023 06:45:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F596280006; Thu, 30 Mar 2023 06:45:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0BCFE280001; Thu, 30 Mar 2023 06:45:03 -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 EFCF86B007B for <linux-mm@kvack.org>; Thu, 30 Mar 2023 06:45:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CCDDC4017F for <linux-mm@kvack.org>; Thu, 30 Mar 2023 10:45:02 +0000 (UTC) X-FDA: 80625232044.11.48C15B3 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf26.hostedemail.com (Postfix) with ESMTP id B7815140013 for <linux-mm@kvack.org>; Thu, 30 Mar 2023 10:45:00 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=oJogWosW; spf=pass (imf26.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173101; 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=2MNTZ8hIqQZr33tFK5vOCN2kPp+OQOLapHSQ9vn8FYg=; b=dPmeno7jlJpFomPgK1c8KxCdZNfj3CduQ0eXx44XK1du9tRaVbVB++cs9/p3D4rn9QEiBh wwoHaXxAG+xNJVSnXn0jIxS3U87D+M8Wz95NA8ysxRukD1vt3o3s2W9ogXDCmrJO8l6KJb PXhZQEF3wXFA3gaOJ2F951B0mIQQjXo= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=oJogWosW; spf=pass (imf26.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173101; a=rsa-sha256; cv=none; b=CDp5mLbbmyL9ov52AgzB+VnAR2DWHa7zFn/7yQsu2SRsogTWb0JIfCqTwTCm+f8+2FaNTH nZ5Nivw3OImRYa7X4OmI3mlbnqTDBA+hH7ytJubIGb8x63mI50BeMIyvcSeiVq9qp2sBjt nMAhKzudurF2dRT08VrC5kSUDYGhesk= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173100; x=1711709100; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AKPcab2XYTxKDTsHjq6NQ76PfpLzQxBfOz0TQbvI9A4=; b=oJogWosWEBa69zWArnhlDaUXfU9FQ9KwxzG1MDZZ1eSPefrvzsA18136 LBmsChvDIRZcuVqhY43A1ybXN4jCk6gvhZ6zPo+kEZD+xBkTsy76HHU9/ BoRz35AudN75aaZxmMKhol3QJVNj+puVjms23s3W/z03DvFawc5yYLbBR p1uqqilbsrbupJ8cnUWefqCWvUA3ES5Agoc36r1mG35tvmwyOIYQRygZ5 R8CnrBcYd6lO3rv+hUvxpPa7nNwxeaOF3L/Zi0nOiskvED+IjbWGVTh+r 72aVTL01tYlkX00M0gYALm/MQLTtqrTv7uXuariA/xCBUyLrIk4JiV6hs Q==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231854011" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 18:44:59 +0800 IronPort-SDR: wp8s06sFAPxQScH88C+b4FfJEB5V6Ibs/Sd5WpRqj+f8fxzHmX86fDBBTt/wJYmWScXkWUr2mT /l0mwb6XiniRe+b8B10/qDls+QpErSHRZm5btwmkkG4RgAVPCspE3atVbRsWOWMxCExdUZTUDF Dt8YRcRgElXptTaNphNLo4rzB8KH2hsMYd5LyUL7nuLov43vhdynZXPA1nS1Jvw5108uiFKq79 lLB54W4M5vUkFX2uh76URHgPdTcbB1D1AfOucjviiPUW+7AwOQpTK6LRtX6eUL7St3HE7cbfLm xI0= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:26 -0700 IronPort-SDR: Uz7s+Dcx6yIQkvOUQB+fZBcewu2LBoSQ3pKR+yorfvauRCwyEfsemTaCli7NU9SOzvmIsB3Hts tNYBtX+nfuDEC5uXsXRcTKBMvdR7SGstEuCQUjhfSDF+BiYqMb/6WvHW+SrRgnWUnB48Q4E2C4 fbh8vMwc892YV531EYcZRUKNAzwNrgHgza3EAt8v4dtp8X3HEbGwrP9VyDAFzQUEaHs+TfI18c xIpJgsXVErH/79qMVG8Ygjlt4VP7eLqwzcPd+tJBQVyBPVtGsmWswAn0jdBYeDXDy1fyvy4CzS HRA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:57 -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>, David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org, Johannes Thumshirn <johannes.thumshirn@wdc.com>, Damien Le Moal <damien.lemoal@opensource.wdc.com> Subject: [PATCH v2 18/19] dm-crypt: check if adding pages to clone bio fails Date: Thu, 30 Mar 2023 03:44:00 -0700 Message-Id: <84973c41d58473dd50324853fb88a7fcff55745b.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <cover.1680172791.git.johannes.thumshirn@wdc.com> References: <cover.1680172791.git.johannes.thumshirn@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B7815140013 X-Stat-Signature: pjkoxzquaisdpxgt57jqnoexw1rm8u54 X-HE-Tag: 1680173100-18195 X-HE-Meta: U2FsdGVkX1/U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/YLc5HifrSv5320QH4U0Me+qohLRlBs1MqsURovQ918d+bk/l22yv4zPH3V9gnL/hiBzy+kvn1ootSQZ0zcBb762Sv+HGHvHYcSVZlpOIfZJx47E7xVMcF1pD6CM8efFLiJoD6EJ+pH4VSzPUAjqWa2YWnXzo3UQFOUXxQ0/JzlGOUuokYTLjEnbfjHC/wYD2GBrs04ngnKue67tjRZpeb9OfgoYlRJ3BCwf3gi9vuiRq8kcjD2GlR1ofe2b6u+4vJXZK/WZXoRuxMN0OssnyIoA== 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
|
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; }