Commit 8d714f8a authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: avoid f2fs_bug_on() in cp_error case

There is a subtle race condition to invoke f2fs_bug_on() in shutdown tests. I've
confirmed that the last checkpoint is preserved in consistent state, so it'd be
fine to just return error at this moment.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 66110abc
...@@ -1075,6 +1075,10 @@ int f2fs_remove_inode_page(struct inode *inode) ...@@ -1075,6 +1075,10 @@ int f2fs_remove_inode_page(struct inode *inode)
f2fs_truncate_data_blocks_range(&dn, 1); f2fs_truncate_data_blocks_range(&dn, 1);
/* 0 is possible, after f2fs_new_inode() has failed */ /* 0 is possible, after f2fs_new_inode() has failed */
if (unlikely(f2fs_cp_error(F2FS_I_SB(inode)))) {
f2fs_put_dnode(&dn);
return -EIO;
}
f2fs_bug_on(F2FS_I_SB(inode), f2fs_bug_on(F2FS_I_SB(inode),
inode->i_blocks != 0 && inode->i_blocks != 8); inode->i_blocks != 0 && inode->i_blocks != 8);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment