linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [patch] Fix orlov allocator boundary case
Date: Thu, 17 Apr 2003 12:21:42 -0700	[thread overview]
Message-ID: <20030417122142.39d27f73.akpm@digeo.com> (raw)
In-Reply-To: <20030417111303.706d7246.shemminger@osdl.org>

Stephen Hemminger <shemminger@osdl.org> wrote:
>
> Recent (post 2.5.67) versions of the kernel break the creation
> of the initial ram disk.

OK, here be the fix.

I'm a bit peeved that this wasn't discovered until it hit Linus's tree. 
Weren't these patches in -mjb as well?





In the interests of SMP scalability the ext2 free blocks and free inodes
counters are "approximate".  But there is a piece of code in the Orlov
allocator which fails due to boundary conditions on really small
filesystems.

Fix that up via a final allocation pass which simply uses first-fit for
allocation of a directory inode.


 fs/ext2/ialloc.c |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -puN fs/ext2/ialloc.c~orlov-approx-counter-fix fs/ext2/ialloc.c
--- 25/fs/ext2/ialloc.c~orlov-approx-counter-fix	2003-04-17 12:12:33.000000000 -0700
+++ 25-akpm/fs/ext2/ialloc.c	2003-04-17 12:14:09.000000000 -0700
@@ -410,6 +410,15 @@ fallback:
 			goto found;
 	}
 
+	if (avefreei) {
+		/*
+		 * The free-inodes counter is approximate, and for really small
+		 * filesystems the above test can fail to find any blockgroups
+		 */
+		avefreei = 0;
+		goto fallback;
+	}
+
 	return -1;
 
 found:

_


  parent reply	other threads:[~2003-04-17 19:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-17 18:13 Recent changes broke mkinitrd? Stephen Hemminger
2003-04-17 18:40 ` Andrew Morton
2003-04-17 19:58   ` Stephen Hemminger
2003-04-17 19:21 ` Andrew Morton [this message]
2003-04-17 20:25   ` [patch] Fix orlov allocator boundary case Stephen Hemminger
2003-04-17 21:27   ` Marc-Christian Petersen
2003-04-17 21:57     ` Andrew Morton

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=20030417122142.39d27f73.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@osdl.org \
    --cc=torvalds@transmeta.com \
    /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).