Skip to content

Commit

Permalink
ext4: fix potential htree corruption when growing large_dir directories
Browse files Browse the repository at this point in the history
commit 877ba3f upstream.

Commit b5776e7 ("ext4: fix potential htree index checksum
corruption) removed a required restart when multiple levels of index
nodes need to be split.  Fix this to avoid directory htree corruptions
when using the large_dir feature.

Cc: stable@kernel.org # v5.11
Cc: Благодаренко Артём <artem.blagodarenko@gmail.com>
Fixes: b5776e7 ("ext4: fix potential htree index checksum corruption)
Reported-by: Denis <denis@voxelsoft.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
tytso authored and gregkh committed Aug 12, 2021
1 parent e745e30 commit bc3c6b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/namei.c
Expand Up @@ -2517,7 +2517,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname,
goto journal_error;
err = ext4_handle_dirty_dx_node(handle, dir,
frame->bh);
if (err)
if (restart || err)
goto journal_error;
} else {
struct dx_root *dxroot;
Expand Down

0 comments on commit bc3c6b5

Please sign in to comment.