Skip to content

Commit d074912

Browse files
AstralBobgregkh
authored andcommitted
gfs2: Don't reject a supposedly full bitmap if we have blocks reserved
[ Upstream commit e79e0e1 ] Before this patch, you could get into situations like this: 1. Process 1 searches for X free blocks, finds them, makes a reservation 2. Process 2 searches for free blocks in the same rgrp, but now the bitmap is full because process 1's reservation is skipped over. So it marks the bitmap as GBF_FULL. 3. Process 1 tries to allocate blocks from its own reservation, but since the GBF_FULL bit is set, it skips over the rgrp and searches elsewhere, thus not using its own reservation. This patch adds an additional check to allow processes to use their own reservations. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b435dd6 commit d074912

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/gfs2/rgrp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,8 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext,
16651665

16661666
while(1) {
16671667
bi = rbm_bi(rbm);
1668-
if (test_bit(GBF_FULL, &bi->bi_flags) &&
1668+
if ((ip == NULL || !gfs2_rs_active(&ip->i_res)) &&
1669+
test_bit(GBF_FULL, &bi->bi_flags) &&
16691670
(state == GFS2_BLKST_FREE))
16701671
goto next_bitmap;
16711672

0 commit comments

Comments
 (0)