Message ID | 20230420100501.32981-19-jth@kernel.org (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 CE687C77B72 for <linux-mm@archiver.kernel.org>; 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 <linux-mm@kvack.org>; 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 <linux-mm@kvack.org>; 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 <linux-mm@kvack.org>; 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 <linux-mm@kvack.org>; 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 <jth@kernel.org> 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 <damien.lemoal@opensource.wdc.com> 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 Content-Transfer-Encoding: 8bit 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: <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; }