From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+ae688d469e36fb5138d0@syzkaller.appspotmail.com
Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
tytso@mit.edu
Subject: [PATCH] ext4: No need to continue when the number of entries is 1
Date: Mon, 1 Jul 2024 22:25:03 +0800 [thread overview]
Message-ID: <tencent_BE7AEE6C7C2D216CB8949CE8E6EE7ECC2C0A@qq.com> (raw)
In-Reply-To: <00000000000075a135061c0480d0@google.com>
When the number of entries mapped is 1, there is no need to split it.
Fixes: ac27a0ec112a ("[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>
---
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 a630b27a4cc6..0a111274dc4a 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2043,7 +2043,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));
--
2.43.0
next prev parent reply other threads:[~2024-07-01 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-29 10:05 [syzbot] [ext4?] BUG: unable to handle kernel paging request in do_split syzbot
2024-06-30 9:09 ` Edward Adam Davis
2024-06-30 9:33 ` syzbot
2024-07-01 14:25 ` Edward Adam Davis [this message]
2024-08-22 15:00 ` [PATCH] ext4: No need to continue when the number of entries is 1 Theodore Ts'o
2024-08-23 2:22 ` Baokun Li
2024-08-23 16:05 ` Theodore Ts'o
2024-08-24 4:20 ` Baokun Li
2024-07-01 14:36 ` [syzbot] [ext4?] BUG: unable to handle kernel paging request in do_split Baokun Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_BE7AEE6C7C2D216CB8949CE8E6EE7ECC2C0A@qq.com \
--to=eadavis@qq.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+ae688d469e36fb5138d0@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®