summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-07-19 19:59:55 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2017-07-29 02:49:00 +0200
commit640cc18982b1c2049ac3a7223444248aea7d51b4 (patch)
treec1ba7c16819a2038d406bcaf5dd17060e9b6873b /fs/f2fs/segment.c
parentf2fs: preserve i_mode if __f2fs_set_acl() fails (diff)
downloadlinux-640cc18982b1c2049ac3a7223444248aea7d51b4.tar.xz
linux-640cc18982b1c2049ac3a7223444248aea7d51b4.zip
f2fs: give a try to do atomic write in -ENOMEM case
It'd be better to retry writing atomic pages when we get -ENOMEM. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r--fs/f2fs/segment.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index f964b68718c1..f5d139f897dc 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -309,17 +309,21 @@ static int __commit_inmem_pages(struct inode *inode,
inode_dec_dirty_pages(inode);
remove_dirty_inode(inode);
}
-
+retry:
fio.page = page;
fio.old_blkaddr = NULL_ADDR;
fio.encrypted_page = NULL;
fio.need_lock = LOCK_DONE;
err = do_write_data_page(&fio);
if (err) {
+ if (err == -ENOMEM) {
+ congestion_wait(BLK_RW_ASYNC, HZ/50);
+ cond_resched();
+ goto retry;
+ }
unlock_page(page);
break;
}
-
/* record old blkaddr for revoking */
cur->old_addr = fio.old_blkaddr;
last_idx = page->index;