[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_F0F725A60DFF92165D88DDBB9960CF878D07@qq.com>
Date: Fri, 2 Aug 2024 19:27:38 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+7dbbb74af6291b5a5a8b@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [btrfs?] WARNING: bad unlock balance in btrfs_direct_write
btrfs_sync_file didn't use skip_ilock to split up_write and btrfs_inode_unlock
#syz test: upstream e4fc196f5ba3
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 9f10a9f23fcc..9914419f3b7d 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1868,7 +1868,10 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
out_release_extents:
btrfs_release_log_ctx_extents(&ctx);
- btrfs_inode_unlock(inode, BTRFS_ILOCK_MMAP);
+ if (skip_ilock)
+ up_write(&inode->i_mmap_lock);
+ else
+ btrfs_inode_unlock(inode, BTRFS_ILOCK_MMAP);
goto out;
}
Powered by blists - more mailing lists