Commit 877ba3f7 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: fix potential htree corruption when growing large_dir directories

Commit b5776e75 ("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: b5776e75 ("ext4: fix potential htree index checksum corruption)
Reported-by: default avatarDenis <denis@voxelsoft.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 73dc7071
......@@ -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;
......
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