Message ID | d1a461ee8d8dc3064bc181304c70958990a1bdc8.1723044389.git.fdmanana@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [for,6.6,stable] btrfs: fix double inode unlock for direct IO sync writes | expand |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index a47a7bbf9b7e..952cf145c629 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2038,7 +2038,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(BTRFS_I(inode), BTRFS_ILOCK_MMAP); + if (skip_ilock) + up_write(&BTRFS_I(inode)->i_mmap_lock); + else + btrfs_inode_unlock(BTRFS_I(inode), BTRFS_ILOCK_MMAP); goto out; }