From: syzbot <syzbot+ac2116e48989e84a2893@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] Re: kernel BUG in clear_inode()
Date: Wed, 06 Nov 2024 21:47:42 -0800 [thread overview]
Message-ID: <672c547e.050a0220.350062.0289.GAE@google.com> (raw)
In-Reply-To: <671fbcd6.050a0220.21b2f.000a.GAE@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: kernel BUG in clear_inode()
Author: dmantipov@yandex.ru
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ff7afaeca1a15fbeaa2c4795ee806c0667bd77b2
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index a360b24ed320..debfc1389cb3 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -3029,14 +3029,23 @@ static void duplicateIXtree(struct super_block *sb, s64 blkno,
*
* RETURN VALUES:
* 0 - success
- * -ENOMEM - insufficient memory
+ * -EINVAL - unexpected inode type
*/
static int copy_from_dinode(struct dinode * dip, struct inode *ip)
{
struct jfs_inode_info *jfs_ip = JFS_IP(ip);
struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb);
+ int fileset = le32_to_cpu(dip->di_fileset);
+
+ switch (fileset) {
+ case AGGR_RESERVED_I: case AGGREGATE_I: case BMAP_I:
+ case LOG_I: case BADBLOCK_I: case FILESYSTEM_I:
+ break;
+ default:
+ return -EINVAL;
+ }
- jfs_ip->fileset = le32_to_cpu(dip->di_fileset);
+ jfs_ip->fileset = fileset;
jfs_ip->mode2 = le32_to_cpu(dip->di_mode);
jfs_set_inode_flags(ip);
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index d68a4e6ac345..845abc598334 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1467,8 +1467,14 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, unsig
ip = ERR_PTR(rc);
} else {
ip = jfs_iget(dip->i_sb, inum);
- if (IS_ERR(ip))
- jfs_err("jfs_lookup: iget failed on inum %d", (uint)inum);
+ if (IS_ERR(ip)) {
+ long err = PTR_ERR(ip);
+
+ jfs_err("%s: iget failed on inum %d with error"
+ " %ld, consider running 'jfs_fsck -f /dev/%s'",
+ __func__, (uint)inum, err, dip->i_sb->s_id);
+ return ERR_PTR(err);
+ }
}
return d_splice_alias(ip, dentry);
--
2.47.0
prev parent reply other threads:[~2024-11-07 5:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 16:33 [syzbot] [jfs?] kernel BUG in clear_inode (2) syzbot
2024-11-07 5:47 ` syzbot [this message]
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=672c547e.050a0220.350062.0289.GAE@google.com \
--to=syzbot+ac2116e48989e84a2893@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzkaller-bugs@googlegroups.com \
/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