From: Christoph Hellwig <hch@infradead.org>
To: David Chinner <dgc@sgi.com>
Cc: xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH 2/2] Prevent shutdown on inode allocation failure
Date: Thu, 20 Mar 2008 03:47:24 -0400 [thread overview]
Message-ID: <20080320074724.GG19969@infradead.org> (raw)
In-Reply-To: <20080320052100.GA95344431@sgi.com>
On Thu, Mar 20, 2008 at 04:21:00PM +1100, David Chinner wrote:
> At ENOSPC, we can get a filesystem shutdown due to a cancelling a
> dirty transaction in xfs_mkdir or xfs_create. This is due to the
> initial allocation attempt not taking into inode alignment and hence
> we can prepare the AGF freelist for allocation when it's not actually
> possible to do an allocation. This results in inode allocation returning
> ENOSPC with a dirty transaction, and hence we shut down the filesystem.
>
> Because the first allocation is an exact allocation attempt, we must tell
> the allocator that the alignment does not affect the allocation attempt.
> i.e. we will accept any extent alignment as long as the extent starts
> at the block we want. Unfortunately, this means that if the longest
> free extent is less than the length + alignment necessary for fallback
> allocation attempts but is long enough to attempt a non-aligned allocation,
> we will modify the free list.
>
> If we then have the exact allocation fail, all other allocation attempts
> will also fail due to the alignment constraint being taken into account.
> Hence the initial attempt needs to set the "alignment slop" field so
> that alignment, while not required, must be taken into account when
> determining if there is enough space left in the AG to do the allocation.
>
> That means if the exact allocation fails, we will not dirty the freelist
> if there is not enough space available fo a subsequent allocation to
> succeed. Hence we get an ENOSPC error back to userspace without shutting
> down the filesystem.
Looks good.
prev parent reply other threads:[~2008-03-20 7:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-20 5:21 [PATCH 2/2] Prevent shutdown on inode allocation failure David Chinner
2008-03-20 7:47 ` Christoph Hellwig [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=20080320074724.GG19969@infradead.org \
--to=hch@infradead.org \
--cc=dgc@sgi.com \
--cc=xfs-dev@sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox