linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 08/10] btrfs-progs: check: Add support for freespace tree fixing
Date: Thu, 4 Oct 2018 12:16:19 -0700	[thread overview]
Message-ID: <20181004191619.GH25437@vader> (raw)
In-Reply-To: <1538405181-25231-9-git-send-email-nborisov@suse.com>

On Mon, Oct 01, 2018 at 05:46:19PM +0300, Nikolay Borisov wrote:
> Now that all the prerequisite code for proper support of free space
> tree repair is in, it's time to wire it in. This is achieved by first
> hooking the freespace tree to the __free_extent/alloc_reserved_tree_block
> functions. And then introducing a wrapper function to contains the
> existing check_space_cache and the newly introduced repair code.
> Finally, it's important to note that FST repair code first clears the
> existing FST in case of any problem found and rebuilds it from scratch.

Reviewed-by: Omar Sandoval <osandov@fb.com>

A couple of really trivial nitpicks below that you should feel free to
ignore ;)

> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  check/main.c | 47 ++++++++++++++++++++++++++++++-----------------
>  1 file changed, 30 insertions(+), 17 deletions(-)
> 
> diff --git a/check/main.c b/check/main.c
> index b361cd7e26a0..4daf85aad82c 100644
> --- a/check/main.c
> +++ b/check/main.c
> @@ -5392,14 +5392,6 @@ static int check_space_cache(struct btrfs_root *root)
>  	int ret;
>  	int error = 0;
>  
> -	if (btrfs_super_cache_generation(root->fs_info->super_copy) != -1ULL &&
> -	    btrfs_super_generation(root->fs_info->super_copy) !=
> -	    btrfs_super_cache_generation(root->fs_info->super_copy)) {
> -		printf("cache and super generation don't match, space cache "
> -		       "will be invalidated\n");
> -		return 0;
> -	}
> -
>  	while (1) {
>  		ctx.item_count++;
>  		cache = btrfs_lookup_first_block_group(root->fs_info, start);
> @@ -9417,7 +9409,6 @@ static int do_clear_free_space_cache(struct btrfs_fs_info *fs_info,
>  			ret = 1;
>  			goto close_out;
>  		}
> -		printf("Clearing free space cache\n");

Just out of curiosity, why did you delete this message? The one in the
v2 case is still there.

>  		ret = clear_free_space_cache(fs_info);
>  		if (ret) {
>  			error("failed to clear free space cache");
> @@ -9444,6 +9435,35 @@ static int do_clear_free_space_cache(struct btrfs_fs_info *fs_info,
>  	return ret;
>  }
>  
> +static int validate_free_space_cache(struct btrfs_root *root)

At first glance, I wouldn't know what the difference is between
check_space_cache() and validate_free_space_cache(); they sound like the
same thing. Maybe rename this to check_and_repair_space_cache() or just
fold the rebuild into check_space_cache(), to be more in line with the
other check steps in fsck?

  reply	other threads:[~2018-10-04 19:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 14:46 [PATCH 00/10] Freespace tree repair support v2 Nikolay Borisov
2018-10-01 14:46 ` [PATCH 01/10] btrfs-progs: Add support for freespace tree in btrfs_read_fs_root Nikolay Borisov
2018-10-02 19:20   ` Omar Sandoval
2018-10-04  1:05   ` Su Yue
2018-10-01 14:46 ` [PATCH 02/10] btrfs-progs: Add extent buffer bitmap manipulation infrastructure Nikolay Borisov
2018-10-02 19:24   ` Omar Sandoval
2018-10-04  1:31   ` Su Yue
2018-10-01 14:46 ` [PATCH 03/10] btrfs-progs: Replace homegrown bitops related functions with kernel counterparts Nikolay Borisov
2018-10-02 23:32   ` Omar Sandoval
2018-10-01 14:46 ` [PATCH 04/10] btrfs-progs: Implement find_*_bit_le operations Nikolay Borisov
2018-10-04 18:08   ` Omar Sandoval
2018-10-04 18:09     ` Nikolay Borisov
2018-10-01 14:46 ` [PATCH 05/10] btrfs-progs: Pull free space tree related code from kernel Nikolay Borisov
2018-10-04 18:26   ` Omar Sandoval
2018-10-04 18:34     ` Nikolay Borisov
2018-10-04 19:01       ` Omar Sandoval
2018-10-23 14:05     ` David Sterba
2018-10-01 14:46 ` [PATCH 06/10] btrfs-progs: Hook FST code in extent (de)alloc Nikolay Borisov
2018-10-01 14:46 ` [PATCH 07/10] btrfs-progs: Add freespace tree as compat_ro supported feature Nikolay Borisov
2018-10-04 18:30   ` Omar Sandoval
2018-10-04 18:36     ` Nikolay Borisov
2018-10-01 14:46 ` [PATCH 08/10] btrfs-progs: check: Add support for freespace tree fixing Nikolay Borisov
2018-10-04 19:16   ` Omar Sandoval [this message]
2018-10-01 14:46 ` [PATCH 09/10] btrfs-progs: tests: Test for FST corruption detection/repair Nikolay Borisov
2018-10-01 14:46 ` [PATCH 10/10] btrfs-progs: check: Fix wrong error message in case of corrupted bitmap Nikolay Borisov
2018-10-04 19:18   ` Omar Sandoval
2018-10-23 15:00 ` [PATCH 00/10] Freespace tree repair support v2 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=20181004191619.GH25437@vader \
    --to=osandov@osandov.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).