[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_82F24B9E1BD32515BAE8BBDB33A09E7F1B08@qq.com>
Date: Wed, 14 Aug 2024 18:25:28 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+0b74d367d6e80661d6df@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [v9fs?] WARNING in v9fs_begin_writeback
debug
#syz test: upstream c0ecd6388360
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index e0d34e4e9076..cb511d49e35a 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -218,8 +218,10 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
if ((S_ISREG(inode->i_mode)) && (filp->f_mode & FMODE_WRITE))
retval = filemap_fdatawrite(inode->i_mapping);
+ printk("fid: %p, %s\n", fid, __func__);
spin_lock(&inode->i_lock);
- hlist_del(&fid->ilist);
+ if (refcount_read(&fid->count) == 1)
+ hlist_del(&fid->ilist);
spin_unlock(&inode->i_lock);
put_err = p9_fid_put(fid);
retval = retval < 0 ? retval : put_err;
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 348cc90bf9c5..129354d5b284 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -80,6 +80,8 @@ int v9fs_file_open(struct inode *inode, struct file *file)
file->private_data = fid;
}
+ printk("fid: %p, %s\n", fid, __func__);
+ p9_fid_get(fid);
#ifdef CONFIG_9P_FSCACHE
if (v9ses->cache & CACHE_FSCACHE)
Powered by blists - more mailing lists