Re: [syzbot ci] Re: minix: convert to iomap and add direct I/O
From: Jeremy Bingham
Date: Mon Jun 29 2026 - 23:05:59 EST
#syz test
minix: add the same dentry check as ext4_get_link to minix_get_link
It turns out that minix_get_link does need to have both the sb_bread and
the sb_getblk paths, like ext4_get_link does. It working with just the
sb_bread one initially was deceptive.
---
fs/minix/namei.c | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/fs/minix/namei.c b/fs/minix/namei.c
index e245f55a68ff..a4caaa3f7c9a 100644
--- a/fs/minix/namei.c
+++ b/fs/minix/namei.c
@@ -393,12 +393,23 @@ const char *minix_get_link(struct dentry *dentry, struct inode *inode,
else
blk = v2_block_to_cpu(*(v2_i_data(inode)));
- bh = sb_bread(sb, blk);
- if (IS_ERR(bh))
- return ERR_CAST(bh);
- if (!bh) {
- pr_err("bad symlink on inode %llu", inode->i_ino);
- return ERR_PTR(-EFSCORRUPTED);
+ /* This tried dodging the dentry check that ext4 does, but it turns out
+ * that it's necessary after all.
+ */
+ if (!dentry) {
+ bh = sb_getblk(sb, blk);
+ if (!bh || !buffer_uptodate(bh)) {
+ brelse(bh);
+ return ERR_PTR(-ECHILD);
+ }
+ } else {
+ bh = sb_bread(sb, blk);
+ if (IS_ERR(bh))
+ return ERR_CAST(bh);
+ if (!bh) {
+ pr_err("bad symlink on inode %llu", inode->i_ino);
+ return ERR_PTR(-EFSCORRUPTED);
+ }
}
set_delayed_call(callback, minix_free_link, bh);
--
2.47.3