Skip to content

Commit

Permalink
ext4: clear the verified flag of the modified leaf or idx if error
Browse files Browse the repository at this point in the history
Clear the verified flag from the modified bh when failed in ext4_ext_rm_idx
or ext4_ext_correct_indexes.
In this way, the start value of the logical block itself and its
parents' will be checked in ext4_valid_extent_entries.

Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com>
  • Loading branch information
zhanchengbin authored and intel-lab-lkp committed Feb 13, 2023
1 parent 6440a9e commit c6de5d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/ext4/extents.c
Expand Up @@ -1756,6 +1756,8 @@ static int ext4_ext_correct_indexes(handle_t *handle, struct inode *inode,
if (err)
break;
}
while (!(k < 0) && k++ < depth)
clear_buffer_verified(path[k]->p_bh);

return err;
}
Expand Down Expand Up @@ -2304,6 +2306,7 @@ static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode,
{
int err;
ext4_fsblk_t leaf;
int b_depth = depth;

/* free index block */
depth--;
Expand Down Expand Up @@ -2345,6 +2348,9 @@ static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode,
if (err)
break;
}
while (!(depth < 0) && depth++ < b_depth - 1)
clear_buffer_verified(path[depth]->p_bh);

return err;
}

Expand Down

0 comments on commit c6de5d6

Please sign in to comment.