All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Andres Freund <andres@anarazel.de>,
	Alex Buell <alex.buell@munted.org.uk>
Cc: adilger@sun.com, LKML <linux-kernel@vger.kernel.org>,
	linux-ext4@vger.kernel.org,
	Jonathan Bastien-Filiatrault <joe@x2a.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: EXT4 ENOSPC Bug
Date: Mon, 16 Feb 2009 14:00:01 -0500	[thread overview]
Message-ID: <20090216190001.GB11788@mini-me.lan> (raw)
In-Reply-To: <20090216162028.3032666a@lithium.local.net> <499985C7.8010302@anarazel.de>

On Mon, Feb 16, 2009 at 04:27:03PM +0100, Andres Freund wrote:
>
> So, yes, seems to be an inode allocation problem.
>

Andres, Alex, others,

I'm pretty sure the ENOSPC problem which you both found is an inode
allocation problem.  Some of you seem to have an easier time
reproducing it than others; could you try this patch, and periodically
scan your system logs for the message "ext4: find_group_flex failed,
fallback succeeded"?  If the problem goes away for you, and you find
the occasional aforemention message in your system log, that will
confirm what I suspect, which is the bug is in fs/ext4/inode.c's
find_group_flex() function.  (If I'm wrong, the fallback code will
activate only when the filesystem is genuinely out of inodes, which
should be very rare.)

More comments are in the patch header.  My current long-term plan for
dealing with this is to enhance find_group_orlov() to and
find_group_other() to understand about flex_bg's.

							- Ted

commit 1012e25b371b203164e4766a98f1e696df68b56d
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Mon Feb 16 13:51:16 2009 -0500

    ext4: Add fallback for find_group_flex
    
    This is a workaround for find_group_flex() which badly needs to be
    replaced.  One of its problems (besides ignoring the Orlov algorithm)
    is that it is a bit hyperactive about returning failure under
    suspicious circumstances.  This can lead to spurious ENOSPC failures.
    Work around this for now by retrying the search using
    find_group_other() if find_group_flex() returns -1.  If
    find_group_other() succeeds when find_group_flex(), log a warning
    message.  I can't quite find the motivation to spend effort working on
    fixing find_group_flex() given that I want to replace it all anyway
    (and in fact work on the replacement code is underway), so we may
    leave the workaround for as long as find_group_flex() stays in the
    kernel...
    
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index a200059..21080ab 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -715,6 +715,13 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode)
 
 	if (sbi->s_log_groups_per_flex) {
 		ret2 = find_group_flex(sb, dir, &group);
+		if (ret2 == -1) {
+			ret2 = find_group_other(sb, dir, &group);
+			if (ret2 == 0)
+				printk(KERN_NOTICE "ext4: find_group_flex "
+				       "failed, fallback succeeded dir %lu\n",
+				       dir->i_ino);
+		}
 		goto got_group;
 	}
 

  reply	other threads:[~2009-02-16 19:00 UTC|newest]

Thread overview: 47+ 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
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 15:27         ` Andres Freund
2009-02-16 19:00         ` Theodore Tso [this message]
2009-02-17 17:21           ` Alex Buell
2009-02-17 17:36           ` Andres Freund
2009-02-17 17:36             ` Andres Freund
2009-02-18 21:18             ` 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  2:18                   ` Andres Freund
2009-02-19  3:22                   ` Theodore Tso
2009-02-19 15:46                     ` Eric Sandeen
2009-02-19 15:46                       ` Eric Sandeen
2009-02-23  2:02                       ` Theodore Tso
2009-02-27  3:57                 ` Andres Freund
2009-02-27  3:57                   ` Andres Freund
2009-02-17 18:13           ` Eric Sandeen
2009-02-17 18:13             ` Eric Sandeen
2009-02-17 20:08             ` Eric Sandeen
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
2009-02-17 20:08             ` Eric Sandeen

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=20090216190001.GB11788@mini-me.lan \
    --to=tytso@mit.edu \
    --cc=adilger@sun.com \
    --cc=alex.buell@munted.org.uk \
    --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 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.