mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 01:08:50 +00:00
f2fs: do not recover wrong data index
During the roll-forward recovery, if we found a new data index written fsync lastly, we need to recover new block address. But, if that address was corrupted, we should not recover that. Otherwise, f2fs gets kernel panic from: In check_index_in_prev_nodes(), sentry = get_seg_entry(sbi, segno); --------------------------> out-of-range segno. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
418f6c2770
commit
e03b07d908
@ -395,7 +395,9 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
|
||||
src = datablock_addr(dn.node_page, dn.ofs_in_node);
|
||||
dest = datablock_addr(page, dn.ofs_in_node);
|
||||
|
||||
if (src != dest && dest != NEW_ADDR && dest != NULL_ADDR) {
|
||||
if (src != dest && dest != NEW_ADDR && dest != NULL_ADDR &&
|
||||
dest >= MAIN_BLKADDR(sbi) && dest < MAX_BLKADDR(sbi)) {
|
||||
|
||||
if (src == NULL_ADDR) {
|
||||
err = reserve_new_block(&dn);
|
||||
/* We should not get -ENOSPC */
|
||||
|
Loading…
x
Reference in New Issue
Block a user