From: Theodore Ts'o Date: Wed, 4 Aug 2021 18:23:55 +0000 (-0400) Subject: ext4: fix potential htree corruption when growing large_dir directories X-Git-Tag: v5.10.58~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc7300776808de742101b64d84c6445e98ec72fb;p=thirdparty%2Fkernel%2Fstable.git ext4: fix potential htree corruption when growing large_dir directories commit 877ba3f729fd3d8ef0e29bc2a55e57cfa54b2e43 upstream. 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: Благодаренко Артём Fixes: b5776e7524af ("ext4: fix potential htree index checksum corruption) Reported-by: Denis Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index ab7baf5299176..f71de6c1ecf40 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2412,7 +2412,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;