diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-02-21 12:13:24 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-02-21 12:13:24 -0500 |
commit | 05bf9e839d9de4e8a094274a0a2fd07beb47eaf1 (patch) | |
tree | 36dba549ded1f7c7b37bd854fb20d55bff89787d /fs | |
parent | 20f4d6c3a2a23c5d7d9cc7f42fbb943ca7a03d1f (diff) |
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
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/ialloc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 4fb86a0061d0..f18a919be70b 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) | |||
715 | 715 | ||
716 | if (sbi->s_log_groups_per_flex) { | 716 | if (sbi->s_log_groups_per_flex) { |
717 | ret2 = find_group_flex(sb, dir, &group); | 717 | ret2 = find_group_flex(sb, dir, &group); |
718 | if (ret2 == -1) { | ||
719 | ret2 = find_group_other(sb, dir, &group); | ||
720 | if (ret2 == 0 && printk_ratelimit()) | ||
721 | printk(KERN_NOTICE "ext4: find_group_flex " | ||
722 | "failed, fallback succeeded dir %lu\n", | ||
723 | dir->i_ino); | ||
724 | } | ||
718 | goto got_group; | 725 | goto got_group; |
719 | } | 726 | } |
720 | 727 | ||