Skip to content

Commit 8d714f8

Browse files
author
Jaegeuk Kim
committed
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: Jaegeuk Kim <[email protected]>
1 parent 66110ab commit 8d714f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/f2fs/node.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,10 @@ int f2fs_remove_inode_page(struct inode *inode)
10751075
f2fs_truncate_data_blocks_range(&dn, 1);
10761076

10771077
/* 0 is possible, after f2fs_new_inode() has failed */
1078+
if (unlikely(f2fs_cp_error(F2FS_I_SB(inode)))) {
1079+
f2fs_put_dnode(&dn);
1080+
return -EIO;
1081+
}
10781082
f2fs_bug_on(F2FS_I_SB(inode),
10791083
inode->i_blocks != 0 && inode->i_blocks != 8);
10801084

0 commit comments

Comments
 (0)