From: Filipe Manana <fdmanana@kernel.org>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v2 3/3] btrfs: pass btrfs_fs_info to btrfs_recover_relocation
Date: Mon, 21 Feb 2022 12:41:04 +0000 [thread overview]
Message-ID: <YhOIYIwTVKbTPfrN@debian9.Home> (raw)
In-Reply-To: <3aaba7fc1861004693fdc02ca5df300cd6773273.1645214059.git.josef@toxicpanda.com>
On Fri, Feb 18, 2022 at 02:56:12PM -0500, Josef Bacik wrote:
> We don't need a root here, we just need the btrfs_fs_info, we can just
> get the specific roots we need from fs_info.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Looks good, thanks.
> ---
> fs/btrfs/ctree.h | 2 +-
> fs/btrfs/disk-io.c | 2 +-
> fs/btrfs/relocation.c | 5 ++---
> 3 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 1e238748dc73..ca411a42bccf 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -3845,7 +3845,7 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans,
> struct btrfs_root *root);
> int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
> struct btrfs_root *root);
> -int btrfs_recover_relocation(struct btrfs_root *root);
> +int btrfs_recover_relocation(struct btrfs_fs_info *fs_info);
> int btrfs_reloc_clone_csums(struct btrfs_inode *inode, u64 file_pos, u64 len);
> int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,
> struct btrfs_root *root, struct extent_buffer *buf,
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 183baeffd9c9..6a0b4dbd70e9 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -3379,7 +3379,7 @@ int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info)
> up_read(&fs_info->cleanup_work_sem);
>
> mutex_lock(&fs_info->cleaner_mutex);
> - ret = btrfs_recover_relocation(fs_info->tree_root);
> + ret = btrfs_recover_relocation(fs_info);
> mutex_unlock(&fs_info->cleaner_mutex);
> if (ret < 0) {
> btrfs_warn(fs_info, "failed to recover relocation: %d", ret);
> diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
> index f528c5283f25..7dc6f29a6094 100644
> --- a/fs/btrfs/relocation.c
> +++ b/fs/btrfs/relocation.c
> @@ -4124,9 +4124,8 @@ static noinline_for_stack int mark_garbage_root(struct btrfs_root *root)
> * this function resumes merging reloc trees with corresponding fs trees.
> * this is important for keeping the sharing of tree blocks
> */
> -int btrfs_recover_relocation(struct btrfs_root *root)
> +int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
> {
> - struct btrfs_fs_info *fs_info = root->fs_info;
> LIST_HEAD(reloc_roots);
> struct btrfs_key key;
> struct btrfs_root *fs_root;
> @@ -4167,7 +4166,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
> key.type != BTRFS_ROOT_ITEM_KEY)
> break;
>
> - reloc_root = btrfs_read_tree_root(root, &key);
> + reloc_root = btrfs_read_tree_root(fs_info->tree_root, &key);
> if (IS_ERR(reloc_root)) {
> err = PTR_ERR(reloc_root);
> goto out;
> --
> 2.26.3
>
next prev parent reply other threads:[~2022-02-21 12:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 19:56 [PATCH v2 0/3] btrfs: fix problem with balance recovery and snap delete Josef Bacik
2022-02-18 19:56 ` [PATCH v2 1/3] btrfs: do not start relocation until in progress drops are done Josef Bacik
2022-02-21 12:38 ` Filipe Manana
2022-02-24 15:03 ` [btrfs] 0ac06c96a6: BUG:KASAN:use-after-free_in_btrfs_drop_snapshot kernel test robot
2022-02-24 15:03 ` kernel test robot
2022-02-18 19:56 ` [PATCH v2 2/3] btrfs: use btrfs_fs_info for deleting snapshots and cleaner Josef Bacik
2022-02-21 12:40 ` Filipe Manana
2022-02-18 19:56 ` [PATCH v2 3/3] btrfs: pass btrfs_fs_info to btrfs_recover_relocation Josef Bacik
2022-02-21 12:41 ` Filipe Manana [this message]
2022-02-21 16:20 ` [PATCH v2 0/3] btrfs: fix problem with balance recovery and snap delete David Sterba
2022-02-24 14:47 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YhOIYIwTVKbTPfrN@debian9.Home \
--to=fdmanana@kernel.org \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.