btrfs: free PERTRANS at the end of cleanup_transaction()
authorBoris Burkov <boris@bur.io>
Tue, 26 Mar 2024 18:17:12 +0000 (11:17 -0700)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 May 2024 19:31:02 +0000 (21:31 +0200)
commit5f2fb819f6bfda870c4bef81a0ae7830e34044db
treeb91495626e9f7fb8cbe0a2faaea3fc3e3caeaa92
parent400b172b8cdcff87038697169fe9e4222120dd9a
btrfs: free PERTRANS at the end of cleanup_transaction()

Some of the operations after the free might convert more PERTRANS
metadata. Do the freeing as late as possible to eliminate a source of
leaked PERTRANS metadata.

This helps with the pass rate of generic/269 and generic/475.

Reviewed-by: Qu Wenruo <qwu@suse.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c