diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-09-09 16:59:39 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-09-13 13:02:29 -0700 |
commit | e8ea9b3d7e278d2ef4b60e703f780ceee70cb331 (patch) | |
tree | 2ec0fd1ad038bb20032706ed8bc66552d5df9fdb /fs/f2fs/inode.c | |
parent | f4702d61eb53466251eeb677f9784e047e1caf0c (diff) | |
download | op-kernel-dev-e8ea9b3d7e278d2ef4b60e703f780ceee70cb331.zip op-kernel-dev-e8ea9b3d7e278d2ef4b60e703f780ceee70cb331.tar.gz |
f2fs: avoid ENOMEM during roll-forward recovery
This patch gives another chances during roll-forward recovery regarding to
-ENOMEM.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inode.c')
-rw-r--r-- | fs/f2fs/inode.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 9ac5efc..ac4daa5 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -11,6 +11,7 @@ #include <linux/fs.h> #include <linux/f2fs_fs.h> #include <linux/buffer_head.h> +#include <linux/backing-dev.h> #include <linux/writeback.h> #include "f2fs.h" @@ -234,6 +235,20 @@ bad_inode: return ERR_PTR(ret); } +struct inode *f2fs_iget_retry(struct super_block *sb, unsigned long ino) +{ + struct inode *inode; +retry: + inode = f2fs_iget(sb, ino); + if (IS_ERR(inode)) { + if (PTR_ERR(inode) == -ENOMEM) { + congestion_wait(BLK_RW_ASYNC, HZ/50); + goto retry; + } + } + return inode; +} + int update_inode(struct inode *inode, struct page *node_page) { struct f2fs_inode *ri; |