diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-03 09:22:18 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-07 10:32:26 -0700 |
commit | 4c0c294934b055aca765737c3b06698f51e9124d (patch) | |
tree | 34cdeb0baaeb902be6f1dce901e9941cd8b17227 /fs/f2fs/inode.c | |
parent | 74ef924167ad9d2897ffc0ef83c7ebf322fcc535 (diff) | |
download | linux-4c0c294934b055aca765737c3b06698f51e9124d.tar.gz linux-4c0c294934b055aca765737c3b06698f51e9124d.tar.bz2 linux-4c0c294934b055aca765737c3b06698f51e9124d.zip |
f2fs: retry to truncate blocks in -ENOMEM case
This patch modifies to retry truncating node blocks in -ENOMEM case.
Signed-off-by: Hou Pengyang <houpengyang@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inode.c')
-rw-r--r-- | fs/f2fs/inode.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index f4ac8512b7ba..baf3a2a1f249 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -344,7 +344,7 @@ void f2fs_evict_inode(struct inode *inode) sb_start_intwrite(inode->i_sb); set_inode_flag(fi, FI_NO_ALLOC); i_size_write(inode, 0); - +retry: if (F2FS_HAS_BLOCKS(inode)) err = f2fs_truncate(inode, true); @@ -354,6 +354,12 @@ void f2fs_evict_inode(struct inode *inode) f2fs_unlock_op(sbi); } + /* give more chances, if ENOMEM case */ + if (err == -ENOMEM) { + err = 0; + goto retry; + } + sb_end_intwrite(inode->i_sb); no_delete: stat_dec_inline_xattr(inode); |