ext4: fix potential htree corruption when growing large_dir directories
authorTheodore Ts'o <tytso@mit.edu>
Wed, 4 Aug 2021 18:23:55 +0000 (14:23 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 6 Aug 2021 17:00:49 +0000 (13:00 -0400)
Commit b5776e7524af ("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: b5776e7524af ("ext4: fix potential htree index checksum corruption)
Reported-by: Denis <denis@voxelsoft.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/namei.c

index 5fd56f616cf0b6be7c83f1afdc99b86cfa4f46e6..f3bbcd4efb565a69602b7bba41522267faccc3cc 100644 (file)
@@ -2517,7 +2517,7 @@ again:
                                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;