Message ID | 20240206112134.1479464-12-wangkefeng.wang@huawei.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 6FA66C48297 for <linux-mm@archiver.kernel.org>; Tue, 6 Feb 2024 11:22:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4ED26B009B; Tue, 6 Feb 2024 06:21:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B9BDC6B0098; Tue, 6 Feb 2024 06:21:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88FA76B009E; Tue, 6 Feb 2024 06:21:56 -0500 (EST) 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 60A356B0098 for <linux-mm@kvack.org>; Tue, 6 Feb 2024 06:21:56 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3ED2AA1CCD for <linux-mm@kvack.org>; Tue, 6 Feb 2024 11:21:56 +0000 (UTC) X-FDA: 81761139432.20.849E5D7 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf01.hostedemail.com (Postfix) with ESMTP id 036A940016; Tue, 6 Feb 2024 11:21:52 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.35 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707218514; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=muKRg/OgrGzpPzJhCqxjfJuUwZdPgx5gbEV5Frn9YCU=; b=sze/mYBIObKiUGgUFSZkE7s/bJu0mS4Gjf5kN1HJzkiylGLFAGgkK/yG5gTlKYvRpIpHfr pI+St6EJ7Jgq81IdEnW1iQ3G3pZvSNNnQK9OV3n6fd/EZkiDDI1WUUZxWvhN0mUN6eyQey xIh7wYbw7Fyfv+4Vhb5o+W+FbIIL0HA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.35 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707218514; a=rsa-sha256; cv=none; b=sedgBxEjmFXXUvsBfwpMIGEiQTf7u/J7VaDOXMH0janP4+LsPw/+c3VR4JYg9svBdwQz+h T7U+spB8rfJjgjaKwBGIG3KRCe8zwSVZYQC0XuM9p0qK/yR/CdXEZNQxGuBSztAY+MP+B8 bYOlZ4RPdFQtZfT8PtMjY9zRj2CG3Dw= Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4TTgkx3LWHz1Q8qj; Tue, 6 Feb 2024 19:19:53 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 8A3ED140412; Tue, 6 Feb 2024 19:21:49 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 6 Feb 2024 19:21:48 +0800 From: Kefeng Wang <wangkefeng.wang@huawei.com> To: Andrew Morton <akpm@linux-foundation.org>, <linux-mm@kvack.org> CC: Tony Luck <tony.luck@intel.com>, Naoya Horiguchi <naoya.horiguchi@nec.com>, Miaohe Lin <linmiaohe@huawei.com>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, Muchun Song <muchun.song@linux.dev>, Benjamin LaHaise <bcrl@kvack.org>, <jglisse@redhat.com>, <linux-aio@kvack.org>, <linux-fsdevel@vger.kernel.org>, Kefeng Wang <wangkefeng.wang@huawei.com> Subject: [PATCH rfcv2 11/11] fs: aio: add explicit check for large folio in aio_migrate_folio() Date: Tue, 6 Feb 2024 19:21:34 +0800 Message-ID: <20240206112134.1479464-12-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240206112134.1479464-1-wangkefeng.wang@huawei.com> References: <20240206112134.1479464-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100001.china.huawei.com (7.185.36.93) X-Rspam-User: X-Stat-Signature: iedd77s6ds7ykx9h1okbqbci63dqcua5 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 036A940016 X-HE-Tag: 1707218512-216664 X-HE-Meta: U2FsdGVkX19u8wdnxGwZQXrPUC6CUomWQsRqsIMf7UoBJFuiNGYEk2qLivA0SsWyjS3+4iTINASlVup8wgOuJWrKmQGgDcbe1SKBZXxkkg8H7/BdRK9vT+z51QjZRhUyLMS9QMH8TpoLnVORUgZu84TAXUqQdRFN65yhbEGOwZV9fx08jij0xrqjdNuwTdCizjm/DEIjckc+pGipKb7T5mAOsEeIYgTAfl2slEjZFA2L8iknNRxh09A4OmnIpBvASaWBxgdtyPsJqi7vEImuI+qCiyG8/jFMQQJomdWlg0Oy3XDHVS41e+a3CB4j/VHzIWlEnMQqNJRiWHn+D8c+s4OoqfVWrmEcRvoYyXovvm263XHEqdtHOSehwYCvf+r07GprUbhxxXTjnWd4qGcGxAXX1OAjb23W1MPnmHS8NachOnMaSbWA/M/Jnbk23q5SEdR35Ypu6OzhZhNYNzkVsaOxjvcSZaYutnzFCWjl9bs7drHKNWAXRBSHeeaAaRNQLkMU3YcPJ4XkVI/cJRupTq2efiOV0Cf6D71H0AT4B1pajNC6UWkmv0MANHsbQ8boyM8VdKCPmRBlAYvEbEHNj5Nd4lVKTB22uFixDZhFAL7wdPJ3Z2gf6Oc2S5VzZB112MD4FqBRQnhM1pnMkplkg0DxY/eWoturzG7XZNKrKyvLJu8KOz5C/46xdG+20NB6D2nESltEjVtmDhuBVTExMa4A/0yWSKu9/eZe1AxXXGZ+zsPBnGCU0Yx7cjtJQ5PXpJxBays6OoOzWj3T4ugBclfvsmK++K6fu26BydgrkIhZlQH+2/Ofjqb+zBiKO1Epe5i7k8/BcXm+7ytFfanuWz73WvXJAEORpAXTNmlGg3p5CZXNnL5g8tqQfAj5P054BmfNITBVFRRR6gKmXGhneDP/obsAvFQ777xobV8C2kxLTtn5kLBjlCgrjpgl93nZ5FxsniF4zduKOzA8cez MyUXrsYX JBDbm7EVO3mjmDmhsrJaRkTFU4wSghMLKg44CH8me+XSV7GvbVHSM/uCzYRLA5phn6uX7K6tW4IqJ9eEdpcFNbLNpNEm558xaQdrABXNaf0GOfpxV5rw0wWlK+UiW3X6STevuaMV62V+0JCSeLHAtEpF0E7mLJg8qVLRiNluwMn3ULLU2ZgUlQXvVjpGIeEOAeEYM 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> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: migrate: support poison recover from migrate folio
|
expand
|
diff --git a/fs/aio.c b/fs/aio.c index 631e83eee5a1..372f22b85b11 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -411,6 +411,10 @@ static int aio_migrate_folio(struct address_space *mapping, struct folio *dst, pgoff_t idx; int rc = 0; + /* Large folios aren't supported */ + if (folio_test_large(src)) + return -EINVAL; + /* mapping->i_private_lock here protects against the kioctx teardown. */ spin_lock(&mapping->i_private_lock); ctx = mapping->i_private_data;
Since large folio copy could spend lots of time and it is involved with a cond_resched(), the aio couldn't support migrate large folio as it takes a spin lock when folio copy, add explicit check for large folio and return err directly. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- fs/aio.c | 4 ++++ 1 file changed, 4 insertions(+)