[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_CE9C9E131B1F4B491B1E25F3BA14BB123308@qq.com>
Date: Sun, 20 Oct 2024 11:09:39 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+9ef37ac20608f4836256@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [nilfs?] possible deadlock in nilfs_dirty_inode (4)
make sure all allocations with GFP_NOFS
#syz test
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index be6acf6e2bfc..183c16ad8776 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -252,11 +252,14 @@ static int nilfs_write_begin(struct file *file, struct address_space *mapping,
{
struct inode *inode = mapping->host;
int err = nilfs_transaction_begin(inode->i_sb, NULL, 1);
+ unsigned flags;
if (unlikely(err))
return err;
+ falgs = memalloc_nofs_save();
err = block_write_begin(mapping, pos, len, foliop, nilfs_get_block);
+ memalloc_nofs_restore(flags);
if (unlikely(err)) {
nilfs_write_failed(mapping, pos + len);
nilfs_transaction_abort(inode->i_sb);
Powered by blists - more mailing lists