]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: change btrfs_encoded_read() so that reading of extent is done by caller
authorMark Harmstone <maharmstone@fb.com>
Tue, 22 Oct 2024 14:50:17 +0000 (15:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2024 09:40:55 +0000 (10:40 +0100)
commita0f5689a684e8539ab28b47d6bf69279641b5b06
tree3cb9b787b0cbb1d2f8483b652f2b7aa3262f6b94
parent11755f72e54f11aff1aaaebba27ea96e82149738
btrfs: change btrfs_encoded_read() so that reading of extent is done by caller

[ Upstream commit 26efd44796c6dd7a64f039a0dda6d558eac97a3e ]

Change the behaviour of btrfs_encoded_read() so that if it needs to read
an extent from disk, it leaves the extent and inode locked and returns
-EIOCBQUEUED. The caller is then responsible for doing the I/O via
btrfs_encoded_read_regular() and unlocking the extent and inode.

Signed-off-by: Mark Harmstone <maharmstone@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Stable-dep-of: 05b36b04d74a ("btrfs: fix use-after-free in btrfs_encoded_read_endio()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/btrfs_inode.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c