From 26ea4899d1fea0fbc5d28120944d2c2758ac1b11 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 16 Jul 2009 23:44:50 -0400 Subject: [PATCH 01/12] e2fsck: Fix superblock times in the future even if buggy_init_scripts=1 Unfortunately, distributions like Ubuntu seem to have buggy init scripts that run e2fsck and mount the root filesystem before making sure the system time and time zone is correctly set. As a result, a filesystem's last write and last mounted time can be set in future. The buggy_init_scripts configuration option will stop e2fsck from aborting the boot process, but it also inhibits the superblock times from getting fixed. This causes resize2fs to refuse to resize the filesystem, even after running e2fsck on the file system. To deal with this, we need to fix the superblock write times unconditionally. Addresses-Launchpad-bug: #373409 Signed-off-by: "Theodore Ts'o" --- e2fsck/problem.c | 16 ++++++++++++++-- e2fsck/problem.h | 7 +++++++ e2fsck/super.c | 15 +++++++++++---- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/e2fsck/problem.c b/e2fsck/problem.c index 43a0aa64..d6b345cf 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -335,12 +335,12 @@ static struct e2fsck_problem problem_table[] = { /* Last mount time is in the future */ { PR_0_FUTURE_SB_LAST_MOUNT, N_("@S last mount time is in the future. "), - PROMPT_FIX, PR_PREEN_OK | PR_NO_OK }, + PROMPT_FIX, PR_NO_OK }, /* Last write time is in the future */ { PR_0_FUTURE_SB_LAST_WRITE, N_("@S last write time is in the future. "), - PROMPT_FIX, PR_PREEN_OK | PR_NO_OK }, + PROMPT_FIX, PR_NO_OK }, { PR_0_EXTERNAL_JOURNAL_HINT, N_("@S hint for external superblock @s %X. "), @@ -385,6 +385,18 @@ static struct e2fsck_problem problem_table[] = { N_("The test_fs flag is set (and ext4 is available). "), PROMPT_CLEAR, PR_PREEN_OK }, + /* Last mount time is in the future (fudged) */ + { PR_0_FUTURE_SB_LAST_MOUNT_FUDGED, + N_("@S last mount time is in the future.\n\t(by less than a day, " + "probably due to buggy init scripts) "), + PROMPT_FIX, PR_PREEN_OK | PR_NO_OK }, + + /* Last write time is in the future (fudged) */ + { PR_0_FUTURE_SB_LAST_WRITE_FUDGED, + N_("@S last write time is in the future.\n\t(by less than a day, " + "probably due to buggy init scripts). "), + PROMPT_FIX, PR_PREEN_OK | PR_NO_OK }, + /* Pass 1 errors */ /* Pass 1: Checking inodes, blocks, and sizes */ diff --git a/e2fsck/problem.h b/e2fsck/problem.h index 1d2c2334..69dcfba7 100644 --- a/e2fsck/problem.h +++ b/e2fsck/problem.h @@ -217,6 +217,13 @@ struct problem_context { /* The test_fs filesystem flag is set and ext4 is available */ #define PR_0_CLEAR_TESTFS_FLAG 0x00003B +/* Last mount time is in the future (fudged) */ +#define PR_0_FUTURE_SB_LAST_MOUNT_FUDGED 0x00003C + +/* Last write time is in the future (fudged) */ +#define PR_0_FUTURE_SB_LAST_WRITE_FUDGED 0x00003D + + /* * Pass 1 errors */ diff --git a/e2fsck/super.c b/e2fsck/super.c index 344777d4..ef29aa52 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -457,6 +457,7 @@ void check_super_block(e2fsck_t ctx) blk_t first_block, last_block; struct ext2_super_block *sb = fs->super; struct ext2_group_desc *gd; + problem_t problem; blk_t blocks_per_group = fs->super->s_blocks_per_group; blk_t bpg_max; int inodes_per_block; @@ -818,16 +819,22 @@ void check_super_block(e2fsck_t ctx) * Check to see if the superblock last mount time or last * write time is in the future. */ - if (fs->super->s_mtime > (__u32) ctx->now + ctx->time_fudge) { + if (fs->super->s_mtime > (__u32) ctx->now) { pctx.num = fs->super->s_mtime; - if (fix_problem(ctx, PR_0_FUTURE_SB_LAST_MOUNT, &pctx)) { + problem = PR_0_FUTURE_SB_LAST_MOUNT; + if (fs->super->s_mtime <= (__u32) ctx->now + ctx->time_fudge) + problem = PR_0_FUTURE_SB_LAST_MOUNT_FUDGED; + if (fix_problem(ctx, problem, &pctx)) { fs->super->s_mtime = ctx->now; ext2fs_mark_super_dirty(fs); } } - if (fs->super->s_wtime > (__u32) ctx->now + ctx->time_fudge) { + if (fs->super->s_wtime > (__u32) ctx->now) { pctx.num = fs->super->s_wtime; - if (fix_problem(ctx, PR_0_FUTURE_SB_LAST_WRITE, &pctx)) { + problem = PR_0_FUTURE_SB_LAST_MOUNT; + if (fs->super->s_wtime <= (__u32) ctx->now + ctx->time_fudge) + problem = PR_0_FUTURE_SB_LAST_MOUNT_FUDGED; + if (fix_problem(ctx, problem, &pctx)) { fs->super->s_wtime = ctx->now; ext2fs_mark_super_dirty(fs); } From bbbb81c1d9277e9fadce42934c2b1cf7bc9a97d5 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Wed, 15 Jul 2009 15:22:55 -0500 Subject: [PATCH 02/12] filefrag: fix it so it works in the bmap fallback case. It looks like some debugging crept in? Signed-off-by: Eric Sandeen Signed-off-by: Theodore Ts'o --- misc/filefrag.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/misc/filefrag.c b/misc/filefrag.c index 46e9f566..eed2b869 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -95,8 +95,6 @@ static int get_bmap(int fd, unsigned long block, unsigned long *phy_blk) int ret; unsigned int b; - printf("Calling get_bmap for block %lu\n", block); - abort(); b = block; ret = ioctl(fd, FIBMAP, &b); /* FIBMAP takes pointer to integer */ if (ret < 0) { From 9922c53a4df10e660a1b425629a1f4db2b4fc03f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 18 Jul 2009 10:02:41 -0400 Subject: [PATCH 03/12] libext2fs: fix memory leak in error path in ext2fs_block_iterate2() Reported-by: Nic Case Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/block.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c index de5342df..490116d5 100644 --- a/lib/ext2fs/block.c +++ b/lib/ext2fs/block.c @@ -488,8 +488,10 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, abort_exit: if (ret & BLOCK_CHANGED) { retval = ext2fs_write_inode(fs, ino, &inode); - if (retval) - return retval; + if (retval) { + ret |= BLOCK_ERROR; + ctx.errcode = retval; + } } errout: if (!block_buf) From 98a5ad6147c32e6a2e5a4f584081071acdd00b9b Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Wed, 15 Jul 2009 17:37:52 +0200 Subject: [PATCH 04/12] Fix intl/ build: add E/Q/V macros, process intl/libgnuintl.h These were found necessary to build on FreeBSD 6.4. Signed-off-by: Matthias Andree Signed-off-by: Theodore Ts'o --- configure | 3 ++- configure.in | 3 ++- intl/Makefile.in | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 769dc099..f2729e51 100755 --- a/configure +++ b/configure @@ -16592,7 +16592,8 @@ for i in MCONFIG Makefile e2fsprogs.spec \ lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \ misc/Makefile ext2ed/Makefile e2fsck/Makefile \ debugfs/Makefile tests/Makefile tests/progs/Makefile \ - resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do + resize/Makefile doc/Makefile intl/Makefile \ + intl/libgnuintl.h po/Makefile.in ; do if test -d `dirname ${srcdir}/$i` ; then outlist="$outlist $i" fi diff --git a/configure.in b/configure.in index d11faecd..acbcec62 100644 --- a/configure.in +++ b/configure.in @@ -1062,7 +1062,8 @@ for i in MCONFIG Makefile e2fsprogs.spec \ lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \ misc/Makefile ext2ed/Makefile e2fsck/Makefile \ debugfs/Makefile tests/Makefile tests/progs/Makefile \ - resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do + resize/Makefile doc/Makefile intl/Makefile \ + intl/libgnuintl.h po/Makefile.in ; do if test -d `dirname ${srcdir}/$i` ; then outlist="$outlist $i" fi diff --git a/intl/Makefile.in b/intl/Makefile.in index 36592c1b..47f6f629 100644 --- a/intl/Makefile.in +++ b/intl/Makefile.in @@ -43,6 +43,22 @@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) +@SET_MAKE@ + +@ifGNUmake@ V = +@ifGNUmake@ ifeq ($(strip $(V)),) +@ifGNUmake@ # E = @echo +@ifGNUmake@ # Q = @ +@ifGNUmake@ E = @E@ +@ifGNUmake@ Q = @Q@ +@ifGNUmake@ else +@ifGNUmake@ E = @\# +@ifGNUmake@ Q = +@ifGNUmake@ endif + +@ifNotGNUmake@ E = @E@ +@ifNotGNUmake@ Q = @Q@ + l = @INTL_LIBTOOL_SUFFIX_PREFIX@ AR = ar From bb3875e106a4f7298471ff6a82902937e4c46b78 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Wed, 15 Jul 2009 17:37:53 +0200 Subject: [PATCH 05/12] Fix release date, to silence configure complaints Signed-off-by: Matthias Andree Signed-off-by: Theodore Ts'o --- version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.h b/version.h index 648d684b..5695135c 100644 --- a/version.h +++ b/version.h @@ -8,4 +8,4 @@ */ #define E2FSPROGS_VERSION "1.41.8" -#define E2FSPROGS_DATE "11-July-2009" +#define E2FSPROGS_DATE "11-Jul-2009" From 1e69a24005b588f7e109225a3f929a9891ea834e Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Wed, 15 Jul 2009 15:43:21 +0100 Subject: [PATCH 06/12] debian/control: fix incorrect use of apostrophe's Signed-off-by: Scott James Remnant Signed-off-by: Theodore Ts'o --- debian/control | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index dc8df21a..f930dddb 100644 --- a/debian/control +++ b/debian/control @@ -79,7 +79,7 @@ Replaces: e2fsprogs (<< 1.34-1) Architecture: any Description: Universally Unique ID library The libuuid library generates and parses 128-bit universally unique - id's (UUID's). A UUID is an identifier that is unique across both + ids (UUIDs). A UUID is an identifier that is unique across both space and time, with respect to the space of all UUIDs. A UUID can be used for multiple purposes, from tagging objects with an extremely short lifetime, to reliably identifying very persistent objects @@ -95,7 +95,7 @@ Replaces: e2fsprogs (<= 1.40.3-1ubuntu1) Architecture: any Description: runtime components for the Universally Unique ID library The libuuid library generates and parses 128-bit universally unique - id's (UUID's). A UUID is an identifier that is unique across both + ids (UUIDs). A UUID is an identifier that is unique across both space and time, with respect to the space of all UUIDs. A UUID can be used for multiple purposes, from tagging objects with an extremely short lifetime, to reliably identifying very persistent objects @@ -118,7 +118,7 @@ Priority: optional Depends: ${shlibs:Depends} Architecture: any Description: stripped down universally unique id library, for debian-installer - libuuid generates and parses 128-bit universally unique id's (UUID's). + libuuid generates and parses 128-bit universally unique ids (UUIDs). See RFC 4122 for more information. . This is a minimal package for debian-installer. @@ -130,7 +130,7 @@ Depends: libc6-dev | libc-dev, libuuid1 (= ${mainBinary}) Replaces: e2fslibs-dev (<< 1.15) Architecture: any Description: universally unique id library - headers and static libraries - libuuid generates and parses 128-bit universally unique id's (UUID's). + libuuid generates and parses 128-bit universally unique ids (UUIDs). See RFC 4122 for more information. . This package contains the development environment for the uuid library. From d0c537748d5a9799dd0658b0a5cceaafc28084bb Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 18 Jul 2009 18:41:51 -0400 Subject: [PATCH 07/12] mke2fs: Add strings.h include for strcasecmp() declaration Signed-off-by: "Theodore Ts'o" --- misc/mke2fs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/mke2fs.c b/misc/mke2fs.c index a9b01cbd..e10fd352 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include From 95f65c3d70a7a883c3c98d7f53feed970dc64271 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 18 Jul 2009 22:14:58 -0400 Subject: [PATCH 08/12] debian: Allow building with util-linux-ng If building with util-linux-ng, we will use the external libblkid and libuuid, as well as disabling the internal fsck. Signed-off-by: "Theodore Ts'o" --- debian/{control => control.in} | 15 ++++-- debian/rules | 90 ++++++++++++++++++++++++++++++---- 2 files changed, 91 insertions(+), 14 deletions(-) rename debian/{control => control.in} (95%) diff --git a/debian/control b/debian/control.in similarity index 95% rename from debian/control rename to debian/control.in index f930dddb..f0f364f6 100644 --- a/debian/control +++ b/debian/control.in @@ -2,7 +2,11 @@ Source: e2fsprogs Section: admin Priority: required Maintainer: Theodore Y. Ts'o -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) +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, libblkid-dev (>= 2.16), uuid-dev (>= 2.16) +'', +``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 Homepage: http://e2fsprogs.sourceforge.net @@ -70,7 +74,7 @@ Description: command-line interface parsing library - headers and static librari It was originally inspired by the Multics SubSystem library. . This package contains the development environment for the ss library. - +ifdef(`UTIL_LINUX_NG',,`` Package: libuuid1 Section: libs Depends: passwd, ${shlibs:Depends} @@ -174,6 +178,7 @@ Description: block device id library - headers and static libraries system instead. . This package contains the development environment for the blkid library. +'')dnl Package: e2fsprogs-udeb XC-Package-Type: udeb @@ -245,7 +250,7 @@ Description: debugging information for e2fsprogs and its libraries, contained in the e2fsprogs and e2fsck-static packages. The debug information is used for execution tracing and core dump analysis. - +ifdef(`UTIL_LINUX_NG',,`` Package: uuid-runtime-dbg Section: debug Priority: extra @@ -256,6 +261,7 @@ Description: debugging information for uuid-runtime uuid runtime programs, contained in the uuid-runtime package. The debugging information is used for execution tracing and core dump analysis. +'')dnl Package: e2fslibs-dbg Section: debug @@ -286,7 +292,7 @@ Description: debugging information for libss2 This package includes the debug information useful for debugging the ss library, contained in the libss2 package. The debug information is used for execution tracing and core dump analysis. - +ifdef(`UTIL_LINUX_NG',,`` Package: libblkid1-dbg Section: debug Priority: extra @@ -306,3 +312,4 @@ Description: debugging information for libuuid1 This package includes the debug information useful for debugging the UUID library, contained in the libuuid1 package. The debug information is used for execution tracing and core dump analysis. +'')dnl diff --git a/debian/rules b/debian/rules index 9520b024..1ba79ff2 100755 --- a/debian/rules +++ b/debian/rules @@ -10,6 +10,13 @@ # be paranoid 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) +ifeq ($(SYS_BLKID_VER),2) +UTIL_LINUX_NG ?= yes +endif + # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) @@ -26,10 +33,15 @@ COMERR_VERSION = $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3) COMERR_SOVERSION = $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3) SS_VERSION = $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3) SS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3) + +ifneq ($(UTIL_LINUX_NG),yes) UUID_VERSION = $(shell grep ELF_VERSION lib/uuid/Makefile.in | cut '-d ' -f3) UUID_SOVERSION = $(shell grep ELF_SO_VERSION lib/uuid/Makefile.in | cut '-d ' -f3) + BLKID_VERSION = $(shell grep ELF_VERSION lib/blkid/Makefile.in | cut '-d ' -f3) BLKID_SOVERSION = $(shell grep ELF_SO_VERSION lib/blkid/Makefile.in | cut '-d ' -f3) +endif + EXT2FS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ext2fs/Makefile.in | cut '-d ' -f3) E2P_SOVERSION = $(shell grep ELF_SO_VERSION lib/e2p/Makefile.in | cut '-d ' -f3) @@ -39,14 +51,17 @@ topdir=$(shell pwd) debdir=${topdir}/debian tmpdir=${debdir}/tmp udebdir=${debdir}/e2fsprogs-udeb +ifneq ($(UTIL_LINUX_NG),yes) blkidudebdir=${debdir}/libblkid1-udeb uuidudebdir=${debdir}/libuuid1-udeb +endif libcomerrdir=${debdir}/libcomerr${COMERR_SOVERSION} comerrdevdir=${debdir}/comerr-dev libcomerrdbgdir=${debdir}/libcomerr2-dbg libssdir=${debdir}/libss${SS_SOVERSION} ssdevdir=${debdir}/ss-dev libssdbgdir=${debdir}/libss2-dbg +ifneq ($(UTIL_LINUX_NG),yes) libblkiddir=${debdir}/libblkid${BLKID_SOVERSION} libblkiddevdir=${debdir}/libblkid-dev libblkiddbgdir=${debdir}/libblkid1-dbg @@ -55,6 +70,7 @@ uuiddevdir=${debdir}/uuid-dev libuuiddbgdir=${debdir}/libuuid1-dbg uuidruntimedir=${debdir}/uuid-runtime uuidruntimedbgdir=${debdir}/uuid-runtime-dbg +endif libext2dir=${debdir}/e2fslibs libext2devdir=${debdir}/e2fslibs-dev libext2dbgdir=${debdir}/e2fslibs-dbg @@ -71,13 +87,15 @@ MANDIR=/usr/share/man mandir=${tmpdir}${MANDIR} UDEB_NAME = $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb -UDEB_PRIORITY = $(shell grep '^Package: e2fsprogs-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2) +UDEB_PRIORITY = $(shell grep '^Package: e2fsprogs-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2) +ifneq ($(UTIL_LINUX_NG),yes) BLKID_UDEB_NAME = libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb -BLKID_UDEB_PRIORITY = $(shell grep '^Package: libblkid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2) +BLKID_UDEB_PRIORITY = $(shell grep '^Package: libblkid1-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2) UUID_UDEB_NAME = libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb -UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2) +UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2) +endif STAMPSDIR=debian/stampdir CFGSTDSTAMP=${STAMPSDIR}/configure-std-stamp @@ -115,7 +133,13 @@ endif BF_CCOPTS = -Os -fomit-frame-pointer COMMON_CONF_FLAGS = \ - --enable-elf-shlibs --infodir=/usr/share/info --enable-fsck + --enable-elf-shlibs --infodir=/usr/share/info +ifeq ($(UTIL_LINUX_NG),yes) +COMMON_CONF_FLAGS += --disable-fsck --disable-libblkid \ + --disable-libuuid --disable-uuidd +else +COMMON_CONF_FLAGS += --enable-fsck +endif STD_CONF_FLAGS = --with-ccopts="${CCOPTS}" --enable-compression @@ -145,6 +169,16 @@ ismips=ismips endif endif +M4_ARGS= +ifeq ($(UTIL_LINUX_NG),yes) +M4_ARGS+=-DUTIL_LINUX_NG +else +M4_ARGS+=-UUTIL_LINUX_NG +endif + +debian/control: debian/control.in debian/rules + m4 $(M4_ARGS) < debian/control.in > $@ + ${CFGSTDSTAMP}: dh_testdir @@ -325,11 +359,13 @@ install-udeb: build ln -s e2fsck fsck.ext3 ; ln -s mke2fs mkfs.ext2 ; \ ln -s mke2fs mkfs.ext3 ; ln -s mke2fs mkfs.ext4) +ifneq ($(UTIL_LINUX_NG),yes) mkdir -p ${blkidudebdir}/lib mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib mkdir -p ${uuidudebdir}/lib mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib +endif binary-indep: # no arch-independant debs. @@ -358,9 +394,11 @@ binary-arch: install install-udeb # symlinks to prepare dh_installdocs run +ifneq ($(UTIL_LINUX_NG),yes) mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION} mkdir -p ${debdir}/libblkid-dev/usr/share/doc ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev +endif mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION} mkdir -p ${debdir}/ss-dev/usr/share/doc @@ -370,16 +408,20 @@ binary-arch: install install-udeb mkdir -p ${debdir}/comerr-dev/usr/share/doc ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev +ifneq ($(UTIL_LINUX_NG),yes) mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION} mkdir -p ${debdir}/uuid-dev/usr/share/doc # ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev +endif mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev +ifneq ($(UTIL_LINUX_NG),yes) $(INSTALL) -p -m 0644 debian/libblkid.copyright \ ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright +endif dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb @@ -416,11 +458,15 @@ binary-arch: install install-udeb dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info DH_OPTIONS= dh_installchangelogs -pe2fsprogs \ - -plibblkid${BLKID_SOVERSION} -plibcomerr${COMERR_SOVERSION} \ - -plibss${SS_SOVERSION} -plibuuid${UUID_SOVERSION} \ - -pe2fslibs -puuid-dev -puuid-runtime -pe2fsck-static \ - -pe2fsprogs-dbg -puuid-runtime-dbg -pe2fslibs-dbg \ - -plibcomerr2-dbg -plibss2-dbg -plibblkid1-dbg -plibuuid1-dbg + -plibcomerr${COMERR_SOVERSION} \ + -plibss${SS_SOVERSION} \ + -pe2fslibs -pe2fsck-static \ + -pe2fsprogs-dbg -pe2fslibs-dbg \ + -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 +endif dh_fixperms ifneq ($(ismips),) @@ -431,8 +477,10 @@ endif # debug package stuff rm -rf ${udebdir}/usr +ifneq ($(UTIL_LINUX_NG),yes) rm -rf ${blkidudebdir}/usr rm -rf ${uuidudebdir}/usr +endif mkdir -p ${debugdir}/usr/lib mv ${maindir}/usr/lib/debug ${debugdir}/usr/lib @@ -441,9 +489,11 @@ endif ${debugdir}/usr/lib/debug rm -rf ${e2fsckstaticdir}/usr/lib +ifneq ($(UTIL_LINUX_NG),yes) mkdir -p ${uuidruntimedbgdir}/usr/lib mv ${uuidruntimedir}/usr/lib/debug ${uuidruntimedbgdir}/usr/lib rmdir ${uuidruntimedir}/usr/lib +endif mkdir -p ${libext2dbgdir}/usr/lib mv ${libext2dir}/usr/lib/debug ${libext2dbgdir}/usr/lib @@ -457,6 +507,7 @@ endif mv ${libssdir}/usr/lib/debug ${libssdbgdir}/usr/lib rmdir ${libssdir}/usr/lib +ifneq ($(UTIL_LINUX_NG),yes) mkdir -p ${libuuiddbgdir}/usr/lib mv ${libuuiddir}/usr/lib/debug ${libuuiddbgdir}/usr/lib rmdir ${libuuiddir}/usr/lib @@ -464,10 +515,15 @@ endif mkdir -p ${libblkiddbgdir}/usr/lib mv ${libblkiddir}/usr/lib/debug ${libblkiddbgdir}/usr/lib rmdir ${libblkiddir}/usr/lib +endif # dpkg symbol handling ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS))) - for i in e2fslibs libcomerr2 libss2 libblkid1 libuuid1; \ +SYMBOL_LIBS := e2fslibs libcomerr2 libss2 +ifneq ($(UTIL_LINUX_NG),yes) +SYMBOL_LIBS += libblkid1 libuuid1 +endif + for i in $(SYMBOL_LIBS); \ do \ echo "Generating symbols for $$i..."; \ dpkg-gensymbols -p$$i -Pdebian/$$i > debian/$$i.tmp-patch; \ @@ -480,8 +536,10 @@ endif $(INSTALL) -p -m 0644 debian/e2fsprogs.copyright \ ${debugdir}/usr/share/doc/e2fsprogs-dbg/copyright +ifneq ($(UTIL_LINUX_NG),yes) $(INSTALL) -p -m 0644 debian/uuid-runtime.copyright \ ${uuidruntimedbgdir}/usr/share/doc/uuid-runtime-dbg/copyright +endif $(INSTALL) -p -m 0644 debian/e2fslibs.copyright \ ${libext2dbgdir}/usr/share/doc/e2fslibs-dbg/copyright @@ -492,21 +550,25 @@ endif $(INSTALL) -p -m 0644 debian/libss2.copyright \ ${libssdbgdir}/usr/share/doc/libss2-dbg/copyright +ifneq ($(UTIL_LINUX_NG),yes) $(INSTALL) -p -m 0644 debian/libblkid.copyright \ ${libblkiddbgdir}/usr/share/doc/libblkid1-dbg/copyright $(INSTALL) -p -m 0644 debian/libuuid1.copyright \ ${libuuiddbgdir}/usr/share/doc/libuuid1-dbg/copyright +endif dh_compress dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \ -V 'libcomerr2 (>= 1.33-3)' +ifneq ($(UTIL_LINUX_NG),yes) dh_makeshlibs -plibblkid${BLKID_SOVERSION} -V 'libblkid1 (>= 1.39-1)' echo "udeb: libblkid 1 libblkid1-udeb" >> \ debian/libblkid1/DEBIAN/shlibs echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs +endif dh_installdeb dh_shlibdeps -l${stdbuilddir}/lib @@ -521,20 +583,28 @@ endif -u '-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}' DH_OPTIONS= dh_gencontrol -pss-dev \ -u '-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}' +ifneq ($(UTIL_LINUX_NG),yes) DH_OPTIONS= dh_gencontrol -puuid-dev \ -u '-v${UUID_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}' +endif dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~ +ifneq ($(UTIL_LINUX_NG),yes) dh_gencontrol -plibblkid1-udeb -- -fdebian/files~ dh_gencontrol -plibuuid1-udeb -- -fdebian/files~ +endif dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY) +ifneq ($(UTIL_LINUX_NG),yes) dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY) dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY) +endif dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME) +ifneq ($(UTIL_LINUX_NG),yes) dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME) dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME) +endif binary: binary-indep binary-arch From 16e470e65010ba3f0516cf9cdf1bd6c98f064e3f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 19 Jul 2009 22:43:33 -0400 Subject: [PATCH 09/12] libext2fs: Fix regression in ext2fs_extent_set_bmap() Commit 0dc291611 introduced a regression when unmapping the first block in an extent. This caused e2fsck -fD to corrupt large directories if the directory has to shrink by more than one block. The problem was set_bmap should only go to a next leaf when setting a first block in an extent, and not when it is unmapping the first block in an extent. Addresses-Debian-Bug: #537510 Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/extent.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c index 7fcc2cf9..9d7b7de7 100644 --- a/lib/ext2fs/extent.c +++ b/lib/ext2fs/extent.c @@ -1296,11 +1296,12 @@ errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle, } if (retval) goto done; + retval = ext2fs_extent_get(handle, + EXT2_EXTENT_NEXT_LEAF, + &extent); + if (retval) + goto done; } - retval = ext2fs_extent_get(handle, EXT2_EXTENT_NEXT_LEAF, - &extent); - if (retval) - goto done; extent.e_pblk++; extent.e_lblk++; extent.e_len--; From 64cb68b3eab55f532a1b07e3778b75631e85f44a Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 19 Jul 2009 23:32:09 -0400 Subject: [PATCH 10/12] libext2fs: Improve debugging printf's in extent.c Comment out less common debugging printf's, and fix some type warnings. Add high-level debugging printf's for ext2fs_extent_goto(), ext2fs_extent_insert(), ext2fs_extent_delete(), ext2fs_extent_replace() Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/extent.c | 59 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c index 9d7b7de7..c47fbcc1 100644 --- a/lib/ext2fs/extent.c +++ b/lib/ext2fs/extent.c @@ -104,7 +104,7 @@ static void dbg_print_extent(char *desc, struct ext2fs_extent *extent) { if (desc) printf("%s: ", desc); - printf("extent: lblk %llu--%llu, len %lu, pblk %llu, flags: ", + printf("extent: lblk %llu--%llu, len %u, pblk %llu, flags: ", extent->e_lblk, extent->e_lblk + extent->e_len - 1, extent->e_len, extent->e_pblk); if (extent->e_flags & EXT2_EXTENT_FLAGS_LEAF) @@ -321,7 +321,7 @@ retry: return EXT2_ET_EXTENT_NO_NEXT; } if (op != EXT2_EXTENT_NEXT_SIB) { -#ifdef DEBUG +#ifdef DEBUG_GET_EXTENT printf("<<<< OP = %s\n", (op == EXT2_EXTENT_DOWN) ? "down" : ((op == EXT2_EXTENT_UP) ? "up" : "unknown")); @@ -352,7 +352,7 @@ retry: return EXT2_ET_EXTENT_NO_PREV; } if (op != EXT2_EXTENT_PREV_SIB) { -#ifdef DEBUG +#ifdef DEBUG_GET_EXTENT printf("<<<< OP = %s\n", (op == EXT2_EXTENT_DOWN_AND_LAST) ? "down/last" : ((op == EXT2_EXTENT_UP) ? "up" : "unknown")); @@ -366,7 +366,7 @@ retry: op = EXT2_EXTENT_DOWN; else op = EXT2_EXTENT_LAST_SIB; -#ifdef DEBUG +#ifdef DEBUG_GET_EXTENT printf("<<<< OP = %s\n", (op == EXT2_EXTENT_DOWN) ? "down" : "last_sib"); #endif @@ -481,7 +481,7 @@ retry: if (handle->level < handle->max_depth) path->visit_num = 1; } -#ifdef DEBUG +#ifdef DEBUG_GET_EXTENT printf("Down to level %d/%d, end_blk=%llu\n", handle->level, handle->max_depth, path->end_blk); @@ -495,7 +495,7 @@ retry: return EXT2_ET_NO_CURRENT_NODE; extent->e_flags = 0; -#ifdef DEBUG +#ifdef DEBUG_GET_EXTENT printf("(Left %d)\n", path->left); #endif @@ -628,7 +628,14 @@ static errcode_t extent_goto(ext2_extent_handle_t handle, return EXT2_ET_OP_NOT_SUPPORTED; } +#ifdef DEBUG + printf("goto extent ino %u, level %d, %llu\n", handle->ino, + leaf_level, blk); +#endif + +#ifdef DEBUG_GOTO_EXTENTS dbg_print_extent("root", &extent); +#endif while (1) { if (handle->max_depth - handle->level == leaf_level) { /* block is in this &extent */ @@ -658,7 +665,9 @@ static errcode_t extent_goto(ext2_extent_handle_t handle, if (retval) return retval; +#ifdef DEBUG_GOTO_EXTENTS dbg_print_extent("next", &extent); +#endif if (blk == extent.e_lblk) goto go_down; if (blk > extent.e_lblk) @@ -669,7 +678,9 @@ static errcode_t extent_goto(ext2_extent_handle_t handle, if (retval) return retval; +#ifdef DEBUG_GOTO_EXTENTS dbg_print_extent("prev", &extent); +#endif go_down: retval = ext2fs_extent_get(handle, EXT2_EXTENT_DOWN, @@ -677,7 +688,9 @@ static errcode_t extent_goto(ext2_extent_handle_t handle, if (retval) return retval; +#ifdef DEBUG_GOTO_EXTENTS dbg_print_extent("down", &extent); +#endif } } @@ -765,6 +778,11 @@ errcode_t ext2fs_extent_replace(ext2_extent_handle_t handle, if (!path->curr) return EXT2_ET_NO_CURRENT_NODE; +#ifdef DEBUG + printf("extent replace: %u ", handle->ino); + dbg_print_extent(0, extent); +#endif + if (handle->level == handle->max_depth) { ex = path->curr; @@ -922,7 +940,8 @@ static errcode_t extent_node_split(ext2_extent_handle_t handle) goto done; #ifdef DEBUG - printf("will copy to new node at block %lu\n", new_node_pblk); + printf("will copy to new node at block %lu\n", + (unsigned long) new_node_pblk); #endif /* Copy data into new block buffer */ @@ -1040,6 +1059,11 @@ errcode_t ext2fs_extent_insert(ext2_extent_handle_t handle, int flags, if (!handle->path) return EXT2_ET_NO_CURRENT_NODE; +#ifdef DEBUG + printf("extent insert: %u ", handle->ino); + dbg_print_extent(0, extent); +#endif + path = handle->path + handle->level; if (path->entries >= path->max_entries) { @@ -1132,6 +1156,11 @@ errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle, EXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE); +#ifdef DEBUG + printf("set_bmap ino %u log %lld phys %lld flags %d\n", + handle->ino, logical, physical, flags); +#endif + if (!(handle->fs->flags & EXT2_FLAG_RW)) return EXT2_ET_RO_FILSYS; @@ -1364,6 +1393,19 @@ errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags) if (!handle->path) return EXT2_ET_NO_CURRENT_NODE; +#ifdef DEBUG + { + struct ext2fs_extent extent; + + retval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, + &extent); + if (retval == 0) { + printf("extent delete %u ", handle->ino); + dbg_print_extent(0, &extent); + } + } +#endif + path = handle->path + handle->level; if (!path->curr) return EXT2_ET_NO_CURRENT_NODE; @@ -1886,7 +1928,8 @@ void do_goto_block(int argc, char **argv) retval = extent_goto(current_handle, level, (blk64_t) blk); if (retval) { - com_err(argv[0], retval, "while trying to go to block %lu, level %d", + com_err(argv[0], retval, + "while trying to go to block %u, level %d", blk, level); return; } From 8b5ed492de2584ce255cc87f054e987bf4e9c5f3 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 19 Jul 2009 23:37:44 -0400 Subject: [PATCH 11/12] libext2fs: Avoid creating unneeded new extents in ext2fs_extent_set_bmap() Avoiding inserting a new extent if it is possible to merge the new block to the beginning or the end of the previous or next extent. Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/extent.c | 118 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 93 insertions(+), 25 deletions(-) diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c index c47fbcc1..1505447d 100644 --- a/lib/ext2fs/extent.c +++ b/lib/ext2fs/extent.c @@ -1146,11 +1146,14 @@ errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle, int mapped = 1; /* logical is mapped? */ int orig_height; int extent_uninit = 0; + int prev_uninit = 0; + int next_uninit = 0; int new_uninit = 0; int max_len = EXT_INIT_MAX_LEN; + int has_prev, has_next; blk64_t orig_lblk; struct extent_path *path; - struct ext2fs_extent extent; + struct ext2fs_extent extent, next_extent, prev_extent; struct ext2fs_extent newextent; struct ext2_extent_info info; @@ -1222,12 +1225,44 @@ errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle, /* * This may be the extent *before* the requested logical, * if it's currently unmapped. + * + * Get the previous and next leaf extents, if they are present. */ retval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &extent); if (retval) goto done; if (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT) extent_uninit = 1; + retval = ext2fs_extent_get(handle, EXT2_EXTENT_NEXT_LEAF, &next_extent); + if (retval) { + has_next = 0; + if (retval != EXT2_ET_EXTENT_NO_NEXT) + goto done; + } else { + dbg_print_extent("set_bmap: next_extent", + &next_extent); + has_next = 1; + if (next_extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT) + next_uninit = 1; + } + retval = ext2fs_extent_goto(handle, logical); + if (retval && retval != EXT2_ET_EXTENT_NOT_FOUND) + goto done; + retval = ext2fs_extent_get(handle, EXT2_EXTENT_PREV_LEAF, &prev_extent); + if (retval) { + has_prev = 0; + if (retval != EXT2_ET_EXTENT_NO_PREV) + goto done; + } else { + has_prev = 1; + dbg_print_extent("set_bmap: prev_extent", + &prev_extent); + if (prev_extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT) + prev_uninit = 1; + } + retval = ext2fs_extent_goto(handle, logical); + if (retval && retval != EXT2_ET_EXTENT_NOT_FOUND) + goto done; /* check if already pointing to the requested physical */ if (mapped && (new_uninit == extent_uninit) && @@ -1248,6 +1283,28 @@ errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle, ((int) extent.e_len < max_len-1)) { extent.e_len++; retval = ext2fs_extent_replace(handle, 0, &extent); + } else if ((logical == extent.e_lblk - 1) && + (physical == extent.e_pblk - 1) && + (new_uninit == extent_uninit) && + ((int) extent.e_len < max_len - 1)) { + extent.e_len++; + extent.e_lblk--; + extent.e_pblk--; + retval = ext2fs_extent_replace(handle, 0, &extent); + } else if (has_next && + (logical == next_extent.e_lblk - 1) && + (physical == next_extent.e_pblk - 1) && + (new_uninit == next_uninit) && + ((int) next_extent.e_len < max_len - 1)) { + retval = ext2fs_extent_get(handle, + EXT2_EXTENT_NEXT_LEAF, + &next_extent); + if (retval) + goto done; + next_extent.e_len++; + next_extent.e_lblk--; + next_extent.e_pblk--; + retval = ext2fs_extent_replace(handle, 0, &next_extent); } else if (logical < extent.e_lblk) retval = ext2fs_extent_insert(handle, 0, &newextent); else @@ -1279,14 +1336,32 @@ errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle, #ifdef DEBUG printf("(re/un)mapping last block in extent\n"); #endif - /* Make sure insert works before replacing old extent */ if (physical) { - retval = ext2fs_extent_insert(handle, - EXT2_EXTENT_INSERT_AFTER, &newextent); + if (has_next && + (logical == (next_extent.e_lblk - 1)) && + (physical == (next_extent.e_pblk - 1)) && + (new_uninit == next_uninit) && + ((int) next_extent.e_len < max_len - 1)) { + retval = ext2fs_extent_get(handle, + EXT2_EXTENT_NEXT_LEAF, &next_extent); + if (retval) + goto done; + next_extent.e_len++; + next_extent.e_lblk--; + next_extent.e_pblk--; + retval = ext2fs_extent_replace(handle, 0, + &next_extent); + if (retval) + goto done; + } else + retval = ext2fs_extent_insert(handle, + EXT2_EXTENT_INSERT_AFTER, &newextent); if (retval) goto done; /* Now pointing at inserted extent; move back to prev */ - retval = ext2fs_extent_goto(handle, logical - 1); + retval = ext2fs_extent_get(handle, + EXT2_EXTENT_PREV_LEAF, + &extent); if (retval) goto done; } @@ -1299,30 +1374,23 @@ errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle, printf("(re/un)mapping first block in extent\n"); #endif if (physical) { - retval = ext2fs_extent_get(handle, - EXT2_EXTENT_PREV_LEAF, - &extent); - if (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT) - extent_uninit = 1; - if (retval == EXT2_ET_EXTENT_NO_PREV) { - retval = ext2fs_extent_goto(handle, logical); + if (has_prev && + (logical == (prev_extent.e_lblk + + prev_extent.e_len)) && + (physical == (prev_extent.e_pblk + + prev_extent.e_len)) && + (new_uninit == prev_uninit) && + ((int) prev_extent.e_len < max_len-1)) { + retval = ext2fs_extent_get(handle, + EXT2_EXTENT_PREV_LEAF, &prev_extent); if (retval) goto done; + prev_extent.e_len++; + retval = ext2fs_extent_replace(handle, 0, + &prev_extent); + } else retval = ext2fs_extent_insert(handle, 0, &newextent); - } else if (retval) - goto done; - else if ((logical == extent.e_lblk + extent.e_len) && - (physical == extent.e_pblk + extent.e_len) && - (new_uninit == extent_uninit) && - ((int) extent.e_len < max_len-1)) { - extent.e_len++; - retval = ext2fs_extent_replace(handle, 0, - &extent); - } else { - retval = ext2fs_extent_insert(handle, - EXT2_EXTENT_INSERT_AFTER, &newextent); - } if (retval) goto done; retval = ext2fs_extent_get(handle, From 776a374a57881d26af6532608e0084ddc028e8ec Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 20 Jul 2009 09:40:46 -0400 Subject: [PATCH 12/12] Update debian changelog and RELEASE-NOTES for interim release --- RELEASE-NOTES | 32 ++++++++++++++++++++++++++++++++ debian/changelog | 11 +++++++++++ version.h | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index bc9cc9f5..9cf84424 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -1,3 +1,35 @@ +E2fsprogs 1.41.9-WIP (July 20, 2009) commit 8b5ed492de +==================================== + +Fix regression in ext2fs_extent_set_bmap() caused e2fsck -fD to fail +and corrupt large directories if the directory needs to shrink by more +than one block. (Addresses Debian Bug: #537510) + +Fix e2fsck's buggy_init_scritps=1 so that the if the last write and/or +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) + +Fixed filefrag for non-extent based files. + +Fixed various Debian packaging issues --- see debian/changelog for +details. + +Programmer's Notes +------------------ + +Fixed miscellaneous gcc -Wall warnings. + +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. + +Improve ext2fs_extent_set_bmap() to avoid creating new extents which +get inserted into the extent tree when they are not needed. + + E2fsprogs 1.41.8 (July 11, 2009) ================================ diff --git a/debian/changelog b/debian/changelog index 556cd1ef..12edfebe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +e2fsprogs (1.41.8-2) unstable; urgency=low + + * Fix regression in ext2fs_extent_set_bmap() which caused e2fsck -fD + to fail on ext4 filesystems if the directory needs to shrink by more + than a block (Closes: #537510) + * Fixed filefrag for non-extent based files + * Fix use of apostrohe's in package descriptions + * Don't use dietlibc when building for mips and mipsel architectures + + -- Theodore Y. Ts'o Mon, 20 Jul 2009 09:38:21 -0400 + e2fsprogs (1.41.8-1) unstable; urgency=low * New upstream release diff --git a/version.h b/version.h index 5695135c..b0bc0572 100644 --- a/version.h +++ b/version.h @@ -8,4 +8,4 @@ */ #define E2FSPROGS_VERSION "1.41.8" -#define E2FSPROGS_DATE "11-Jul-2009" +#define E2FSPROGS_DATE "20-Jul-2009"