mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 04:50:53 +07:00
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>
This commit is contained in:
parent
74ef924167
commit
4c0c294934
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user