diff options
Diffstat (limited to 'fs/xfs/libxfs/xfs_alloc.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_alloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index eef466260d43..75dbdc14c45f 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c | |||
@@ -223,12 +223,13 @@ xfs_alloc_get_rec( | |||
223 | error = xfs_btree_get_rec(cur, &rec, stat); | 223 | error = xfs_btree_get_rec(cur, &rec, stat); |
224 | if (error || !(*stat)) | 224 | if (error || !(*stat)) |
225 | return error; | 225 | return error; |
226 | if (rec->alloc.ar_blockcount == 0) | ||
227 | goto out_bad_rec; | ||
228 | 226 | ||
229 | *bno = be32_to_cpu(rec->alloc.ar_startblock); | 227 | *bno = be32_to_cpu(rec->alloc.ar_startblock); |
230 | *len = be32_to_cpu(rec->alloc.ar_blockcount); | 228 | *len = be32_to_cpu(rec->alloc.ar_blockcount); |
231 | 229 | ||
230 | if (*len == 0) | ||
231 | goto out_bad_rec; | ||
232 | |||
232 | /* check for valid extent range, including overflow */ | 233 | /* check for valid extent range, including overflow */ |
233 | if (!xfs_verify_agbno(mp, agno, *bno)) | 234 | if (!xfs_verify_agbno(mp, agno, *bno)) |
234 | goto out_bad_rec; | 235 | goto out_bad_rec; |