On Thu, Sep 12, 2019 at 06:31:44PM +0300, Nikolay Borisov wrote: > A recent patch to btrfs showed that there was at least 1 case where a > nesed transaction was committed. Nested transaction in this case means > a code which has a transaction handle calls some function which in turn > obtains a copy of the same transaction handle. In such cases the correct > thing to do is for the lower callee to call btrfs_end_transaction which > contains appropriate checks so as to not commit the transaction which > will result in stale trans handler for the caller. > > To catch such cases add an assert in btrfs_commit_transaction ensuring > btrfs_trans_handle::use_count is always 1. > > Signed-off-by: Nikolay Borisov <nbori...@suse.com>
Reviewed-by: Josef Bacik <jo...@toxicpanda.com> Thanks, Josef