diff options
author | Josef Bacik <josef@toxicpanda.com> | 2023-01-26 22:00:55 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-02-15 19:38:53 +0100 |
commit | ed25dab3a0d1b14b59a3ad74b9d6bb4f4dca03b8 (patch) | |
tree | 936480cd5acbf62f82a06c2b5c65b737955ba5af /fs/btrfs/ioctl.c | |
parent | btrfs: always lock the block before calling btrfs_clean_tree_block (diff) | |
download | linux-ed25dab3a0d1b14b59a3ad74b9d6bb4f4dca03b8.tar.xz linux-ed25dab3a0d1b14b59a3ad74b9d6bb4f4dca03b8.zip |
btrfs: add trans argument to btrfs_clean_tree_block
We check the header generation in the extent buffer against the current
running transaction id to see if it's safe to clear DIRTY on this
buffer. Generally speaking if we're clearing the buffer dirty we're
holding the transaction open, but in the case of cleaning up an aborted
transaction we don't, so we have extra checks in that path to check the
transid. To allow for a future cleanup go ahead and pass in the trans
handle so we don't have to rely on ->running_transaction being set.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 7e348bd2ccde..5fdc09f7f1cb 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -707,7 +707,7 @@ static noinline int create_subvol(struct user_namespace *mnt_userns, * exists). */ btrfs_tree_lock(leaf); - btrfs_clean_tree_block(leaf); + btrfs_clean_tree_block(trans, leaf); btrfs_tree_unlock(leaf); btrfs_free_tree_block(trans, objectid, leaf, 0, 1); free_extent_buffer(leaf); |