[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_537623A0A452D778B77A26C4736243668905@qq.com>
Date: Wed, 14 Aug 2024 21:36:07 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+733300ca0a9baca7e245@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [f2fs?] WARNING: lock held when returning to user space in f2fs_commit_atomic_write
unlock i_gc_rwsem[WRITE] before quiting f2fs_commit_atomic_write
Fixes: 7566a155c666 ("f2fs: atomic: fix to not allow GC to pollute atomic_file")
Reported-by: syzbot+78ff2855f26377625419@...kaller.appspotmail.com
correct git tree to linux-next
#syz test: linux-next 9e6869691724
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 741e46f9d0fd..a43054ab0cf1 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -389,13 +389,13 @@ int f2fs_commit_atomic_write(struct inode *inode)
err = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX);
if (err)
- return err;
+ goto out;
/* writeback GCing page of cow_inode */
err = filemap_write_and_wait_range(fi->cow_inode->i_mapping,
0, LLONG_MAX);
if (err)
- return err;
+ goto out;
filemap_invalidate_lock(inode->i_mapping);
@@ -407,6 +407,7 @@ int f2fs_commit_atomic_write(struct inode *inode)
f2fs_unlock_op(sbi);
filemap_invalidate_unlock(inode->i_mapping);
+out:
f2fs_up_write(&fi->i_gc_rwsem[WRITE]);
return err;
Powered by blists - more mailing lists