diff options
| author | Bob Peterson <rpeterso@redhat.com> | 2012-12-20 13:21:07 -0500 |
|---|---|---|
| committer | Steven Whitehouse <swhiteho@redhat.com> | 2013-01-02 05:05:10 -0500 |
| commit | 15bd50ad82a6d3421af1abe82e2554898abc4141 (patch) | |
| tree | f23d595b1306ad4cddf64c181ac831af8cb3042d /fs | |
| parent | f1213cacc7ffc7d4cdef3692f22b28a2df3216f5 (diff) | |
GFS2: Stop looking for free blocks at end of rgrp
This patch adds a return code check after calling function
gfs2_rbm_from_block while determining the free extent size.
That way, when the end of an rgrp is reached, it won't try
to process unaligned blocks after the end.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/gfs2/rgrp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 738b3888adc..712dd4fd864 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
| @@ -350,10 +350,14 @@ static u32 gfs2_free_extlen(const struct gfs2_rbm *rrbm, u32 len) | |||
| 350 | BUG_ON(len < chunk_size); | 350 | BUG_ON(len < chunk_size); |
| 351 | len -= chunk_size; | 351 | len -= chunk_size; |
| 352 | block = gfs2_rbm_to_block(&rbm); | 352 | block = gfs2_rbm_to_block(&rbm); |
| 353 | gfs2_rbm_from_block(&rbm, block + chunk_size); | 353 | if (gfs2_rbm_from_block(&rbm, block + chunk_size)) { |
| 354 | n_unaligned = 3; | 354 | n_unaligned = 0; |
| 355 | if (ptr) | ||
| 356 | break; | 355 | break; |
| 356 | } | ||
| 357 | if (ptr) { | ||
| 358 | n_unaligned = 3; | ||
| 359 | break; | ||
| 360 | } | ||
| 357 | n_unaligned = len & 3; | 361 | n_unaligned = len & 3; |
| 358 | } | 362 | } |
| 359 | 363 | ||
