Re: [syzbot] Re: [syzbot] [v9fs?] WARNING in v9fs_begin_writeback

From: syzbot
Date: Thu Aug 15 2024 - 04:42:57 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.

***

Subject: Re: [syzbot] [v9fs?] WARNING in v9fs_begin_writeback
Author: lizhi.xu@xxxxxxxxxxxxx

clean dirty for the release inode, stop to worker wb it again.

#syz test: upstream c0ecd6388360

diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c
index ec6cf8707fb0..02b06e4e3596 100644
--- a/fs/netfs/write_issue.c
+++ b/fs/netfs/write_issue.c
@@ -530,7 +530,9 @@ int netfs_writepages(struct address_space *mapping,
if (netfs_folio_group(folio) != NETFS_FOLIO_COPY_TO_CACHE &&
unlikely(!test_bit(NETFS_RREQ_UPLOAD_TO_SERVER, &wreq->flags))) {
set_bit(NETFS_RREQ_UPLOAD_TO_SERVER, &wreq->flags);
- wreq->netfs_ops->begin_writeback(wreq);
+ printk("ino: %lx, sync: %d, wsize: %u, %s\n", wreq->inode->i_ino, wreq->inode->i_state & I_SYNC, wreq->wsize, __func__);
+ if (wreq->inode->i_state & ~I_SYNC)
+ wreq->netfs_ops->begin_writeback(wreq);
}

error = netfs_write_folio(wreq, wbc, folio);
diff --git a/mm/filemap.c b/mm/filemap.c
index 876cc64aadd7..9176270fe35a 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -438,6 +438,8 @@ static inline int __filemap_fdatawrite(struct address_space *mapping,

int filemap_fdatawrite(struct address_space *mapping)
{
+ struct inode *inode = mapping->host;
+ printk("ino: %lx, sync: %d, %s \n", inode->i_ino, inode->i_state & I_SYNC, __func__);
return __filemap_fdatawrite(mapping, WB_SYNC_ALL);
}
EXPORT_SYMBOL(filemap_fdatawrite);