Commit 7d08e002 authored by Naohiro Aota's avatar Naohiro Aota Committed by Thadeu Lima de Souza Cascardo

btrfs: propagate error to btrfs_cmp_data_prepare caller

BugLink: http://bugs.launchpad.net/bugs/1721550

commit 78ad4ce0 upstream.

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: default avatarNaohiro Aota <naohiro.aota@wdc.com>
Fixes: f4414602 ("btrfs: fix deadlock with extent-same and readpage")
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent be5f93e0
......@@ -2984,7 +2984,7 @@ static int btrfs_cmp_data_prepare(struct inode *src, u64 loff,
out:
if (ret)
btrfs_cmp_data_free(cmp);
return 0;
return ret;
}
static int btrfs_cmp_data(struct inode *src, u64 loff, struct inode *dst,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment