diff options
-rw-r--r-- | fs/f2fs/data.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8c61fa7fd27d..5f3bc98a387d 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1759,7 +1759,12 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping, goto fail; } repeat: - page = grab_cache_page_write_begin(mapping, index, flags); + /* + * Do not use grab_cache_page_write_begin() to avoid deadlock due to + * wait_for_stable_page. Will wait that below with our IO control. + */ + page = pagecache_get_page(mapping, index, + FGP_LOCK | FGP_WRITE | FGP_CREAT, GFP_NOFS); if (!page) { err = -ENOMEM; goto fail; |