]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: propagate error to btrfs_cmp_data_prepare caller
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 8 Sep 2017 08:48:55 +0000 (17:48 +0900)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Sep 2017 12:52:31 +0000 (14:52 +0200)
commitc9999b36c3e05886f3558317a676e6a3fe668879
tree902bf4b9ff9285500a6ff8b00a608c21395ed655
parent8a6f44955691496f97c4238a6474f10b6ebbe4da
btrfs: propagate error to btrfs_cmp_data_prepare caller

btrfs_cmp_data_prepare() (almost) always returns 0 i.e. ignoring errors
from gather_extent_pages(). While the pages are freed by
btrfs_cmp_data_free(), cmp->num_pages still has > 0. Then,
btrfs_extent_same() try to access the already freed pages causing faults
(or violates PageLocked assertion).

This patch just return the error as is so that the caller stop the process.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Fixes: 5ccec6e2a43a ("btrfs: fix deadlock with extent-same and readpage")
Cc: <stable@vger.kernel.org> # 4.2
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c