From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+0b74d367d6e80661d6df@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [v9fs?] WARNING in v9fs_begin_writeback
Date: Sun, 11 Aug 2024 20:38:37 +0800 [thread overview]
Message-ID: <tencent_0E503C2F3660964436144B5A74DD779D6709@qq.com> (raw)
In-Reply-To: <0000000000007ec511061f00a7b2@google.com>
debug
#syz test: upstream c0ecd6388360
diff --git a/mm/filemap.c b/mm/filemap.c
index d62150418b91..5112cf69bce2 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -394,6 +394,7 @@ int filemap_fdatawrite_wbc(struct address_space *mapping,
return 0;
wbc_attach_fdatawrite_inode(wbc, mapping->host);
+ printk("ino: %lx, comm: %s, %s\n", mapping->host->i_ino, current->comm, __func__);
ret = do_writepages(mapping, wbc);
wbc_detach_inode(wbc);
return ret;
@@ -427,17 +428,20 @@ int __filemap_fdatawrite_range(struct address_space *mapping, loff_t start,
.range_end = end,
};
+ printk("ino: %lx, comm: %s, %s\n", mapping->host->i_ino, current->comm, __func__);
return filemap_fdatawrite_wbc(mapping, &wbc);
}
static inline int __filemap_fdatawrite(struct address_space *mapping,
int sync_mode)
{
+ printk("ino: %lx, comm: %s, %s\n", mapping->host->i_ino, current->comm, __func__);
return __filemap_fdatawrite_range(mapping, 0, LLONG_MAX, sync_mode);
}
int filemap_fdatawrite(struct address_space *mapping)
{
+ printk("ino: %lx, comm: %s, %s\n", mapping->host->i_ino, current->comm, __func__);
return __filemap_fdatawrite(mapping, WB_SYNC_ALL);
}
EXPORT_SYMBOL(filemap_fdatawrite);
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 4430ac68e4c4..f76ce90a5396 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2687,6 +2687,7 @@ int do_writepages(struct address_space *mapping, struct writeback_control *wbc)
/* deal with chardevs and other special files */
ret = 0;
}
+ printk("ret: %d, ino: %lx, comm: %s, %s\n", ret, mapping->host->i_ino, current->comm, __func__);
if (ret != -ENOMEM || wbc->sync_mode != WB_SYNC_ALL)
break;
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index a97ceb105cd8..7768cc70439d 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -34,6 +34,7 @@ static void v9fs_begin_writeback(struct netfs_io_request *wreq)
{
struct p9_fid *fid;
+ printk("ino: %lx, %s\n", wreq->inode->i_ino, __func__);
fid = v9fs_fid_find_inode(wreq->inode, true, INVALID_UID, true);
if (!fid) {
WARN_ONCE(1, "folio expected an open fid inode->i_ino=%lx\n",
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index e0d34e4e9076..2705474f5fcb 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -215,10 +215,13 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
inode, filp, fid ? fid->fid : -1);
if (fid) {
- if ((S_ISREG(inode->i_mode)) && (filp->f_mode & FMODE_WRITE))
+ if ((S_ISREG(inode->i_mode)) && (filp->f_mode & FMODE_WRITE)) {
+ printk("ino: %lx, comm: %s, %s\n", inode->i_ino, current->comm, __func__);
retval = filemap_fdatawrite(inode->i_mapping);
+ }
spin_lock(&inode->i_lock);
+ printk("del, ino: %lx, ino sync: %d, comm: %s, %s\n", inode->i_ino, inode->i_state & I_SYNC, current->comm, __func__);
hlist_del(&fid->ilist);
spin_unlock(&inode->i_lock);
put_err = p9_fid_put(fid);
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 348cc90bf9c5..a3c32b7de2f5 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -44,6 +44,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
struct p9_fid *fid;
int omode;
+ pr_info("ino: %lx, %s\n", inode->i_ino, __func__);
p9_debug(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, file);
v9ses = v9fs_inode2v9ses(inode);
if (v9fs_proto_dotl(v9ses))
@@ -461,6 +462,7 @@ v9fs_file_mmap(struct file *filp, struct vm_area_struct *vma)
struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode);
p9_debug(P9_DEBUG_MMAP, "filp :%p\n", filp);
+ pr_info("ino: %lx, comm: %s, %s\n", inode->i_ino, current->comm, __func__);
if (!(v9ses->cache & CACHE_WRITEBACK)) {
p9_debug(P9_DEBUG_CACHE, "(read-only mmap mode)");
@@ -477,6 +479,7 @@ v9fs_file_mmap(struct file *filp, struct vm_area_struct *vma)
static vm_fault_t
v9fs_vm_page_mkwrite(struct vm_fault *vmf)
{
+ printk("comm: %s, %s\n", current->comm, __func__);
return netfs_page_mkwrite(vmf, NULL);
}
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index fd72fc38c8f5..99f42ce8de15 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -355,6 +355,7 @@ void v9fs_evict_inode(struct inode *inode)
netfs_clear_inode_writeback(inode, &version);
clear_inode(inode);
+ printk("ino: %lx, comm: %s, %s\n", inode->i_ino, current->comm, __func__);
filemap_fdatawrite(&inode->i_data);
#ifdef CONFIG_9P_FSCACHE
@@ -1034,6 +1035,7 @@ static int v9fs_vfs_setattr(struct mnt_idmap *idmap,
/* Write all dirty data */
if (d_is_reg(dentry)) {
+ printk("ino: %lx, comm: %s, %s\n", inode->i_ino, current->comm, __func__);
retval = filemap_fdatawrite(inode->i_mapping);
if (retval)
p9_debug(P9_DEBUG_ERROR,
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index c61b97bd13b9..68b3ced3f3b1 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -518,6 +518,7 @@ int v9fs_vfs_setattr_dotl(struct mnt_idmap *idmap,
/* Write all dirty data */
if (S_ISREG(inode->i_mode)) {
+ printk("ino: %lx, comm: %s, %s\n", inode->i_ino, current->comm, __func__);
retval = filemap_fdatawrite(inode->i_mapping);
if (retval < 0)
p9_debug(P9_DEBUG_ERROR,
diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c
index 9258d30cffe3..87d14dfa9017 100644
--- a/fs/netfs/write_issue.c
+++ b/fs/netfs/write_issue.c
@@ -35,6 +35,7 @@
#include <linux/mm.h>
#include <linux/pagemap.h>
#include "internal.h"
+#include <linux/backing-dev.h>
/*
* Kill all dirty folios in the event of an unrecoverable error, starting with
@@ -503,6 +504,15 @@ int netfs_writepages(struct address_space *mapping,
struct folio *folio;
int error = 0;
+ if (!mapping_can_writeback(mapping) ||
+ !mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
+ printk("ino %lx can not wb: %d or mapping tagged :%d, %s\n",
+ mapping->host->i_ino, mapping_can_writeback(mapping),
+ mapping_tagged(mapping, PAGECACHE_TAG_DIRTY),
+ __func__);
+ return 0;
+ }
+
if (wbc->sync_mode == WB_SYNC_ALL)
mutex_lock(&ictx->wb_lock);
else if (!mutex_trylock(&ictx->wb_lock))
@@ -522,6 +532,8 @@ int netfs_writepages(struct address_space *mapping,
trace_netfs_write(wreq, netfs_write_trace_writeback);
netfs_stat(&netfs_n_wh_writepages);
+ printk("ino state: %lu, ino: %lx, comm: %s, folio: %p, %s\n", wreq->inode->i_state,
+ wreq->inode->i_ino, current->comm, folio, __func__);
do {
_debug("wbiter %lx %llx", folio->index, wreq->start + wreq->submitted);
next prev parent reply other threads:[~2024-08-11 12:44 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 9:45 syzbot
2024-08-06 11:35 ` Edward Adam Davis
2024-08-06 11:56 ` syzbot
2024-08-08 11:10 ` Edward Adam Davis
2024-08-08 11:24 ` syzbot
2024-08-08 11:44 ` Edward Adam Davis
2024-08-08 12:10 ` syzbot
2024-08-08 13:35 ` Edward Adam Davis
2024-08-08 13:56 ` syzbot
2024-08-08 15:02 ` Edward Adam Davis
2024-08-08 15:23 ` syzbot
2024-08-08 23:22 ` Edward Adam Davis
2024-08-08 23:43 ` syzbot
2024-08-09 1:44 ` [syzbot] " syzbot
2024-08-09 5:48 ` syzbot
2024-08-09 6:41 ` syzbot
2024-08-09 7:41 ` syzbot
2024-08-09 8:15 ` syzbot
2024-08-09 8:36 ` syzbot
2024-08-09 9:20 ` syzbot
2024-08-09 11:24 ` Edward Adam Davis
2024-08-09 11:36 ` syzbot
2024-08-09 12:05 ` Edward Adam Davis
2024-08-09 12:19 ` syzbot
2024-08-09 13:32 ` Edward Adam Davis
2024-08-09 13:53 ` syzbot
2024-08-09 14:52 ` Edward Adam Davis
2024-08-09 15:13 ` syzbot
2024-08-10 0:54 ` Edward Adam Davis
2024-08-10 1:21 ` syzbot
2024-08-10 2:56 ` Edward Adam Davis
2024-08-10 3:10 ` syzbot
2024-08-10 3:36 ` Edward Adam Davis
2024-08-10 4:02 ` syzbot
2024-08-10 4:53 ` Edward Adam Davis
2024-08-10 5:06 ` syzbot
2024-08-10 4:55 ` Edward Adam Davis
2024-08-10 5:29 ` syzbot
2024-08-11 4:49 ` Edward Adam Davis
2024-08-11 5:02 ` syzbot
2024-08-11 6:14 ` Edward Adam Davis
2024-08-11 6:35 ` syzbot
2024-08-11 8:42 ` Edward Adam Davis
2024-08-11 9:13 ` syzbot
2024-08-11 10:18 ` Edward Adam Davis
2024-08-11 10:43 ` syzbot
2024-08-11 11:57 ` Edward Adam Davis
2024-08-11 12:09 ` syzbot
2024-08-11 12:38 ` Edward Adam Davis [this message]
2024-08-11 13:04 ` syzbot
2024-08-11 14:05 ` Edward Adam Davis
2024-08-11 14:33 ` syzbot
2024-08-12 10:52 ` Edward Adam Davis
2024-08-12 11:18 ` syzbot
2024-08-13 0:29 ` Edward Adam Davis
2024-08-13 0:57 ` syzbot
2024-08-14 9:26 ` Edward Adam Davis
2024-08-14 9:47 ` syzbot
2024-08-14 10:25 ` Edward Adam Davis
2024-08-14 11:08 ` syzbot
2024-08-15 2:31 ` [syzbot] " syzbot
2024-08-15 3:00 ` syzbot
2024-08-15 8:13 ` syzbot
[not found] <20240809014410.672145-1-lizhi.xu@windriver.com>
2024-08-09 2:04 ` syzbot
[not found] <20240809054850.762409-1-lizhi.xu@windriver.com>
2024-08-09 6:09 ` syzbot
[not found] <20240809064122.1490034-1-lizhi.xu@windriver.com>
2024-08-09 7:01 ` syzbot
[not found] <20240809074103.2196689-1-lizhi.xu@windriver.com>
2024-08-09 8:01 ` syzbot
[not found] <20240809081544.2529127-1-lizhi.xu@windriver.com>
2024-08-09 8:29 ` syzbot
[not found] <20240809083558.2702436-1-lizhi.xu@windriver.com>
2024-08-09 8:56 ` syzbot
[not found] <20240809092004.3109492-1-lizhi.xu@windriver.com>
2024-08-09 9:40 ` syzbot
[not found] <20240815023135.340669-1-lizhi.xu@windriver.com>
2024-08-15 2:50 ` syzbot
[not found] <20240815030030.564798-1-lizhi.xu@windriver.com>
2024-08-15 3:20 ` syzbot
[not found] <20240815081319.3450173-1-lizhi.xu@windriver.com>
2024-08-15 8:34 ` syzbot
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_0E503C2F3660964436144B5A74DD779D6709@qq.com \
--to=eadavis@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+0b74d367d6e80661d6df@syzkaller.appspotmail.com \
--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
all inboxes | Powered by JetHome®