summaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2021-08-04 14:23:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-12 13:22:14 +0200
commitcc7300776808de742101b64d84c6445e98ec72fb (patch)
tree1b85cff658bc3ef8d57a2e654447f289e979d2c6 /fs/ext4/namei.c
parent6b5a3d2c2b89de999eaed8f81f54181734375966 (diff)
downloadlinux-stable-cc7300776808de742101b64d84c6445e98ec72fb.tar.gz
linux-stable-cc7300776808de742101b64d84c6445e98ec72fb.tar.bz2
linux-stable-cc7300776808de742101b64d84c6445e98ec72fb.zip
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: Благодаренко Артём <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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index ab7baf529917..f71de6c1ecf4 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;