diff options
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | RELEASE-NOTES | 53 | ||||
-rwxr-xr-x | configure | 64 | ||||
-rw-r--r-- | configure.in | 46 | ||||
-rw-r--r-- | contrib/make-sparse.c | 8 | ||||
-rw-r--r-- | debian/changelog | 33 | ||||
-rw-r--r-- | debian/control.in | 45 | ||||
-rwxr-xr-x | debian/rules | 62 | ||||
-rw-r--r-- | doc/libext2fs.texinfo | 8 | ||||
-rw-r--r-- | e2fsck/unix.c | 9 | ||||
-rw-r--r-- | e2fsprogs.lsm | 10 | ||||
-rw-r--r-- | lib/blkid/probe.c | 17 | ||||
-rw-r--r-- | lib/ext2fs/gen_bitmap.c | 2 | ||||
-rw-r--r-- | lib/ext2fs/mkjournal.c | 20 | ||||
-rw-r--r-- | misc/dumpe2fs.c | 44 | ||||
-rw-r--r-- | misc/e2freefrag.8.in | 2 | ||||
-rw-r--r-- | misc/mke2fs.8.in | 59 | ||||
-rw-r--r-- | misc/mke2fs.conf | 4 | ||||
-rw-r--r-- | misc/tune2fs.8.in | 23 | ||||
-rw-r--r-- | resize/main.c | 2 | ||||
-rw-r--r-- | resize/resize2fs.c | 20 | ||||
-rw-r--r-- | version.h | 4 |
22 files changed, 334 insertions, 203 deletions
@@ -1,4 +1,4 @@ - This is the new version (1.41.8) of the second extended file + This is the new version (1.41.9) of the second extended file system management programs. From time to time, I release new versions of e2fsprogs, to fix diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9cf84424..77045e16 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -1,5 +1,36 @@ -E2fsprogs 1.41.9-WIP (July 20, 2009) commit 8b5ed492de -==================================== +E2fsprogs 1.41.9 (August 22, 2009) +================================== + +Fix a bug in e2fsck routines for reallocating an inode table which +could cause it to loop forever on an ext4 filesystem with the FLEX_BG +filesystem feature with a relatively rare (and specific) filesystem +corruption. This fix causes e2fsck to try to find space for a new +portion of the inode table in the containing flex_bg, and if that +fails, the new portion of the inode table will be allocated in any +free space available in the filesystem. + +Make e2fsck less annoying by only asking for permission to relocate a +block group's inode table once, instead of for every overlapping +block. Similarly, only ask once to recompute the block group +checksums, instead of once for each corrupted block group's checksum. + +Fix filefrag to avoid print the extent header if the FIEMAP ioctl is +not present, and it needs to fall back to using the FIBMAP ioctl. + +Fix filefrag to correctly print the number of extents for zero-length +files. (Addresses Debian Bug: #540376) + +Filefrag now has a -B option which forces the use of the FIBMAP ioctl +to more easily debug the FIBMAP code. + +Fixed filefrag for non-extent based files. + +Add a new program, e2freefrag, which displays information about the +free space fragmentation in an ext2/3/4 filesystem. + +Fix inode resizing via tune2fs -I so that it works correctly in the +face of non-empty bad blocks inodes, and if the filesystem was +formatted using the "mke2fs -E stride=N" option for RAID arrays. Fix regression in ext2fs_extent_set_bmap() caused e2fsck -fD to fail and corrupt large directories if the directory needs to shrink by more @@ -10,8 +41,18 @@ last mount times are in the future, they are corrected even if buggy_init_scripts is set. This is needed because otherwise resize2fs will refuse to resize the filesystem, even after running "e2fsck -f". (Addresses Launchpad bug: #373409) + +E2fsck will now print much fuller information when the last mount time +or last written time is in the future, since most people can't seem to +believe their distribution has buggy init scripts, or they have a +failed CMOS/RTS clock battery. + +Enhance dumpe2fs to dump the extent information via the 'stat' +command, and more detailed extent information via the new command +'dump_extents'. -Fixed filefrag for non-extent based files. +Update French, Polish, Czech, and Sweedish translation from the +Translation Project. Fixed various Debian packaging issues --- see debian/changelog for details. @@ -26,6 +67,12 @@ Fixed memory leak in error path in ext2fs_block_iterate2() Fixed non-Linux build of the intl directory by adding support for the E/Q/V macros. +The bitmap read/write functions now treat uninitialized bitmaps as +unallocated; this fixes a number of problems in all e2fsprogs for ext4 +filesystems when there is a need to allocate new blocks or inodes, and +there aren't any free blocks or inodes in the already-used block +groups. + Improve ext2fs_extent_set_bmap() to avoid creating new extents which get inserted into the extent tree when they are not needed. @@ -752,7 +752,6 @@ MAINTAINER_CMT LINUX_INCLUDE EGREP GREP -LD CPP OBJEXT EXEEXT @@ -823,7 +822,6 @@ ac_user_opts=' enable_option_checking with_diet_libc with_cc -with_linker with_ccopts with_ldopts with_root_prefix @@ -1514,10 +1512,9 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-diet-libc use diet libc - --with-cc=COMPILER select compiler to use - --with-linker=LINKER select linker to use - --with-ccopts=CCOPTS select compiler command line options - --with-ldopts=LDOPTS select linker command line options + --with-cc no longer supported, use CC= instead + --with-ccopts no longer supported, use CFLAGS= instead + --with-ldopts no longer supported, use LDFLAGS= instead --with-root-prefix=PREFIX override prefix variable for files to be placed in the root --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib @@ -2163,15 +2160,26 @@ fi # Check whether --with-cc was given. if test "${with_cc+set}" = set; then - withval=$with_cc; { $as_echo "$as_me:$LINENO: result: CC=$withval" >&5 -$as_echo "CC=$withval" >&6; } -CC=$withval -else - if test -z "$CC" ; then CC=cc; fi -{ $as_echo "$as_me:$LINENO: result: CC defaults to $CC" >&5 -$as_echo "CC defaults to $CC" >&6; } + withval=$with_cc; { { $as_echo "$as_me:$LINENO: error: --with-cc no longer supported; use CC= instead" >&5 +$as_echo "$as_me: error: --with-cc no longer supported; use CC= instead" >&2;} + { (exit 1); exit 1; }; } +fi + + +# Check whether --with-ccopts was given. +if test "${with_ccopts+set}" = set; then + withval=$with_ccopts; { { $as_echo "$as_me:$LINENO: error: --with-ccopts no longer supported; use CFLAGS= instead" >&5 +$as_echo "$as_me: error: --with-ccopts no longer supported; use CFLAGS= instead" >&2;} + { (exit 1); exit 1; }; } +fi + + +# Check whether --with-ldopts was given. +if test "${with_ldopts+set}" = set; then + withval=$with_ldopts; { { $as_echo "$as_me:$LINENO: error: --with-ldopts no longer supported; use LDFLAGS= instead" >&5 +$as_echo "$as_me: error: --with-ldopts no longer supported; use LDFLAGS= instead" >&2;} + { (exit 1); exit 1; }; } fi -export CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3343,26 +3351,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Check whether --with-linker was given. -if test "${with_linker+set}" = set; then - withval=$with_linker; { $as_echo "$as_me:$LINENO: result: LD=$withval" >&5 -$as_echo "LD=$withval" >&6; } -LD=$withval -else - if test -z "$LD" ; then LD=$CC; fi -{ $as_echo "$as_me:$LINENO: result: LD defaults to $LD" >&5 -$as_echo "LD defaults to $LD" >&6; } -fi -export LD - - -# Check whether --with-ccopts was given. -if test "${with_ccopts+set}" = set; then - withval=$with_ccopts; { $as_echo "$as_me:$LINENO: result: CCOPTS is $withval" >&5 -$as_echo "CCOPTS is $withval" >&6; } -CFLAGS=$withval -fi - { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } @@ -3908,14 +3896,6 @@ LIB_EXT=.a STATIC_LIB_EXT=.a PROFILED_LIB_EXT=.a -# Check whether --with-ldopts was given. -if test "${with_ldopts+set}" = set; then - withval=$with_ldopts; { $as_echo "$as_me:$LINENO: result: LDFLAGS is $withval" >&5 -$as_echo "LDFLAGS is $withval" >&6; } -LDFLAGS=$withval -fi - - # Check whether --with-root-prefix was given. if test "${with_root_prefix+set}" = set; then withval=$with_root_prefix; root_prefix=$withval diff --git a/configure.in b/configure.in index 7ed3d4dd..4bb5b087 100644 --- a/configure.in +++ b/configure.in @@ -72,37 +72,20 @@ CC="diet cc -nostdinc" WITH_DIET_LIBC=yes AC_MSG_RESULT(CC=$CC))dnl dnl -dnl set $(CC) from --with-cc=value -dnl AC_ARG_WITH([cc], -[ --with-cc=COMPILER select compiler to use], -AC_MSG_RESULT(CC=$withval) -CC=$withval, -if test -z "$CC" ; then CC=cc; fi -[AC_MSG_RESULT(CC defaults to $CC)])dnl -export CC -AC_SUBST([CC]) -AC_PROG_CC -AC_PROG_CPP +AC_HELP_STRING([--with-cc],[no longer supported, use CC= instead]), +AC_MSG_ERROR([--with-cc no longer supported; use CC= instead])) dnl -dnl set $(LD) from --with-linker=value -dnl -AC_ARG_WITH([linker], -[ --with-linker=LINKER select linker to use], -AC_MSG_RESULT(LD=$withval) -LD=$withval, -if test -z "$LD" ; then LD=$CC; fi -[AC_MSG_RESULT(LD defaults to $LD)])dnl -export LD -AC_SUBST([LD]) +AC_ARG_WITH([ccopts], +AC_HELP_STRING([--with-ccopts],[no longer supported, use CFLAGS= instead]), +AC_MSG_ERROR([--with-ccopts no longer supported; use CFLAGS= instead])) dnl -dnl set $(CCOPTS) from --with-ccopts=value +AC_ARG_WITH([ldopts], +AC_HELP_STRING([--with-ldopts],[no longer supported, use LDFLAGS= instead]), +AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead])) dnl -AC_ARG_WITH([ccopts], -[ --with-ccopts=CCOPTS select compiler command line options], -AC_MSG_RESULT(CCOPTS is $withval) -CFLAGS=$withval, -)dnl +AC_PROG_CC +AC_PROG_CPP dnl dnl On systems without linux header files, we add an extra include directory dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here @@ -138,15 +121,6 @@ LIB_EXT=.a STATIC_LIB_EXT=.a PROFILED_LIB_EXT=.a dnl -dnl set $(LDFLAGS) from --with-ldopts=value -dnl -AC_ARG_WITH([ldopts], -[ --with-ldopts=LDOPTS select linker command line options], -AC_MSG_RESULT(LDFLAGS is $withval) -LDFLAGS=$withval, -)dnl -AC_SUBST(LDFLAGS) -dnl dnl Allow separate `root_prefix' to be specified dnl AC_ARG_WITH([root-prefix], diff --git a/contrib/make-sparse.c b/contrib/make-sparse.c index 4a7a3155..1b3d5506 100644 --- a/contrib/make-sparse.c +++ b/contrib/make-sparse.c @@ -48,6 +48,7 @@ int full_read(int fd, char *buf, size_t count) int main(int argc, char **argv) { int fd, got, i; + int zflag = 0; char buf[1024]; if (argc != 2) { @@ -69,11 +70,18 @@ int main(int argc, char **argv) break; if (i == sizeof(buf)) { lseek(fd, sizeof(buf), SEEK_CUR); + zflag = 1; continue; } } + zflag = 0; write(fd, buf, got); } + if (zflag) { + lseek(fd, -1, SEEK_CUR); + buf[0] = 0; + write(fd, buf, 1); + } return 0; } diff --git a/debian/changelog b/debian/changelog index 12edfebe..f3317db0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,36 @@ +e2fsprogs (1.41.9-1) unstable; urgency=low + + * New upstream release + * Fix tune2fs -I to work correctly in the face of bad blocks and + filesystems formatted for RAID arrays, and ENOSPC errors + * Require the user to only answer one question instead of multiple + ones for multiple bad block group checksums, or when an inode + table needs to be moved. + * Fix e2fsck to handle moving inode tables in FLEX_BG filesystems more + gracefully by looking in the entire flex_bg for space, instead of + just in the block group; if that doesn't work, try looking for + space in the entire filesystem. + * Fix the filefrag code to avoid printing the extent header if it + needs to fallback to using the FIBMAP ioctl. + * Fix filefrag to print the correct number of extents for zero-length + files when using FIBMAP. (Closes: #540376) + * Add a filefrag -B option to make it easier to debug the FIBMAP + support. + * Allow e2fsprogs programs to allocate from uninitalized block groups. + * Add a new program, e2freefrag, which displays information about the + free space fragmentation in an ext2/3/4 filesystem. + * E2fsck will now print much fuller information when the last mount + time or last written time is in the future, since most people can't + seem to believe their distribution has buggy init scripts, or they + have a failed CMOS/RTS clock battery. + * Update French, Polish, Czech, and Sweedish translation from the + Translation Project. + * Enhance debugfs's 'stat' command to print basic extent information + for extent-mapped inodes, and add a new command, 'dump_extents' + which prints detailed information about an inode's extent tree. + + -- Theodore Y. Ts'o <tytso@mit.edu> Sun, 23 Aug 2009 10:08:52 -0400 + e2fsprogs (1.41.8-2) unstable; urgency=low * Fix regression in ext2fs_extent_set_bmap() which caused e2fsck -fD diff --git a/debian/control.in b/debian/control.in index f0f364f6..5d5142ca 100644 --- a/debian/control.in +++ b/debian/control.in @@ -7,11 +7,12 @@ ifdef(`UTIL_LINUX_NG', '', ``Build-Depends: texi2html (>= 1.76), gettext, texinfo, dc, pkg-config, dietlibc-dev (>> 0.30) [alpha amd64 arm hppa i386 ia64 powerpc ppc64 s390 sparc], debhelper (>= 7.0), m4 '')dnl -Standards-Version: 3.8.2 +Standards-Version: 3.8.3 Homepage: http://e2fsprogs.sourceforge.net Package: e2fsck-static Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: sash | bash-static | zsh-static | busybox-static | zsh30-static Architecture: any Description: statically-linked version of the ext2/ext3/ext4 filesystem checker @@ -27,7 +28,7 @@ Description: statically-linked version of the ext2/ext3/ext4 filesystem checker Package: libcomerr2 Section: libs Provides: libcomerr-kth-compat -Depends: ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Replaces: e2fsprogs (<< 1.34-1) Architecture: any Description: common error description library @@ -38,7 +39,7 @@ Description: common error description library Package: comerr-dev Section: libdevel Priority: extra -Depends: libc6-dev | libc-dev, libcomerr2 (= ${mainBinary}) +Depends: libc6-dev | libc-dev, libcomerr2 (= ${mainBinary}), ${misc:Depends} Suggests: doc-base Replaces: e2fslibs-dev (<< 1.33-2), libkrb5-dev (<< 1.3) Architecture: any @@ -51,7 +52,7 @@ Description: common error description library - headers and static libraries Package: libss2 Section: libs -Depends: libcomerr2, ${shlibs:Depends} +Depends: libcomerr2, ${shlibs:Depends}, ${misc:Depends} Replaces: e2fsprogs (<< 1.34-1) Architecture: any Description: command-line interface parsing library @@ -64,7 +65,7 @@ Description: command-line interface parsing library Package: ss-dev Section: libdevel Priority: extra -Depends: libc6-dev | libc-dev, libss2 (= ${mainBinary}), comerr-dev +Depends: libc6-dev | libc-dev, libss2 (= ${mainBinary}), comerr-dev, ${misc:Depends} Architecture: any Description: command-line interface parsing library - headers and static libraries This package includes a tool that parses a command table to generate @@ -77,7 +78,7 @@ Description: command-line interface parsing library - headers and static librari ifdef(`UTIL_LINUX_NG',,`` Package: libuuid1 Section: libs -Depends: passwd, ${shlibs:Depends} +Depends: passwd, ${shlibs:Depends}, ${misc:Depends} Recommends: uuid-runtime Replaces: e2fsprogs (<< 1.34-1) Architecture: any @@ -94,7 +95,7 @@ Description: Universally Unique ID library Package: uuid-runtime Section: libs Priority: optional -Depends: passwd, libuuid1 (>> 1.40.3-1), ${shlibs:Depends} +Depends: passwd, libuuid1 (>> 1.40.3-1), ${shlibs:Depends}, ${misc:Depends} Replaces: e2fsprogs (<= 1.40.3-1ubuntu1) Architecture: any Description: runtime components for the Universally Unique ID library @@ -130,7 +131,7 @@ Description: stripped down universally unique id library, for debian-installer Package: uuid-dev Section: libdevel Priority: extra -Depends: libc6-dev | libc-dev, libuuid1 (= ${mainBinary}) +Depends: libc6-dev | libc-dev, libuuid1 (= ${mainBinary}), ${misc:Depends} Replaces: e2fslibs-dev (<< 1.15) Architecture: any Description: universally unique id library - headers and static libraries @@ -141,7 +142,7 @@ Description: universally unique id library - headers and static libraries Package: libblkid1 Section: libs -Depends: ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Architecture: any Description: block device id library The blkid library which allows system programs like fsck and @@ -154,7 +155,7 @@ Package: libblkid1-udeb XC-Package-Type: udeb Section: debian-installer Priority: optional -Depends: ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Architecture: any Description: stripped down block device id library, for debian-installer The blkid library which allows system programs like fsck and @@ -168,7 +169,7 @@ Description: stripped down block device id library, for debian-installer Package: libblkid-dev Section: libdevel Priority: extra -Depends: libc6-dev | libc-dev, libblkid1 (= ${binary:Version}) +Depends: libc6-dev | libc-dev, libblkid1 (= ${binary:Version}), ${misc:Depends} Architecture: any Description: block device id library - headers and static libraries The blkid library which allows system programs like fsck and @@ -184,7 +185,7 @@ Package: e2fsprogs-udeb XC-Package-Type: udeb Section: debian-installer Priority: optional -Depends: ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Architecture: any Description: stripped-down versions of e2fsprogs, for debian-installer This package is an e2fsprogs package built for a reduced size, so that @@ -195,7 +196,7 @@ Description: stripped-down versions of e2fsprogs, for debian-installer Package: e2fslibs Section: libs -Depends: ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Replaces: e2fsprogs (<< 1.34-1) Provides: libext2fs2, libe2p2 Architecture: any @@ -212,7 +213,7 @@ Description: ext2/ext3/ext4 file system libraries Package: e2fslibs-dev Section: libdevel Priority: extra -Depends: libc6-dev | libc-dev, comerr-dev, e2fslibs (= ${binary:Version}) +Depends: libc6-dev | libc-dev, comerr-dev, e2fslibs (= ${binary:Version}), ${misc:Depends} Suggests: doc-base Provides: ext2fs-dev, e2p-dev Replaces: libkrb5-dev (<< 1.3) @@ -227,7 +228,7 @@ Description: ext2/ext3/ext4 file system libraries - headers and static libraries Package: e2fsprogs Essential: yes -Pre-Depends: ${shlibs:Depends} +Pre-Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: gpart, parted, e2fsck-static Conflicts: dump (<< 0.4b4-4), quota (<< 1.55-8.1), initscripts (<< 2.85-4), sysvinit (<< 2.85-4) Replaces: hurd (<= 20040301-1), libblkid1 (<< 1.38+1.39-WIP-2005.12.10-2), libuuid1 (<< 1.38+1.39-WIP-2005.12.10-2) @@ -243,7 +244,7 @@ Description: ext2/ext3/ext4 file system utilities Package: e2fsprogs-dbg Section: debug Priority: extra -Depends: e2fsprogs (= ${binary:Version}) +Depends: e2fsprogs (= ${binary:Version}), ${misc:Depends} Architecture: any Description: debugging information for e2fsprogs This package includes the debug information useful for debugging e2fsprogs @@ -254,7 +255,7 @@ ifdef(`UTIL_LINUX_NG',,`` Package: uuid-runtime-dbg Section: debug Priority: extra -Depends: uuid-runtime (= ${binary:Version}) +Depends: uuid-runtime (= ${binary:Version}), ${misc:Depends} Architecture: any Description: debugging information for uuid-runtime This package includes the debug information useful for debugging the @@ -266,7 +267,7 @@ Description: debugging information for uuid-runtime Package: e2fslibs-dbg Section: debug Priority: extra -Depends: e2fslibs (= ${binary:Version}) +Depends: e2fslibs (= ${binary:Version}), ${misc:Depends} Architecture: any Description: debugging information for e2fslibs This package includes the debug information useful for debugging the @@ -276,7 +277,7 @@ Description: debugging information for e2fslibs Package: libcomerr2-dbg Section: debug Priority: extra -Depends: libcomerr2 (= ${binary:Version}) +Depends: libcomerr2 (= ${binary:Version}), ${misc:Depends} Architecture: any Description: debugging information for libcomerr2 This package includes the debug information useful for debugging the @@ -286,7 +287,7 @@ Description: debugging information for libcomerr2 Package: libss2-dbg Section: debug Priority: extra -Depends: libss2 (= ${binary:Version}) +Depends: libss2 (= ${binary:Version}), ${misc:Depends} Architecture: any Description: debugging information for libss2 This package includes the debug information useful for debugging the @@ -296,7 +297,7 @@ ifdef(`UTIL_LINUX_NG',,`` Package: libblkid1-dbg Section: debug Priority: extra -Depends: libblkid1 (= ${binary:Version}) +Depends: libblkid1 (= ${binary:Version}), ${misc:Depends} Architecture: any Description: debugging information for libblkid1 This package includes the debug information useful for debugging the @@ -306,7 +307,7 @@ Description: debugging information for libblkid1 Package: libuuid1-dbg Section: debug Priority: extra -Depends: libuuid1 (= ${binary:Version}) +Depends: libuuid1 (= ${binary:Version}), ${misc:Depends} Architecture: any Description: debugging information for libuuid1 This package includes the debug information useful for debugging the diff --git a/debian/rules b/debian/rules index 1ba79ff2..f62e86fa 100755 --- a/debian/rules +++ b/debian/rules @@ -11,8 +11,8 @@ export LC_ALL=C # Allow distro-specific behaviour -DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release || echo Debian) -SYS_BLKID_VER :=$(shell dpkg-query -W -f '${version}\n' libblkid1 | cut -b 1) +DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release 2>/dev/null || echo Debian) +SYS_BLKID_VER := $(shell dpkg-query -W libblkid1 | cut -f 2 | cut -b 1) ifeq ($(SYS_BLKID_VER),2) UTIL_LINUX_NG ?= yes endif @@ -105,22 +105,17 @@ BUILDSTDSTAMP=${STAMPSDIR}/build-std-stamp BUILDBFSTAMP=${STAMPSDIR}/build-bf-stamp BUILDSTATICSTAMP=${STAMPSDIR}/build-static-stamp -CCOPTS = -g - INSTALL = install INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 0755 -ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) -CCOPTS += -O2 -endif #ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) #INSTALL_PROGRAM += -s #endif ifeq (${DEB_HOST_ARCH},alpha) -CCOPTS += -DHAVE_NETINET_IN_H +CFLAGS += -DHAVE_NETINET_IN_H else -CCOPTS += -D__NO_STRING_INLINES +CFLAGS += -D__NO_STRING_INLINES endif ifeq (${DEB_HOST_ARCH_OS},linux) @@ -130,7 +125,7 @@ else E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static endif -BF_CCOPTS = -Os -fomit-frame-pointer +BF_CFLAGS = -Os -fomit-frame-pointer COMMON_CONF_FLAGS = \ --enable-elf-shlibs --infodir=/usr/share/info @@ -141,21 +136,17 @@ else COMMON_CONF_FLAGS += --enable-fsck endif -STD_CONF_FLAGS = --with-ccopts="${CCOPTS}" --enable-compression +STD_CONF_FLAGS = --enable-compression -BF_CONF_FLAGS = --with-ccopts="${CCOPTS} ${BF_CCOPTS}" \ - --disable-nls --disable-imager --disable-testio-debug \ +BF_CONF_FLAGS = --disable-nls --disable-imager --disable-testio-debug \ --disable-uuidd --disable-tls \ --disable-debugfs --disable-e2initrd-helper -STATIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \ - --disable-nls --disable-imager \ +STATIC_CONF_FLAGS = --disable-nls --disable-imager \ --disable-uuidd --disable-tls \ - --disable-e2initrd-helper \ - --with-ccopts=-fno-stack-protector + --disable-e2initrd-helper -MIPS_NOPIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \ - --disable-nls --disable-imager \ +MIPS_NOPIC_CONF_FLAGS = --disable-nls --disable-imager \ --disable-uuidd --disable-tls \ --disable-resizer # --disable-debugfs @@ -188,20 +179,22 @@ ${CFGSTDSTAMP}: mkdir -p ${stdbuilddir} ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) cd ${stdbuilddir} && AWK=/usr/bin/awk \ - ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} + ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \ + CFLAGS="${CFLAGS}" else cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \ ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \ - --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ + CFLAGS="${CFLAGS}" endif # specially-built MIPS libs ifneq ($(ismips),) mkdir -p ${mipsbuilddir} ${mipsbuilddir64} cd ${mipsbuilddir} && AWK=/usr/bin/awk \ - ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} + ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} CFLAGS="${CFLAGS}" cd ${mipsbuilddir64} && AWK=/usr/bin/awk \ - ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} + ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} CFLAGS="${CFLAGS}" endif mkdir -p ${STAMPSDIR} @@ -214,11 +207,13 @@ ${CFGBFSTAMP}: mkdir -p ${bfbuilddir} ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) cd ${bfbuilddir} && AWK=/usr/bin/awk \ - ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} + ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \ + CFLAGS="${CFLAGS} ${BF_CFLAGS}" else cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \ ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \ - --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ + CFLAGS="${CFLAGS}" endif mkdir -p ${STAMPSDIR} touch ${CFGBFSTAMP} @@ -231,16 +226,18 @@ ${CFGSTATICSTAMP}: ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) if type diet > /dev/null 2>&1 ; then \ cd ${staticbuilddir} && AWK=/usr/bin/awk \ - ${topdir}/configure ${STATIC_CONF_FLAGS} \ - --with-diet-libc; \ + ${topdir}/configure ${STATIC_CONF_FLAGS} \ + --with-diet-libc CFLAGS="${CFLAGS} -fno-stack-protector"; \ else \ cd ${staticbuilddir} && AWK=/usr/bin/awk \ - ${topdir}/configure ${STATIC_CONF_FLAGS}; \ + ${topdir}/configure ${STATIC_CONF_FLAGS} \ + CFLAGS="${CFLAGS} -fno-stack-protector"; \ fi else cd ${staticbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \ ${topdir}/configure ${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} \ - --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ + CFLAGS="${CFLAGS} -fno-stack-protector" endif mkdir -p ${STAMPSDIR} touch ${CFGSTATICSTAMP} @@ -262,11 +259,11 @@ ${BUILDSTDSTAMP}: ${CFGSTDSTAMP} ifneq ($(ismips),) $(MAKE) -C ${mipsbuilddir}/util $(MAKE) -C ${mipsbuilddir} \ - CFLAGS="${CCOPTS} ${MIPS_CFLAGS}" \ + CFLAGS="${CFLAGS} ${MIPS_CFLAGS}" \ LIB_SUBDIRS="lib/et lib/ext2fs" libs $(MAKE) -C ${mipsbuilddir64}/util $(MAKE) -C ${mipsbuilddir64} \ - CFLAGS="${CCOPTS} ${MIPS_CFLAGS_64}" \ + CFLAGS="${CFLAGS} ${MIPS_CFLAGS_64}" \ LIB_SUBDIRS="lib/et lib/ext2fs" libs endif @@ -465,7 +462,8 @@ endif -plibcomerr2-dbg -plibss2-dbg ifneq ($(UTIL_LINUX_NG),yes) DH_OPTIONS= dh_installchangelogs -plibuuid${UUID_SOVERSION} \ - -puuid-dev -puuid-runtime -puuid-runtime-dbg -plibuuid1-dbg + -puuid-dev -puuid-runtime -puuid-runtime-dbg -plibuuid1-dbg \ + -plibblkid${BLKID_SOVERSION} -plibblkid1-dbg endif dh_fixperms diff --git a/doc/libext2fs.texinfo b/doc/libext2fs.texinfo index e559afdd..19899bcc 100644 --- a/doc/libext2fs.texinfo +++ b/doc/libext2fs.texinfo @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename libext2fs.info -@settitle The EXT2FS Library (version 1.41.8) +@settitle The EXT2FS Library (version 1.41.9) @synindex tp fn @comment %**end of header @@ -60,8 +60,8 @@ by the author. @title The EXT2FS Library @subtitle The EXT2FS Library -@subtitle Version 1.41.8 -@subtitle July 2009 +@subtitle Version 1.41.9 +@subtitle August 2009 @author by Theodore Ts'o @@ -102,7 +102,7 @@ by the Foundation. @top The EXT2FS Library -This manual documents the EXT2FS Library, version 1.41.8 +This manual documents the EXT2FS Library, version 1.41.9 @end ifinfo diff --git a/e2fsck/unix.c b/e2fsck/unix.c index a244d52c..9d08f43f 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -926,7 +926,7 @@ static const char *my_ver_date = E2FSPROGS_DATE; int main (int argc, char *argv[]) { - errcode_t retval = 0, orig_retval = 0; + errcode_t retval = 0, retval2 = 0, orig_retval = 0; int exit_value = FSCK_OK; ext2_filsys fs = 0; io_manager io_ptr; @@ -1017,7 +1017,11 @@ restart: !(ctx->flags & E2F_FLAG_SB_SPECIFIED) && ((retval == EXT2_ET_BAD_MAGIC) || (retval == EXT2_ET_CORRUPT_SUPERBLOCK) || - ((retval == 0) && ext2fs_check_desc(fs)))) { + ((retval == 0) && (retval2 = ext2fs_check_desc(fs))))) { + if (retval2 == ENOMEM) { + retval = retval2; + goto failure; + } if (fs->flags & EXT2_FLAG_NOFREE_ON_ERROR) { ext2fs_free(fs); fs = NULL; @@ -1056,6 +1060,7 @@ restart: if (features[0] || features[1] || features[2]) goto print_unsupp_features; } +failure: if (retval) { if (orig_retval) retval = orig_retval; diff --git a/e2fsprogs.lsm b/e2fsprogs.lsm index aa3384db..d96a89b0 100644 --- a/e2fsprogs.lsm +++ b/e2fsprogs.lsm @@ -1,16 +1,16 @@ Begin3 Title: EXT2 Filesystem utilities -Version: 1.41.8 -Entered-date: 11Jul2009 +Version: 1.41.9 +Entered-date: 22Aug2009 Description: The filesystem utilities for the EXT2 filesystem, including e2fsck, mke2fs, dumpe2fs, fsck, and others. Keywords: utilities, fsck, filesystem, Ext2fs Author: tytso@mit.edu (Theodore Tso) Maintained-by: tytso@mit.edu (Theodore Tso) Primary-site: download.sourceforge.net /pub/sourceforge/e2fsprogs - 4336kB e2fsprogs-1.41.8.tar.gz - 488kB e2fsprogs-libs-1.41.8.tar.gz - 1kB e2fsprogs-1.41.8.lsm + 4352kB e2fsprogs-1.41.9.tar.gz + 488kB e2fsprogs-libs-1.41.9.tar.gz + 1kB e2fsprogs-1.41.9.lsm Alternate-site: Platforms: linux 1.2.x/1.3.x/2.0.x/2.1.x/2.2.x/2.3.x/2.4.x/2.5.x/2.6.x Copying-policy: GPL-2/LGPL-2 diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index 8f6cfa6a..6b75732e 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -208,8 +208,8 @@ static int check_for_modules(const char *fs_name) #ifdef __linux__ struct utsname uts; FILE *f; - char buf[1024], *cp, *t; - int i; + char buf[1024], *cp; + int namesz; if (uname(&uts)) return (0); @@ -218,6 +218,9 @@ static int check_for_modules(const char *fs_name) f = fopen(buf, "r"); if (!f) return (0); + + namesz = strlen(fs_name); + while (!feof(f)) { if (!fgets(buf, sizeof(buf), f)) break; @@ -229,13 +232,9 @@ static int check_for_modules(const char *fs_name) cp++; else cp = buf; - i = strlen(cp); - if (i > 3) { - t = cp + i - 3; - if (!strcmp(t, ".ko")) - *t = 0; - } - if (!strcmp(cp, fs_name)) { + if (!strncmp(cp, fs_name, namesz) && + (!strcmp(cp + namesz, ".ko") || + !strcmp(cp + namesz, ".ko.gz"))) { fclose(f); return (1); } diff --git a/lib/ext2fs/gen_bitmap.c b/lib/ext2fs/gen_bitmap.c index ed3afef4..d6deafb1 100644 --- a/lib/ext2fs/gen_bitmap.c +++ b/lib/ext2fs/gen_bitmap.c @@ -103,6 +103,8 @@ errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs, bitmap->description = 0; size = (size_t) (((bitmap->real_end - bitmap->start) / 8) + 1); + /* Round up to allow for the BT x86 instruction */ + size = (size + 7) & ~3; retval = ext2fs_get_mem(size, &bitmap->bitmap); if (retval) { ext2fs_free_mem(&bitmap->description); diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index 79e849ee..2f58466f 100644 --- a/lib/ext2fs/mkjournal.c +++ b/lib/ext2fs/mkjournal.c @@ -506,21 +506,33 @@ errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, int flags) goto errout; /* Get inode number of the journal file */ - if (fstat(fd, &st) < 0) + if (fstat(fd, &st) < 0) { + retval = errno; goto errout; + } #if defined(HAVE_CHFLAGS) && defined(UF_NODUMP) retval = fchflags (fd, UF_NODUMP|UF_IMMUTABLE); #else #if HAVE_EXT2_IOCTLS - f = EXT2_NODUMP_FL | EXT2_IMMUTABLE_FL; + if (ioctl(fd, EXT2_IOC_GETFLAGS, &f) < 0) { + retval = errno; + goto errout; + } + f |= EXT2_NODUMP_FL | EXT2_IMMUTABLE_FL; retval = ioctl(fd, EXT2_IOC_SETFLAGS, &f); #endif #endif - if (retval) + if (retval) { + retval = errno; goto errout; + } - close(fd); + if (close(fd) < 0) { + retval = errno; + fd = -1; + goto errout; + } journal_ino = st.st_ino; } else { if ((mount_flags & EXT2_MF_BUSY) && diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index b966b4d5..6e09f9d9 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -286,10 +286,14 @@ static void list_bad_blocks(ext2_filsys fs, int dump) static void print_inline_journal_information(ext2_filsys fs) { + journal_superblock_t *jsb; struct ext2_inode inode; + ext2_file_t journal_file; errcode_t retval; ino_t ino = fs->super->s_journal_inum; - int size; + char buf[1024]; + __u32 *mask_ptr, mask, m; + int i, j, size, printed = 0; retval = ext2fs_read_inode(fs, ino, &inode); if (retval) { @@ -297,6 +301,38 @@ static void print_inline_journal_information(ext2_filsys fs) _("while reading journal inode")); exit(1); } + retval = ext2fs_file_open2(fs, ino, &inode, 0, &journal_file); + if (retval) { + com_err(program_name, retval, + _("while opening journal inode")); + exit(1); + } + retval = ext2fs_file_read(journal_file, buf, sizeof(buf), 0); + if (retval) { + com_err(program_name, retval, + _("while reading journal super block")); + exit(1); + } + ext2fs_file_close(journal_file); + jsb = (journal_superblock_t *) buf; + if (be32_to_cpu(jsb->s_header.h_magic) != JFS_MAGIC_NUMBER) { + fprintf(stderr, + "Journal superblock magic number invalid!\n"); + exit(1); + } + printf(_("Journal features: ")); + for (i=0, mask_ptr=&jsb->s_feature_compat; i <3; i++,mask_ptr++) { + mask = be32_to_cpu(*mask_ptr); + for (j=0,m=1; j < 32; j++, m<<=1) { + if (mask & m) { + printf(" %s", e2p_jrnl_feature2string(i, m)); + printed++; + } + } + } + if (printed == 0) + printf(" (none)"); + printf("\n"); fputs(_("Journal size: "), stdout); if ((fs->super->s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_HUGE_FILE) && @@ -308,6 +344,12 @@ static void print_inline_journal_information(ext2_filsys fs) printf("%uk\n", size); else printf("%uM\n", size >> 10); + printf(_("Journal length: %u\n" + "Journal sequence: 0x%08x\n" + "Journal start: %u\n"), + (unsigned int)ntohl(jsb->s_maxlen), + (unsigned int)ntohl(jsb->s_sequence), + (unsigned int)ntohl(jsb->s_start)); } static void print_journal_information(ext2_filsys fs) diff --git a/misc/e2freefrag.8.in b/misc/e2freefrag.8.in index 56fdbff7..564be741 100644 --- a/misc/e2freefrag.8.in +++ b/misc/e2freefrag.8.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH E2FREEFRAG 8 +.TH E2FREEFRAG 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" .SH NAME e2freefrag \- report free space fragmentation information .SH SYNOPSIS diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in index 1575b089..b02905ba 100644 --- a/misc/mke2fs.8.in +++ b/misc/mke2fs.8.in @@ -267,10 +267,12 @@ are developing test cases. .TP .BI \-G " number-of-groups" Specify the number of block groups that will be packed together to -create one large virtual block group on an ext4 filesystem. This -improves meta-data locality and performance on meta-data heavy -workloads. The number of groups must be a power of 2 and may only be -specified if the flex_bg filesystem feature is enabled. +create a larger virtual block group (or "flex_bg group") in an +ext4 filesystem. This improves meta-data locality and performance +on meta-data heavy workloads. The number of groups must be a power +of 2 and may only be specified if the +.B flex_bg +filesystem feature is enabled. .TP .BI \-i " bytes-per-inode" Specify the bytes/inode ratio. @@ -468,20 +470,27 @@ prefix the feature name with a caret ('^') character. The pseudo-filesystem feature "none" will clear all filesystem features. .RS 1.2i .TP -.B large_file -Filesystem can contain files that are greater than 2GB. (Modern kernels -set this feature automatically when a file > 2GB is created.) -.TP .B dir_index Use hashed b-trees to speed up lookups in large directories. .TP +.B extent +Instead of using the indirect block scheme for storing the location of +data blocks in an inode, use extents instead. This is a much more +efficient encoding which speeds up filesystem access, especially for +large files. +.TP .B filetype Store file type information in directory entries. .TP .B flex_bg -Allow bitmaps and inode tables for a block group to be placed anywhere -on the storage media (use with \-G option to group meta-data in order -to create a large virtual block group). +Allow the per-block group metadata (allocation bitmaps and inode tables) +to be placed anywhere on the storage media. In addition, +.B mke2fs +will place the per-block group metadata together starting at the first +block group of each "flex_bg group". The size of the flex_bg group +can be specified using the +.B \-G +option. .TP .B has_journal Create an ext3 journal (as if using the @@ -496,21 +505,9 @@ option). @JDEV@must be created with the same @JDEV@block size as the filesystems that will be using it. .TP -.B extent -Instead of using the indirect block scheme for storing the location of -data blocks in an inode, use extents instead. This is a much more -efficient encoding which speeds up filesystem access, especially for -large files. -.TP -.B uninit_bg -Create a filesystem without initializing all of the block groups. This -feature also enables checksums and highest-inode-used statistics in each -blockgroup. This feature can -speed up filesystem creation time noticeably (if lazy_itable_init is -enabled), and can also reduce -.BR e2fsck -time dramatically. It is only supported by the ext4 filesystem in -recent Linux kernels. +.B large_file +Filesystem can contain files that are greater than 2GB. (Modern kernels +set this feature automatically when a file > 2GB is created.) .TP .B resize_inode Reserve space so the block group descriptor table may grow in the future. @@ -527,6 +524,16 @@ extended option. .B sparse_super Create a filesystem with fewer superblock backup copies (saves space on large filesystems). +.TP +.B uninit_bg +Create a filesystem without initializing all of the block groups. This +feature also enables checksums and highest-inode-used statistics in each +blockgroup. This feature can +speed up filesystem creation time noticeably (if lazy_itable_init is +enabled), and can also reduce +.BR e2fsck +time dramatically. It is only supported by the ext4 filesystem in +recent Linux kernels. .RE .TP .B \-q diff --git a/misc/mke2fs.conf b/misc/mke2fs.conf index 3795b1ed..52fe58ed 100644 --- a/misc/mke2fs.conf +++ b/misc/mke2fs.conf @@ -9,11 +9,11 @@ features = has_journal } ext4 = { - features = has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize inode_size = 256 } ext4dev = { - features = has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize inode_size = 256 options = test_fs=1 } diff --git a/misc/tune2fs.8.in b/misc/tune2fs.8.in index 4abc728b..cf0d8ac6 100644 --- a/misc/tune2fs.8.in +++ b/misc/tune2fs.8.in @@ -431,24 +431,30 @@ The following filesystem features can be set or cleared using .BR tune2fs : .RS 1.2i .TP -.B large_file -Filesystem can contain files that are greater than 2GB. (Modern kernels -set this feature automatically when a file > 2GB is created.) -.TP .B dir_index Use hashed b-trees to speed up lookups in large directories. .TP .B filetype Store file type information in directory entries. .TP +.B flex_bg +Allow bitmaps and inode tables for a block group to be placed +anywhere on the storage media. \fBTune2fs\fR will not reorganize +the location of the inode tables and allocation bitmaps, as +.BR mke2fs (8) +will do when it creates a freshly formated file system with +.B flex_bg +enabled. +.TP .B has_journal Use a journal to ensure filesystem consistency even across unclean shutdowns. Setting the filesystem feature is equivalent to using the .B \-j option. .TP -.B sparse_super -Limit the number of backup superblocks to save space on large filesystems. +.B large_file +Filesystem can contain files that are greater than 2GB. (Modern kernels +set this feature automatically when a file > 2GB is created.) .TP .B resize_inode Reserve space so the block group descriptor table may grow in the @@ -456,6 +462,9 @@ future. .B Tune2fs only supports clearing this filesystem feature. .TP +.B sparse_super +Limit the number of backup superblocks to save space on large filesystems. +.TP .B uninit_bg Allow the kernel to initialize bitmaps and inode tables and keep a high watermark for the unused inodes in a filesystem, to reduce @@ -483,7 +492,7 @@ feature, .B e2fsck -D can be run to convert existing directories to the hashed B-tree format. Enabling certain filesystem features may prevent the filesystem from being -mounted by kernels which do not support those features. In particular the +mounted by kernels which do not support those features. In particular, the .BR uninit_bg and .BR flex_bg diff --git a/resize/main.c b/resize/main.c index c6cbb5e8..220c192e 100644 --- a/resize/main.c +++ b/resize/main.c @@ -375,7 +375,7 @@ int main (int argc, char ** argv) exit(1); } if (force_min_size) - new_size = calculate_minimum_resize_size(fs); + new_size = min_size; else if (new_size_str) { new_size = parse_num_blocks(new_size_str, fs->super->s_log_block_size); diff --git a/resize/resize2fs.c b/resize/resize2fs.c index 4344a749..1a5d9100 100644 --- a/resize/resize2fs.c +++ b/resize/resize2fs.c @@ -1900,6 +1900,8 @@ blk_t calculate_minimum_resize_size(ext2_filsys fs) blk_t inode_count, blks_needed, groups, data_blocks; blk_t grp, data_needed, last_start; int overhead = 0, num_of_superblocks = 0; + int extra_groups = 0; + int flexbg_size = 1 << fs->super->s_log_groups_per_flex; /* * first figure out how many group descriptors we need to @@ -1934,11 +1936,9 @@ blk_t calculate_minimum_resize_size(ext2_filsys fs) * of inode tables of slack space so the resize * operation can be guaranteed to finish. */ - int flexbg_size = 1 << fs->super->s_log_groups_per_flex; - int extra_groups; - extra_groups = flexbg_size - (groups & (flexbg_size - 1)); data_needed += META_OVERHEAD(fs) * extra_groups; + extra_groups = groups % flexbg_size; } /* @@ -2002,6 +2002,20 @@ blk_t calculate_minimum_resize_size(ext2_filsys fs) } groups += extra_grps; + extra_groups += extra_grps; + if (fs->super->s_feature_incompat + & EXT4_FEATURE_INCOMPAT_FLEX_BG + && extra_groups > flexbg_size) { + /* + * For ext4 we need to allow for up to a flex_bg worth + * of inode tables of slack space so the resize + * operation can be guaranteed to finish. + */ + extra_groups = flexbg_size - + (groups & (flexbg_size - 1)); + data_needed += META_OVERHEAD(fs) * extra_groups; + extra_groups = groups % flexbg_size; + } } /* now for the fun voodoo */ @@ -7,5 +7,5 @@ * redistributed under the GNU Public License. */ -#define E2FSPROGS_VERSION "1.41.8" -#define E2FSPROGS_DATE "20-Jul-2009" +#define E2FSPROGS_VERSION "1.41.9" +#define E2FSPROGS_DATE "22-Aug-2009" |