summaryrefslogtreecommitdiff
path: root/ext2fs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-07-01 02:20:08 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-07-01 02:20:08 +0000
commit953c525d7589178629f3e91e4bf4ea805a92a5b4 (patch)
tree9411cddbd2f213fe4edf2150e2e8b02a9d27b4bf /ext2fs
parent13ea39a34766fcbecd96ab94bcdf798b08e9bb60 (diff)
parent5430151902aa7cb17458c0d71722a05fd379babf (diff)
Merge branch 'master' into xkb
Conflicts: console-client/Makefile
Diffstat (limited to 'ext2fs')
-rw-r--r--ext2fs/Makefile3
-rw-r--r--ext2fs/balloc.c7
-rw-r--r--ext2fs/bitmap.c2
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);
}