diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index cffcfa8d25711ad6894300e94c1617f615424067..72fc866cad1955a3391d4baab6904da768cb22a3 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2203,8 +2203,12 @@ int f2fs_migrate_page(struct address_space *mapping, BUG_ON(PageWriteback(page)); /* migrating an atomic written page is safe with the inmem_lock hold */ - if (atomic_written && !mutex_trylock(&fi->inmem_lock)) - return -EAGAIN; + if (atomic_written) { + if (mode != MIGRATE_SYNC) + return -EBUSY; + if (!mutex_trylock(&fi->inmem_lock)) + return -EAGAIN; + } /* * A reference is expected if PagePrivate set when move mapping,