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 05/10] btrfs-progs: Pull free space tree related code from kernel
Date: Thu, 4 Oct 2018 12:01:48 -0700	[thread overview]
Message-ID: <20181004190148.GG25437@vader> (raw)
In-Reply-To: <33367247-9a7b-bbfa-66c7-1404f6db656a@suse.com>

On Thu, Oct 04, 2018 at 09:34:01PM +0300, Nikolay Borisov wrote:
> 
> 
> On  4.10.2018 21:26, Omar Sandoval wrote:
> > On Mon, Oct 01, 2018 at 05:46:16PM +0300, Nikolay Borisov wrote:
> >> To help implement free space tree checker in user space some kernel
> >> function are necessary, namely iterating/deleting/adding freespace
> >> items, some internal search functions. Functions to populate a block
> >> group based on the extent tree. The code is largely copy/paste from
> >> the kernel with locking eliminated (i.e free_space_lock). It supports
> >> reading/writing of both bitmap and extent based FST trees.
> > 
> > For some reason, a lot of this added code uses spaces instead of tabs,
> > so I had to fix that in order to compare it to the kernel code (some of
> > the functions were reordered, too).
> > 
> > The only functional difference I noticed was that this is missing the
> > code to insert the block group header in the free space tree:
> > 
> > 	if (block_group->needs_free_space) {
> > 		ret = __add_block_group_free_space(trans, block_group, path);
> > 		if (ret)
> > 			return ret;
> > 	}
> > 
> > Was that intentionally omitted? Without it, the free space tree is
> > pretty broken :(
> 
> Yes, it was intentional. If you remember I even emailed you about this
> particular piece of code and you said you needed to have it this way in
> case delayed refs were run before the space tree was initialized.
> 
> In user space AFAIK we don't have that problem since
> add_new_free_space_info/__add_to_free_space_tree is called via
> 
> btrfs_Create_free_space_tree
>    populate_free_space_tree
>      add_new_free_space_info
>      __add_to_free_space_tree

Ah, will progs never allocate a new block group? If so, then you're
right, this is fine.

  reply	other threads:[~2018-10-04 19:01 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 [this message]
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
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=20181004190148.GG25437@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).