From: Theodore Tso <tytso@mit.edu>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Jonathan Bastien-Filiatrault <joe@x2a.org>,
Andres Freund <andres@anarazel.de>,
Andreas Dilger <adilger@sun.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-ext4@vger.kernel.org
Subject: Re: EXT4 ENOSPC Bug
Date: Wed, 3 Dec 2008 12:23:09 -0500 [thread overview]
Message-ID: <20081203172309.GB30610@mit.edu> (raw)
In-Reply-To: <20081203153441.GD9481@skywalker>
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
On Wed, Dec 03, 2008 at 09:04:41PM +0530, Aneesh Kumar K.V wrote:
>
> Can you make sure you have the below patch in the kernel.
>
> c001077f4003fa75793bb62979baa6241dd8eb19
>
> commit c001077f4003fa75793bb62979baa6241dd8eb19
> Author: Eric Sandeen <sandeen@redhat.com>
> Date: Tue Aug 19 22:19:50 2008 -0400
>
> ext4: Fix bug where we return ENOSPC even though we have plenty of inodes
>
Mmmm, good point, thanks. I had been assuming this was caused by some
failure in the delayed allocation code with block accounting, but we
also had a bug fix that was causing a problem with inode allocation.
That doesn't explain a report of an ENOSPC error with metadata only
changes were failing (i.e., touching a file that already exists),
although I don't think we've gotten a lot of information about that
scenario and it feels a little unconfirmed to me still...
So, yes, this patch may solve the issue for you.
- Ted
[-- Attachment #2: 0001-ext4-Fix-bug-where-we-return-ENOSPC-even-though-we.patch --]
[-- Type: text/x-diff, Size: 1601 bytes --]
>From c001077f4003fa75793bb62979baa6241dd8eb19 Mon Sep 17 00:00:00 2001
From: Eric Sandeen <sandeen@redhat.com>
Date: Tue, 19 Aug 2008 22:19:50 -0400
Subject: [PATCH] ext4: Fix bug where we return ENOSPC even though we have plenty of inodes
The find_group_flex() function starts with best_flex as the
parent_fbg_group, which happens to have 0 inodes free. Some of the
flex groups searched have free blocks and free inodes, but the
flex_freeb_ratio is < 10, so they're skipped. Then when a group is
compared to the current "best" flex group, it does not have more free
blocks than "best", so it is skipped as well.
This continues until no flex group with free inodes is found which has
a proper ratio or which has more free blocks than the "best" group,
and we're left with a "best" group that has 0 inodes free, and we
return -ENOSPC.
We fix this by changing the logic so that if the current "best" flex
group has no inodes free, and the current one does have room, it is
promoted to the next "best."
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
fs/ext4/ialloc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 655e760..f344834 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -351,7 +351,7 @@ find_close_to_parent:
goto found_flexbg;
}
- if (best_flex < 0 ||
+ if (flex_group[best_flex].free_inodes == 0 ||
(flex_group[i].free_blocks >
flex_group[best_flex].free_blocks &&
flex_group[i].free_inodes))
--
1.6.0.4.8.g36f27.dirty
next prev parent reply other threads:[~2008-12-03 17:23 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-29 13:18 EXT4 ENOSPC Bug Andres Freund
2008-11-29 20:32 ` Jonathan Bastien-Filiatrault
2008-11-29 21:15 ` Theodore Tso
2008-11-29 21:31 ` Andres Freund
2008-12-01 12:34 ` Andres Freund
2008-12-01 19:42 ` Andreas Dilger
2008-12-01 20:16 ` Andres Freund
2008-12-02 7:57 ` Theodore Tso
2008-12-02 14:58 ` Andres Freund
2008-12-02 16:47 ` Theodore Tso
2008-12-02 17:47 ` Andres Freund
2008-12-02 20:33 ` Theodore Tso
2008-12-03 0:37 ` Jonathan Bastien-Filiatrault
2008-12-03 0:40 ` Jonathan Bastien-Filiatrault
2008-12-03 4:37 ` Theodore Tso
2008-12-03 15:34 ` Aneesh Kumar K.V
2008-12-03 17:23 ` Theodore Tso [this message]
2008-12-03 18:18 ` Andres Freund
2008-12-02 15:26 ` Henrique de Moraes Holschuh
2008-12-10 0:07 ` Andres Freund
2009-02-16 11:37 ` Andres Freund
2009-02-16 15:01 ` Theodore Tso
2009-02-16 15:27 ` Andres Freund
2009-02-16 19:00 ` Theodore Tso
2009-02-17 17:21 ` Alex Buell
2009-02-17 17:36 ` Andres Freund
2009-02-18 21:18 ` Andres Freund
2009-02-18 21:29 ` Theodore Tso
2009-02-19 2:18 ` Andres Freund
2009-02-19 3:22 ` Theodore Tso
2009-02-19 15:46 ` Eric Sandeen
2009-02-23 2:02 ` Theodore Tso
2009-02-27 3:57 ` Andres Freund
2009-02-17 18:13 ` Eric Sandeen
2009-02-17 20:08 ` Eric Sandeen
[not found] ` <499B1935.10906@redhat.com>
2009-02-17 22:00 ` Theodore Tso
2009-02-17 22:30 ` Alex Buell
2009-02-17 22:56 ` Eric Sandeen
2009-02-17 22:59 ` Alex Buell
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=20081203172309.GB30610@mit.edu \
--to=tytso@mit.edu \
--cc=adilger@sun.com \
--cc=andres@anarazel.de \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=joe@x2a.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).