ext4: Add fallback for find_group_flex
authorTheodore Ts'o <tytso@mit.edu>
Thu, 5 Mar 2009 07:34:06 +0000 (02:34 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Mar 2009 00:53:06 +0000 (17:53 -0700)
commit3d2f446880e9c0cd89aed563dae0d34d379a0826
treee8085c170a6d449b1a0db3128774572424af2f91
parente843ff53f46be9aab2db1d784b45bccfc3bd9257
ext4: Add fallback for find_group_flex

(cherry picked from commit 05bf9e839d9de4e8a094274a0a2fd07beb47eaf1)

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
even when there are inodes still available.

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() has failed, log a
warning message.

A better block/inode allocator that will fix this problem for real has
been queued up for the next merge window.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/ialloc.c