]> git.hungrycats.org Git - linux/commit
[PATCH] ext2 block allocator fixes
authorAndrew Morton <akpm@osdl.org>
Tue, 18 Nov 2003 16:16:07 +0000 (08:16 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 18 Nov 2003 16:16:07 +0000 (08:16 -0800)
commita9bca0184042b03b80a0514d015f20b9425eeea9
tree743d44d4dfb86adb5f4eaf9c884ea7f3e53cc90d
parentbc5de0cdb593cf9f8b8df9a8de6f81a0822c7ed5
[PATCH] ext2 block allocator fixes

Fix a couple of problems which were introduced by a recent race fix in the
ext2 block allocator:

- if the allocation attempt raced, and lost the race then a new attempt is
  made.  But the earlier reservation must be put back first.

  Add a call to group_release_blocks() to fix this.

- if the filesystem is genuinely corrupted then the code as-is can get
  stuck in an infinite loop, thinking that a blockgroup has free blocks and
  then discovering that its bitmap is full.

  Fix this by baling out after having scanned all blockgroups twice.

  (Thanks Muli Ben-Yehuda <mulix@mulix.org> for spotting this).
fs/ext2/balloc.c