diff options
| author | 2025-08-26 17:30:16 +0100 | |
|---|---|---|
| committer | 2025-09-23 08:49:18 +0200 | |
| commit | 7f09699e5e6127db7bcb6d49d8fc674a74f23659 (patch) | |
| tree | a3b2f4dea0acdfa6f642d596a8a19123d66a3159 /fs/btrfs/tree-log.c | |
| parent | btrfs: add and use a log root field to struct walk_control (diff) | |
| download | wireguard-linux-7f09699e5e6127db7bcb6d49d8fc674a74f23659.tar.xz wireguard-linux-7f09699e5e6127db7bcb6d49d8fc674a74f23659.zip | |
btrfs: deduplicate log root free in error paths from btrfs_recover_log_trees()
Instead of duplicating the dropping of a log tree in case we jump to the
'error' label, move the dropping under the 'error' label and get rid of the
the unnecessary setting of the log root to NULL since we return immediately
after.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
| -rw-r--r-- | fs/btrfs/tree-log.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 7d1b21df698d..f039f0613a38 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -7491,8 +7491,6 @@ again: ret = PTR_ERR(wc.root); wc.root = NULL; if (ret != -ENOENT) { - btrfs_put_root(wc.log); - wc.log = NULL; btrfs_abort_transaction(trans, ret); goto error; } @@ -7510,8 +7508,6 @@ again: */ ret = btrfs_pin_extent_for_log_replay(trans, wc.log->node); if (ret) { - btrfs_put_root(wc.log); - wc.log = NULL; btrfs_abort_transaction(trans, ret); goto error; } @@ -7597,6 +7593,7 @@ next: error: if (wc.trans) btrfs_end_transaction(wc.trans); + btrfs_put_root(wc.log); clear_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags); btrfs_free_path(path); return ret; |
