Skip to content

Commit ff1048e

Browse files
author
Jaegeuk Kim
committed
f2fs: relax migratepage for atomic written page
In order to avoid lock contention for atomic written pages, we'd better give EBUSY in f2fs_migrate_page when mode is asynchronous. We expect it will be released soon as transaction commits. Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 000519f commit ff1048e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/f2fs/data.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,8 +2203,12 @@ int f2fs_migrate_page(struct address_space *mapping,
22032203
BUG_ON(PageWriteback(page));
22042204

22052205
/* migrating an atomic written page is safe with the inmem_lock hold */
2206-
if (atomic_written && !mutex_trylock(&fi->inmem_lock))
2207-
return -EAGAIN;
2206+
if (atomic_written) {
2207+
if (mode != MIGRATE_SYNC)
2208+
return -EBUSY;
2209+
if (!mutex_trylock(&fi->inmem_lock))
2210+
return -EAGAIN;
2211+
}
22082212

22092213
/*
22102214
* A reference is expected if PagePrivate set when move mapping,

0 commit comments

Comments
 (0)