Hello Teodore, Your one-line fix looks good. I have tested it. 1560000 names created successfully. But the patch with refactoring doesn’t work. I got this messages 1480000 names created 1520000 names created ln: failed to access 'n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001520519': Bad message ln: failed to access 'n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001520520': Bad message [ 7699.212018] EXT4-fs error (device loop0): dx_probe:887: inode #2: block 144843: comm ln: Directory index failed checksum [ 7699.216001] EXT4-fs error (device loop0): dx_probe:887: inode #2: block 144843: comm ln: Directory index failed checksum I have no objections to send your one-line fix, but we need to double check refactoring. Best regards, Artem Blagodarenko > On 4 Aug 2021, at 22:25, Theodore Ts'o <tytso@xxxxxxx> wrote: > > On Thu, Jul 29, 2021 at 10:23:35PM +0300, Благодаренко Артём wrote: >> Hello, >> >> It looks like the fix b5776e7524afbd4569978ff790864755c438bba7 "ext4: fix potential htree index checksum corruption” introduced this regression. >> I reverted it and my test from previous message passed the dangerous level of 1570000 names count. >> Now test is still in progress. 2520000 names are already created. >> >> I am searching the way to fix this. >> >> Best regards, >> Artem Blagodarenko. > > Hi Artem, did you have a chance to take a look at some of the possible > fixes which I floated on this thread? > > Do you have any objections if I take this and send it to Linus? > > Thanks, > > - Ted > > From fa8db30806b4e83981c65f18f98de33f804012d9 Mon Sep 17 00:00:00 2001 > From: Theodore Ts'o <tytso@xxxxxxx> > Date: Wed, 4 Aug 2021 14:23:55 -0400 > Subject: [PATCH] ext4: fix potential htree correuption when growing large_dir > directories > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > 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@xxxxxxxxxx # v5.11 > Cc: Благодаренко Артём <artem.blagodarenko@xxxxxxxxx> > Fixes: b5776e7524af ("ext4: fix potential htree index checksum corruption) > Reported-by: Denis <denis@xxxxxxxxxxxxx> > Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> > --- > fs/ext4/namei.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c > index 5fd56f616cf0..f3bbcd4efb56 100644 > --- a/fs/ext4/namei.c > +++ b/fs/ext4/namei.c > @@ -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; > -- > 2.31.0 >