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@xxxxxxxxxx> --- fs/aio.c | 4 ++++ 1 file changed, 4 insertions(+) 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 folio 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; -- 2.27.0