From: Dave Chinner <david@fromorbit.com>
To: Carlos Maiolino <cmaiolino@redhat.com>
Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com
Subject: Re: [PATCH 2/2] xfs: Limit total allocation request to maximum possible
Date: Wed, 25 Sep 2019 06:50:29 +1000 [thread overview]
Message-ID: <20190924205029.GF16973@dread.disaster.area> (raw)
In-Reply-To: <20190918082453.25266-3-cmaiolino@redhat.com>
On Wed, Sep 18, 2019 at 10:24:53AM +0200, Carlos Maiolino wrote:
> The original allocation request may have a total value way beyond
> possible limits.
>
> Trim it down to the maximum possible if needed
>
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> fs/xfs/libxfs/xfs_bmap.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 07aad70f3931..3aa0bf5cc7e3 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -3477,6 +3477,11 @@ xfs_bmap_btalloc(
> error = xfs_bmap_btalloc_filestreams(ap, &args, &blen);
> else
> error = xfs_bmap_btalloc_nullfb(ap, &args, &blen);
> +
> + /* We can never have total larger than blen, so trim it now */
Yes we can. blen is typically the largest contiguous extent in the
filesystem or AG in question. It is not typically the total free
space in the AG, which only occurs when the AG is empty. i.e. in
normal situations, we can allocate both blen and the rest of the
metadata from the same AG as there is more than one free extent in
the AG.
I think that for the purposes of a single > AG size allocation, the
total needs to be clamped to the free space in the AG that is
selected, not the length of the allocation we are trying....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-09-24 20:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 8:24 [PATCH RFC 0/2] A small improvement in the allocation algorithm Carlos Maiolino
2019-09-18 8:24 ` [PATCH 1/2] xfs: cap longest free extent to maximum allocatable Carlos Maiolino
2019-09-18 12:27 ` Brian Foster
2019-09-23 12:25 ` Carlos Maiolino
2019-09-18 8:24 ` [PATCH 2/2] xfs: Limit total allocation request to maximum possible Carlos Maiolino
2019-09-18 12:28 ` Brian Foster
2019-09-23 12:39 ` Carlos Maiolino
2019-09-23 13:11 ` Brian Foster
2019-09-24 8:07 ` Carlos Maiolino
2019-09-24 20:50 ` Dave Chinner [this message]
2019-09-25 11:53 ` Brian Foster
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=20190924205029.GF16973@dread.disaster.area \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=cmaiolino@redhat.com \
--cc=linux-xfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox