diff options
Diffstat (limited to 'ext2fs')
| -rw-r--r-- | ext2fs/Makefile | 3 | ||||
| -rw-r--r-- | ext2fs/balloc.c | 7 | ||||
| -rw-r--r-- | ext2fs/bitmap.c | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/ext2fs/Makefile b/ext2fs/Makefile index e83aab26..8e16ebe6 100644 --- a/ext2fs/Makefile +++ b/ext2fs/Makefile @@ -1,6 +1,6 @@ # Makefile for ext2fs # -# Copyright (C) 1994,95,96,99,2000,02 Free Software Foundation, Inc. +# Copyright (C) 1994,95,96,99,2000,02,12 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -23,7 +23,6 @@ target = ext2fs SRCS = balloc.c dir.c ext2fs.c getblk.c hyper.c ialloc.c \ inode.c pager.c pokel.c truncate.c storeinfo.c msg.c xinl.c OBJS = $(SRCS:.c=.o) -LCLHDRS = ext2fs.h ext2_fs.h ext2_fs_i.h bitmap.c HURDLIBS = diskfs pager iohelp fshelp store threads ports ihash shouldbeinlibc include ../Makeconf diff --git a/ext2fs/balloc.c b/ext2fs/balloc.c index 7333123c..7fe82ba0 100644 --- a/ext2fs/balloc.c +++ b/ext2fs/balloc.c @@ -197,8 +197,11 @@ repeat: * The goal was occupied; search forward for a free * block within the next 32 blocks */ - lmap = ((((unsigned long *) bh)[j >> 5]) >> - ((j & 31) + 1)); + if ((j & 31) == 31) + lmap = 0; + else + lmap = ((((unsigned long *) bh)[j >> 5]) >> + ((j & 31) + 1)); if (j < sblock->s_blocks_per_group - 32) lmap |= (((unsigned long *) bh)[(j >> 5) + 1]) << (31 - (j & 31)); diff --git a/ext2fs/bitmap.c b/ext2fs/bitmap.c index e512d011..92850232 100644 --- a/ext2fs/bitmap.c +++ b/ext2fs/bitmap.c @@ -91,6 +91,8 @@ find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) found_first: tmp |= ~0UL << size; + if (!~tmp) + return result + size; found_middle: return result + ffz(tmp); } |
