|
@@ -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;
|