Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112939
b: refs/heads/master
c: 68629f2
h: refs/heads/master
i:
  112937: 8942de6
  112935: 4da79e0
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Theodore Ts'o committed Sep 9, 2008
1 parent cdb7bc6 commit 6a399e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c79161689aede2d487d707d5931a22eadf66120
refs/heads/master: 68629f29c6764c37ebdceec2f6bbef6637eaf420
18 changes: 10 additions & 8 deletions trunk/fs/ext4/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1804,15 +1804,17 @@ ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode,
goto io_error;

free_blocks = le16_to_cpu(gdp->bg_free_blocks_count);
/*
* if there is not enough free blocks to make a new resevation
* turn off reservation for this allocation
*/
if (my_rsv && (free_blocks < windowsz)
&& (rsv_is_empty(&my_rsv->rsv_window)))
my_rsv = NULL;

if (free_blocks > 0) {
/*
* try to allocate with group target block
* in the goal group. If we have low free_blocks
* count turn off reservation
*/
if (my_rsv && (free_blocks < windowsz)
&& (rsv_is_empty(&my_rsv->rsv_window)))
my_rsv = NULL;

bitmap_bh = ext4_read_block_bitmap(sb, group_no);
if (!bitmap_bh)
goto io_error;
Expand Down Expand Up @@ -1845,7 +1847,7 @@ ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode,
* free blocks is less than half of the reservation
* window size.
*/
if (free_blocks <= (windowsz/2))
if (my_rsv && (free_blocks <= (windowsz/2)))
continue;

brelse(bitmap_bh);
Expand Down

0 comments on commit 6a399e1

Please sign in to comment.