Skip to content

Commit 08fb306

Browse files
Mingming CaoLinus Torvalds
authored andcommitted
[PATCH] ext3 filesystem bogus ENOSPC with reservation fix
To handle 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 fixes this. Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 607eb26 commit 08fb306

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/ext3/balloc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,12 +1269,12 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
12691269
goal = le32_to_cpu(es->s_first_data_block);
12701270
group_no = (goal - le32_to_cpu(es->s_first_data_block)) /
12711271
EXT3_BLOCKS_PER_GROUP(sb);
1272+
goal_group = group_no;
1273+
retry_alloc:
12721274
gdp = ext3_get_group_desc(sb, group_no, &gdp_bh);
12731275
if (!gdp)
12741276
goto io_error;
12751277

1276-
goal_group = group_no;
1277-
retry:
12781278
free_blocks = le16_to_cpu(gdp->bg_free_blocks_count);
12791279
/*
12801280
* if there is not enough free blocks to make a new resevation
@@ -1349,7 +1349,7 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
13491349
if (my_rsv) {
13501350
my_rsv = NULL;
13511351
group_no = goal_group;
1352-
goto retry;
1352+
goto retry_alloc;
13531353
}
13541354
/* No space left on the device */
13551355
*errp = -ENOSPC;

0 commit comments

Comments
 (0)