summaryrefslogtreecommitdiff
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorNaohiro Aota <naohiro.aota@wdc.com>2019-07-26 10:47:05 +0300
committerDavid Sterba <dsterba@suse.com>2019-07-26 13:21:22 +0300
commita3b46b86ca76d7f9d487e6a0b594fd1984e0796e (patch)
treeefab271e267efffe207b474b9959af63152f683d /fs/btrfs/transaction.c
parent6e7ca09b583de4be6c27d9d4b06e8c5dd46a58fa (diff)
downloadlinux-a3b46b86ca76d7f9d487e6a0b594fd1984e0796e.tar.xz
btrfs: fix extent_state leak in btrfs_lock_and_flush_ordered_range
btrfs_lock_and_flush_ordered_range() loads given "*cached_state" into cachedp, which, in general, is NULL. Then, lock_extent_bits() updates "cachedp", but it never goes backs to the caller. Thus the caller still see its "cached_state" to be NULL and never free the state allocated under btrfs_lock_and_flush_ordered_range(). As a result, we will see massive state leak with e.g. fstests btrfs/005. Fix this bug by properly handling the pointers. Fixes: bd80d94efb83 ("btrfs: Always use a cached extent_state in btrfs_lock_and_flush_ordered_range") Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
0 files changed, 0 insertions, 0 deletions