Skip to content

Commit

Permalink
GFS2: Fix infinite loop in rbm_find
Browse files Browse the repository at this point in the history
This patch fixes an infinite loop in gfs2_rbm_find that was introduced
by the previous patch. The problem occurred when the length was less
than 3 but the rbm block was byte-aligned, causing it to improperly
return a extent length of zero, which caused it to spin.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Tested-by: Bob Peterson <rpeterso@redhat.com>
Tested-by: Barry Marson <bmarson@redhat.com>
  • Loading branch information
Bob Peterson authored and Steven Whitehouse committed Sep 24, 2012
1 parent ff7f4cb commit 3701530
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/gfs2/rgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ static u32 gfs2_free_extlen(const struct gfs2_rbm *rrbm, u32 len)
gfs2_unaligned_extlen(&rbm, 4 - n_unaligned, &len))
goto out;

n_unaligned = len & 3;
/* Start is now byte aligned */
while (len > 3) {
start = rbm.bi->bi_bh->b_data;
Expand Down

0 comments on commit 3701530

Please sign in to comment.