public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Cc: "Jose R. Santos" <jrs@us.ibm.com>
Subject: [PATCH, RFC] ext4: flex_bg ialloc, don't pick "best_flex" with 0 inodes
Date: Fri, 15 Aug 2008 17:01:10 -0500	[thread overview]
Message-ID: <48A5FCA6.5070902@redhat.com> (raw)

I've got a case where I have a 99G fs with 17G free, as well
as 400k free inodes, and yet I cannot create a new inode.

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.

It seems like adjusting the following test is a better plan;
for starters I do not see that best_flex can ever be < 0, so
that test is replaced, and if the current "best" flex group
has no inodes free, and the current one does have room,
it is promoted to the next "best."

Comments?

Signed-of-by: Eric Sandeen <sandeen@redhat.com>
---

Index: linux-2.6/fs/ext4/ialloc.c
===================================================================
--- linux-2.6.orig/fs/ext4/ialloc.c	2008-08-04 15:30:30.000000000 -0500
+++ linux-2.6/fs/ext4/ialloc.c	2008-08-15 16:12:47.366515679 -0500
@@ -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))


             reply	other threads:[~2008-08-15 22:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-15 22:01 Eric Sandeen [this message]
2008-08-16 15:25 ` [PATCH, RFC] ext4: flex_bg ialloc, don't pick "best_flex" with 0 inodes Theodore Tso
2008-08-16 17:35   ` 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=48A5FCA6.5070902@redhat.com \
    --to=sandeen@redhat.com \
    --cc=jrs@us.ibm.com \
    --cc=linux-ext4@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