[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240831002222.2275740-1-lizhi.xu@windriver.com>
Date: Sat, 31 Aug 2024 08:22:22 +0800
From: Lizhi Xu <lizhi.xu@...driver.com>
To: <syzbot+4704b3cc972bd76024f1@...kaller.appspotmail.com>
CC: <clm@...com>, <dsterba@...e.com>, <josef@...icpanda.com>,
<linux-btrfs@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<syzkaller-bugs@...glegroups.com>
Subject: [PATCH] btrfs: Add assert or condition
When the value of fsync_skip_inode_lock is true, i_mmap_lock is used,
so add it or condition in the ASSERT.
Reported-and-tested-by: syzbot+4704b3cc972bd76024f1@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=4704b3cc972bd76024f1
Signed-off-by: Lizhi Xu <lizhi.xu@...driver.com>
---
fs/btrfs/ordered-data.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index 82a68394a89c..d0187e1fb941 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -1015,7 +1015,8 @@ void btrfs_get_ordered_extents_for_logging(struct btrfs_inode *inode,
{
struct rb_node *n;
- ASSERT(inode_is_locked(&inode->vfs_inode));
+ ASSERT(inode_is_locked(&inode->vfs_inode) ||
+ rwsem_is_locked(&inode->i_mmap_lock));
spin_lock_irq(&inode->ordered_tree_lock);
for (n = rb_first(&inode->ordered_tree); n; n = rb_next(n)) {
--
2.43.0
Powered by blists - more mailing lists