diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-08-08 19:09:08 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-08-21 15:55:04 -0700 |
commit | 7f2b4e8ea5b49846f7d20f1694dbca81f88b8d50 (patch) | |
tree | a25953ba8c96fcf5c728dcb22fd85b05bdf978d0 /fs | |
parent | afd2b4da40b3b567ef8d8e6881479345a2312a03 (diff) | |
download | linux-stable-7f2b4e8ea5b49846f7d20f1694dbca81f88b8d50.tar.gz linux-stable-7f2b4e8ea5b49846f7d20f1694dbca81f88b8d50.tar.bz2 linux-stable-7f2b4e8ea5b49846f7d20f1694dbca81f88b8d50.zip |
f2fs: retry to revoke atomic commit in -ENOMEM case
During atomic committing, if we encounter -ENOMEM in revoke path, it's
better to give a chance to retry revoking.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/segment.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 95267630c8c4..05144b3a7f62 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -213,9 +213,15 @@ static int __revoke_inmem_pages(struct inode *inode, struct node_info ni; trace_f2fs_commit_inmem_page(page, INMEM_REVOKE); - +retry: set_new_dnode(&dn, inode, NULL, NULL, 0); - if (get_dnode_of_data(&dn, page->index, LOOKUP_NODE)) { + err = get_dnode_of_data(&dn, page->index, LOOKUP_NODE); + if (err) { + if (err == -ENOMEM) { + congestion_wait(BLK_RW_ASYNC, HZ/50); + cond_resched(); + goto retry; + } err = -EAGAIN; goto next; } |