diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2007-03-14 13:56:43 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2007-03-14 13:56:43 +0000 |
commit | 3791d125281be71614952b7f4bef91e29af38912 (patch) | |
tree | 26da41864034c5077e63ee06ad069d8a4fd0ab68 | |
parent | ce0fe5f5f705e76d091701350758197ce4a9f78a (diff) |
Check if there are still blocks left to be allocated _after_ we have
read in the bitmap (an operation that might cause us to sleep), and
before committing to the allocation. Fixes PR 5230, okay krw@, millert@.
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_alloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_alloc.c b/sys/ufs/ext2fs/ext2fs_alloc.c index 7992ff86ca2..25e41ea6fba 100644 --- a/sys/ufs/ext2fs/ext2fs_alloc.c +++ b/sys/ufs/ext2fs/ext2fs_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_alloc.c,v 1.20 2005/12/11 20:46:28 pedro Exp $ */ +/* $OpenBSD: ext2fs_alloc.c,v 1.21 2007/03/14 13:56:42 pedro Exp $ */ /* $NetBSD: ext2fs_alloc.c,v 1.10 2001/07/05 08:38:27 toshii Exp $ */ /* @@ -341,7 +341,7 @@ ext2fs_alloccg(ip, cg, bpref, size) error = bread(ip->i_devvp, fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_b_bitmap), (int)fs->e2fs_bsize, NOCRED, &bp); - if (error) { + if (error || fs->e2fs_gd[cg].ext2bgd_nbfree == 0) { brelse(bp); return (0); } |