WSL2-Linux-Kernel/fs/btrfs
Filipe Manana 1a607d22de btrfs: fix double inode unlock for direct IO sync writes
commit e0391e92f9ab4fb3dbdeb139c967dcfa7ac4b115 upstream.

If we do a direct IO sync write, at btrfs_sync_file(), and we need to skip
inode logging or we get an error starting a transaction or an error when
flushing delalloc, we end up unlocking the inode when we shouldn't under
the 'out_release_extents' label, and then unlock it again at
btrfs_direct_write().

Fix that by checking if we have to skip inode unlocking under that label.

Reported-by: syzbot+7dbbb74af6291b5a5a8b@syzkaller.appspotmail.com
Link: https://lore.kernel.org/linux-btrfs/000000000000dfd631061eaeb4bc@google.com/
Fixes: 939b656bc8ab ("btrfs: fix corruption after buffer fault in during direct IO append write")
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-19 05:45:49 +02:00
..
tests
Kconfig
Makefile
acl.c
async-thread.c
async-thread.h
backref.c
backref.h
block-group.c
block-group.h
block-rsv.c
block-rsv.h
btrfs_inode.h
check-integrity.c
check-integrity.h
compression.c
compression.h
ctree.c
ctree.h btrfs: fix corruption after buffer fault in during direct IO append write 2024-08-19 05:45:49 +02:00
delalloc-space.c
delalloc-space.h
delayed-inode.c
delayed-inode.h
delayed-ref.c
delayed-ref.h
dev-replace.c
dev-replace.h
dir-item.c
discard.c
discard.h
disk-io.c
disk-io.h
export.c
export.h
extent-io-tree.h
extent-tree.c
extent_io.c
extent_io.h
extent_map.c
extent_map.h
file-item.c
file.c btrfs: fix double inode unlock for direct IO sync writes 2024-08-19 05:45:49 +02:00
free-space-cache.c btrfs: fix bitmap leak when loading free space cache on duplicate entry 2024-08-19 05:45:38 +02:00
free-space-cache.h
free-space-tree.c
free-space-tree.h
inode-item.c
inode.c
ioctl.c
locking.c
locking.h
lzo.c
misc.h
ordered-data.c
ordered-data.h
orphan.c
print-tree.c
print-tree.h
props.c
props.h
qgroup.c btrfs: qgroup: fix quota root leak after quota disable failure 2024-07-27 10:46:12 +02:00
qgroup.h
raid56.c
raid56.h
rcu-string.h
reada.c
ref-verify.c
ref-verify.h
reflink.c
reflink.h
relocation.c
root-tree.c
scrub.c
send.c
send.h
space-info.c
space-info.h
struct-funcs.c
subpage.c
subpage.h
super.c
sysfs.c
sysfs.h
transaction.c
transaction.h
tree-checker.c
tree-checker.h
tree-defrag.c
tree-log.c
tree-log.h
tree-mod-log.c
tree-mod-log.h
ulist.c
ulist.h
uuid-tree.c
verity.c
volumes.c
volumes.h
xattr.c
xattr.h
zlib.c
zoned.c
zoned.h
zstd.c