aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Adam Davis <[email protected]>2024-07-01 22:25:03 +0800
committerTheodore Ts'o <[email protected]>2024-08-26 21:20:48 -0400
commit1a00a393d6a7fb1e745a41edd09019bd6a0ad64c (patch)
tree54d97f0c1486163f361db5ae04ce5e901a06a8a2
parent70dd7b573afeba9b8f8a33f2ae1e4a9a2ec8c1ec (diff)
ext4: no need to continue when the number of entries is 1
Fixes: ac27a0ec112a ("[PATCH] ext4: initial copy of files from ext3") Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=ae688d469e36fb5138d0 Signed-off-by: Edward Adam Davis <[email protected]> Reported-and-tested-by: [email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]> Cc: [email protected]
-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 6a95713f9193..1de1c1b460a7 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1999,7 +1999,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
split = count/2;
hash2 = map[split].hash;
- continued = hash2 == map[split - 1].hash;
+ continued = split > 0 ? hash2 == map[split - 1].hash : 0;
dxtrace(printk(KERN_INFO "Split block %lu at %x, %i/%i\n",
(unsigned long)dx_get_block(frame->at),
hash2, split, count-split));