Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132435
b: refs/heads/master
c: d33a197
h: refs/heads/master
i:
  132433: 3c59882
  132431: 0d8e57e
v: v3
  • Loading branch information
Eric Sandeen authored and Theodore Ts'o committed Mar 17, 2009
1 parent 9dc1422 commit 2d83446
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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: 8d03c7a0c550e7ab24cadcef5e66656bfadec8b9
refs/heads/master: d33a1976fbee1ee321d6f014333d8f03a39d526c
9 changes: 7 additions & 2 deletions trunk/fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3589,6 +3589,7 @@ static void ext4_mb_put_pa(struct ext4_allocation_context *ac,
struct super_block *sb, struct ext4_prealloc_space *pa)
{
ext4_group_t grp;
ext4_fsblk_t grp_blk;

if (!atomic_dec_and_test(&pa->pa_count) || pa->pa_free != 0)
return;
Expand All @@ -3603,8 +3604,12 @@ static void ext4_mb_put_pa(struct ext4_allocation_context *ac,
pa->pa_deleted = 1;
spin_unlock(&pa->pa_lock);

/* -1 is to protect from crossing allocation group */
ext4_get_group_no_and_offset(sb, pa->pa_pstart - 1, &grp, NULL);
grp_blk = pa->pa_pstart;
/* If linear, pa_pstart may be in the next group when pa is used up */
if (pa->pa_linear)
grp_blk--;

ext4_get_group_no_and_offset(sb, grp_blk, &grp, NULL);

/*
* possible race:
Expand Down

0 comments on commit 2d83446

Please sign in to comment.