Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 9d4b2e4

Browse files
ea1davisgregkh
authored andcommitted
ext4: no need to continue when the number of entries is 1
commit 1a00a39 upstream. Fixes: ac27a0e ("[PATCH] ext4: initial copy of files from ext3") Reported-by: syzbot+ae688d469e36fb5138d0@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=ae688d469e36fb5138d0 Signed-off-by: Edward Adam Davis <eadavis@qq.com> Reported-and-tested-by: syzbot+ae688d469e36fb5138d0@syzkaller.appspotmail.com Link: https://patch.msgid.link/tencent_BE7AEE6C7C2D216CB8949CE8E6EE7ECC2C0A@qq.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 20e7d96 commit 9d4b2e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/namei.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
20012001
split = count/2;
20022002

20032003
hash2 = map[split].hash;
2004-
continued = hash2 == map[split - 1].hash;
2004+
continued = split > 0 ? hash2 == map[split - 1].hash : 0;
20052005
dxtrace(printk(KERN_INFO "Split block %lu at %x, %i/%i\n",
20062006
(unsigned long)dx_get_block(frame->at),
20072007
hash2, split, count-split));

0 commit comments

Comments
 (0)