Forwarded: Re: [syzbot] [fs?] BUG: sleeping function called from invalid context in hook_sb_delete

syzbot posted 1 patch 3 months, 1 week ago
Forwarded: Re: [syzbot] [fs?] BUG: sleeping function called from invalid context in hook_sb_delete
Posted by syzbot 3 months, 1 week ago
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: Re: [syzbot] [fs?] BUG: sleeping function called from invalid context in hook_sb_delete
Author: m@maowtm.org

#syz test

diff --git a/fs/inode.c b/fs/inode.c
index 1396f79b2551..b28a61978d88 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -812,6 +812,8 @@ static void evict(struct inode *inode)
 {
 	const struct super_operations *op = inode->i_sb->s_op;
 
+	might_sleep();
+
 	BUG_ON(!(inode_state_read_once(inode) & I_FREEING));
 	BUG_ON(!list_empty(&inode->i_lru));
 
@@ -1968,7 +1970,6 @@ static void iput_final(struct inode *inode)
  */
 void iput(struct inode *inode)
 {
-	might_sleep();
 	if (unlikely(!inode))
 		return;