From: Josef Bacik <jbacik@redhat.com>
To: Yan Zheng <yanzheng@21cn.com>
Cc: Josef Bacik <jbacik@redhat.com>, linux-btrfs@vger.kernel.org
Subject: Re: Question about e8569813849b5da394a195c7e76b4faa452b12d1
Date: Thu, 9 Oct 2008 06:49:12 -0400 [thread overview]
Message-ID: <20081009104911.GA19500@unused.rdu.redhat.com> (raw)
In-Reply-To: <3d0408630810081847q205c1fe2q227e9e3c7b92fc2@mail.gmail.com>
On Thu, Oct 09, 2008 at 09:47:41AM +0800, Yan Zheng wrote:
> 2008/10/9 Josef Bacik <jbacik@redhat.com>:
> > Hello,
> >
> > Is there a reason
> >
> > - if (search_end == (u64)-1)
> > - search_end = btrfs_super_total_bytes(&info->super_copy);
> >
> > happened in the commit from $SUBJECT? If its just a mistake thats fine I'll add
> > it back with my current patch, but if there is a reason it needed to go then I
> > need to know that too so I can figure out a different way to do what I want to
> > do. Thanks,
> >
>
> btrfs_super_total_bytes is total size of all devices. we can't rely on it as
> search_end for two reasons:
>
> 1) If metadata mirror is enable, the value can be larger than the last byte of
> last chunk.
>
> 2) For a FS has been balanced, there are some 'holes' in the chunk address
> space, so the value can be smaller than the last byte of last chunk.
>
Awesome thanks this is what I needed. So here's my next question, we're hitting
ENOSPC before we're empty because of the way I currently lookup block groups in
find_free_extent, so I'm rewriting find_free_extent to lookup the
btrfs_space_info that we are looking to allocate out of, and just loop through
its list of block groups, starting at the one that the hint points to, until we
find what we need. This way I can incorporate find_free_space into
find_free_extent and make the code a little easier to read. Will this upset
what you are trying to do with the space balancing code? Thanks,
Josef
prev parent reply other threads:[~2008-10-09 10:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 20:59 Question about e8569813849b5da394a195c7e76b4faa452b12d1 Josef Bacik
2008-10-09 0:14 ` Chris Mason
2008-10-09 1:47 ` Yan Zheng
2008-10-09 10:49 ` Josef Bacik [this message]
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=20081009104911.GA19500@unused.rdu.redhat.com \
--to=jbacik@redhat.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=yanzheng@21cn.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