[PATCH 1/3] ex3 filesystem bogus ENOSPC with reservation fix

Mingming Cao <[email protected]> Tue, 22 Aug 2006 17:52:00 -0700
Newsgroups gmane.comp.file-systems.ext2.devel
Organization IBM LTC
Message-ID <[email protected]>
To handling the earlier bogus ENOSPC error caused by filesystem full of
block reservation, current code falls back to non block reservation,
starts to allocate block(s) from the goal allocation block group as if
there is no block reservation.

Current code needs to re-load the corresponding block group descriptor
for the initial goal block group in this case. The patch fixed this.

Patches against 2.6.18-rc4-mm2 kernel

Signed-Off-By: Mingming Cao <[email protected]>

---

 linux-2.6.18-rc4-ming/fs/ext3/balloc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN fs/ext3/balloc.c~ext3_reservation_fall_back-fix fs/ext3/balloc.c
--- linux-2.6.18-rc4/fs/ext3/balloc.c~ext3_reservation_fall_back-fix	2006-08-11 17:26:32.456624727 -0700
+++ linux-2.6.18-rc4-ming/fs/ext3/balloc.c	2006-08-11 17:40:15.397231704 -0700
@@ -1269,12 +1269,12 @@ ext3_fsblk_t ext3_new_blocks(handle_t *h
 		goal = le32_to_cpu(es->s_first_data_block);
 	group_no = (goal - le32_to_cpu(es->s_first_data_block)) /
 			EXT3_BLOCKS_PER_GROUP(sb);
+	goal_group = group_no;
+retry_alloc:
 	gdp = ext3_get_group_desc(sb, group_no, &gdp_bh);
 	if (!gdp)
 		goto io_error;
 
-	goal_group = group_no;
-retry:
 	free_blocks = le16_to_cpu(gdp->bg_free_blocks_count);
 	/*
 	 * if there is not enough free blocks to make a new resevation
@@ -1349,7 +1349,7 @@ retry:
 	if (my_rsv) {
 		my_rsv = NULL;
 		group_no = goal_group;
-		goto retry;
+		goto retry_alloc;
 	}
 	/* No space left on the device */
 	*errp = -ENOSPC;

_



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642