All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Kaho Ng <ngkaho1234@gmail.com>
Cc: xfs@oss.sgi.com
Subject: Re: [QUESTION] about the freelist allocator in XFS
Date: Tue, 12 Jul 2016 08:53:57 +1000	[thread overview]
Message-ID: <20160711225357.GG1922@dastard> (raw)
In-Reply-To: <CAGeO4WOuQwA7wm_S6352ovDdgiJixn_ztP5=HUVO1d=VmRxfbA@mail.gmail.com>

On Mon, Jul 11, 2016 at 03:06:03PM +0800, Kaho Ng wrote:
> Just wonders why we prefer failing the request of refilling freelist
> with XFS_WANT_CORRUPTED_RETURN(mp, i == 1) in some rare case, rather
> than returning NULLAGBLOCK and allowing the loop in
> xfs_alloc_ag_vextent_size() to try xfs_alloc_ag_vextent_small()...

Have a look at where xfs_alloc_ag_vextent_small() gets the blocks it
returns to the caller if the btree cursor doesn't point to a btree
record we can use. i.e. you can't refill the free list from
xfs_alloc_ag_vextent_small() because it allocates blocks from ...

> In
> such corner case there will always be a lot of small extents at the
> front of the by-count tree, and any truncation changes to the first
> entry in the tree will not result in tree splits and triggering
> assertion failure.

If there are records we can use, then we'll allocate them from the
btree. Failure to allocate from the btree indicates something is
inconsistent, there's a bug in the code or we've got corruption
occuring. A corruption shutdown is the only safe course of action
when we find something confusing like this - if we guess wrong them
we'll only make the bad state/corruption worse.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2016-07-11 22:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07 11:01 [QUESTION] about the freelist allocator in XFS Kaho Ng
2016-07-07 12:13 ` Brian Foster
2016-07-07 22:28 ` Dave Chinner
     [not found]   ` <CAGeO4WNAdmeXgL4+CAQ1Yqo18XFgv3NZxWVbDTS0xDZLyb3e2w@mail.gmail.com>
2016-07-08  2:29     ` Fwd: " Kaho Ng
     [not found]     ` <20160708034710.GL12670@dastard>
2016-07-08  4:05       ` Kaho Ng
2016-07-08  5:48   ` Kaho Ng
2016-07-10 23:22     ` Dave Chinner
2016-07-11  7:06       ` Kaho Ng
2016-07-11 22:53         ` Dave Chinner [this message]
2016-07-08 19:17 ` Kaho Ng
2016-07-09 12:26   ` Kaho Ng
2016-07-10 16:57 ` Kaho Ng
2016-07-10 23:27   ` Dave Chinner

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=20160711225357.GG1922@dastard \
    --to=david@fromorbit.com \
    --cc=ngkaho1234@gmail.com \
    --cc=xfs@oss.sgi.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 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.