diff options
author | ethanwu <ethanwu@synology.com> | 2018-04-29 15:59:42 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-05-02 11:54:58 +0200 |
commit | 998ac6d21cfd6efd58f5edf420bae8839dda9f2a (patch) | |
tree | 488d8767d0d027b387876bfd3a7da78c6d90f761 /lib/bust_spinlocks.c | |
parent | 17515f1b764df36271f3166c714f5a78301fbaa7 (diff) | |
download | linux-998ac6d21cfd6efd58f5edf420bae8839dda9f2a.tar.bz2 |
btrfs: Take trans lock before access running trans in check_delayed_ref
In preivous patch:
Btrfs: kill trans in run_delalloc_nocow and btrfs_cross_ref_exist
We avoid starting btrfs transaction and get this information from
fs_info->running_transaction directly.
When accessing running_transaction in check_delayed_ref, there's a
chance that current transaction will be freed by commit transaction
after the NULL pointer check of running_transaction is passed.
After looking all the other places using fs_info->running_transaction,
they are either protected by trans_lock or holding the transactions.
Fix this by using trans_lock and increasing the use_count.
Fixes: e4c3b2dcd144 ("Btrfs: kill trans in run_delalloc_nocow and btrfs_cross_ref_exist")
CC: stable@vger.kernel.org # 4.14+
Signed-off-by: ethanwu <ethanwu@synology.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'lib/bust_spinlocks.c')
0 files changed, 0 insertions, 0 deletions