diff --git a/.cvsignore b/.cvsignore index 3f9e4e5..f88b490 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -xfsprogs-3.0.1.tar.gz +xfsprogs-3.0.3.tar.gz diff --git a/sources b/sources index ee5cdb4..d4c24dd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d7f879a21692d4f7abc16a20479b0829 xfsprogs-3.0.1.tar.gz +41bac47fb49a98857f346bbc1c164872 xfsprogs-3.0.3.tar.gz diff --git a/xfsprogs-3.0.1-fallocate.patch b/xfsprogs-3.0.1-fallocate.patch deleted file mode 100644 index 6e16793..0000000 --- a/xfsprogs-3.0.1-fallocate.patch +++ /dev/null @@ -1,267 +0,0 @@ -From: Eric Sandeen -Date: Mon, 18 May 2009 16:11:44 +0000 (-0500) -Subject: xfs_io: add fallocate command -X-Git-Url: http://git.kernel.org/?p=fs%2Fxfs%2Fxfsprogs-dev.git;a=commitdiff_plain;h=c0b5232a5eded15dc55abdad184811a21eab62b7 - -xfs_io: add fallocate command - -Based on Dave's earlier patch, but now we have an fallocate -glibc call... this also adds autoconf magic and a manpage -update. - -(hopefully not too #ifdef-heavy....) - -Signed-off-by: Eric Sandeen -Reviewed-by: Christoph Hellwig ---- - -diff --git a/configure.in b/configure.in -index 3fbd44e..8f5782a 100644 ---- a/configure.in -+++ b/configure.in -@@ -66,6 +66,7 @@ AC_HAVE_MINCORE - AC_HAVE_SENDFILE - AC_HAVE_GETMNTENT - AC_HAVE_GETMNTINFO -+AC_HAVE_FALLOCATE - - AC_TYPE_PSINT - AC_TYPE_PSUNSIGNED -diff --git a/include/builddefs.in b/include/builddefs.in -index c8f5c08..d6bf5c0 100644 ---- a/include/builddefs.in -+++ b/include/builddefs.in -@@ -94,6 +94,7 @@ HAVE_MINCORE = @have_mincore@ - HAVE_SENDFILE = @have_sendfile@ - HAVE_GETMNTENT = @have_getmntent@ - HAVE_GETMNTINFO = @have_getmntinfo@ -+HAVE_FALLOCATE = @have_fallocate@ - - GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall - # -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl -diff --git a/io/Makefile b/io/Makefile -index 6f10e8d..1a51879 100644 ---- a/io/Makefile -+++ b/io/Makefile -@@ -59,6 +59,10 @@ ifeq ($(ENABLE_EDITLINE),yes) - LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP) - endif - -+ifeq ($(HAVE_FALLOCATE),yes) -+LCFLAGS += -DHAVE_FALLOCATE -+endif -+ - default: $(LTCOMMAND) - - include $(BUILDRULES) -diff --git a/io/prealloc.c b/io/prealloc.c -index 6a2563e..7d9bd2f 100644 ---- a/io/prealloc.c -+++ b/io/prealloc.c -@@ -16,6 +16,9 @@ - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -+#if defined(HAVE_FALLOCATE) -+#include -+#endif - #include - #include - #include -@@ -26,6 +29,9 @@ static cmdinfo_t allocsp_cmd; - static cmdinfo_t freesp_cmd; - static cmdinfo_t resvsp_cmd; - static cmdinfo_t unresvsp_cmd; -+#if defined(HAVE_FALLOCATE) -+static cmdinfo_t falloc_cmd; -+#endif - - static int - offset_length( -@@ -119,6 +125,40 @@ unresvsp_f( - return 0; - } - -+#if defined (HAVE_FALLOCATE) -+static int -+fallocate_f( -+ int argc, -+ char **argv) -+{ -+ xfs_flock64_t segment; -+ int mode = 0; -+ int c; -+ -+ while ((c = getopt(argc, argv, "k")) != EOF) { -+ switch (c) { -+ case 'k': -+ mode = FALLOC_FL_KEEP_SIZE; -+ break; -+ default: -+ command_usage(&falloc_cmd); -+ } -+ } -+ if (optind != argc - 2) -+ return command_usage(&falloc_cmd); -+ -+ if (!offset_length(argv[optind], argv[optind+1], &segment)) -+ return 0; -+ -+ if (fallocate(file->fd, mode, -+ segment.l_start, segment.l_len)) { -+ perror("fallocate"); -+ return 0; -+ } -+ return 0; -+} -+#endif -+ - void - prealloc_init(void) - { -@@ -160,4 +200,17 @@ prealloc_init(void) - add_command(&freesp_cmd); - add_command(&resvsp_cmd); - add_command(&unresvsp_cmd); -+ -+#if defined (HAVE_FALLOCATE) -+ falloc_cmd.name = _("falloc"); -+ falloc_cmd.cfunc = fallocate_f; -+ falloc_cmd.argmin = 2; -+ falloc_cmd.argmax = -1; -+ falloc_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK; -+ falloc_cmd.args = _("[-k] off len"); -+ falloc_cmd.oneline = -+ _("allocates space associated with part of a file via fallocate"); -+ -+ add_command(&falloc_cmd); -+#endif - } -diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 -index 5156ced..1ac4666 100644 ---- a/m4/package_libcdev.m4 -+++ b/m4/package_libcdev.m4 -@@ -98,3 +98,21 @@ AC_DEFUN([AC_HAVE_GETMNTINFO], - AC_MSG_RESULT(no)) - AC_SUBST(have_getmntinfo) - ]) -+ -+# -+# Check if we have a fallocate libc call (Linux) -+# -+AC_DEFUN([AC_HAVE_FALLOCATE], -+ [ AC_MSG_CHECKING([for fallocate]) -+ AC_TRY_LINK([ -+#define _GNU_SOURCE -+#define _FILE_OFFSET_BITS 64 -+#include -+#include -+ ], [ -+ fallocate(0, 0, 0, 0); -+ ], have_fallocate=yes -+ AC_MSG_RESULT(yes), -+ AC_MSG_RESULT(no)) -+ AC_SUBST(have_fallocate) -+ ]) -diff --git a/man/man8/xfs_io.8 b/man/man8/xfs_io.8 -index 23bef94..6fc6bad 100644 ---- a/man/man8/xfs_io.8 -+++ b/man/man8/xfs_io.8 -@@ -295,6 +295,20 @@ system call described in the - .BR xfsctl (3) - manual page. - .TP -+.BI "falloc [ \-k ]" " offset length" -+Allocates reserved, unwritten space for part of a file using the -+fallocate routine as described in the -+.BR fallocate (3) -+manual page. -+.RS 1.0i -+.PD 0 -+.TP 0.4i -+.B \-k -+will set the FALLOC_FL_KEEP_SIZE flag as described in -+.BR fallocate (3). -+.PD -+.RE -+.TP - .BI truncate " offset" - Truncates the current file at the given offset using - .BR ftruncate (2). - ---- a/configure 2009-05-01 17:12:06.000000000 -0500 -+++ b/configure 2009-06-15 14:17:39.378265990 -0500 -@@ -788,6 +788,7 @@ - ac_subst_vars='LTLIBOBJS - LIBOBJS - have_zipped_manpages -+have_fallocate - have_getmntinfo - have_getmntent - have_sendfile -@@ -13979,6 +13980,65 @@ - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -+ { $as_echo "$as_me:$LINENO: checking for fallocate" >&5 -+$as_echo_n "checking for fallocate... " >&6; } -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+#define _GNU_SOURCE -+#define _FILE_OFFSET_BITS 64 -+#include -+#include -+ -+int -+main () -+{ -+ -+ fallocate(0, 0, 0, 0); -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (ac_try="$ac_link" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -+$as_echo "$ac_try_echo") >&5 -+ (eval "$ac_link") 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && { -+ test -z "$ac_c_werror_flag" || -+ test ! -s conftest.err -+ } && test -s conftest$ac_exeext && { -+ test "$cross_compiling" = yes || -+ $as_test_x conftest$ac_exeext -+ }; then -+ have_fallocate=yes -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+rm -rf conftest.dSYM -+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ -+ conftest$ac_exeext conftest.$ac_ext - - - { $as_echo "$as_me:$LINENO: checking for __psint_t " >&5 diff --git a/xfsprogs-3.0.1-overflows.patch b/xfsprogs-3.0.1-overflows.patch deleted file mode 100644 index f10b7ec..0000000 --- a/xfsprogs-3.0.1-overflows.patch +++ /dev/null @@ -1,84 +0,0 @@ -From: Eric Sandeen -Date: Thu, 2 Jul 2009 05:29:36 +0000 (-0500) -Subject: xfs_repair: fix agcount*agblocks overflows -X-Git-Url: http://git.kernel.org/?p=fs%2Fxfs%2Fxfsprogs-dev.git;a=commitdiff_plain;h=003e8e41124707f55b20b376a6359dc7f6292991 - -xfs_repair: fix agcount*agblocks overflows - -The last test in verify_ag_bno() may overflow: - -return (agbno >= (sbp->sb_dblocks - - ((sbp->sb_agcount - 1) * sbp->sb_agblocks))); - -because sb_agcount & sb_agblocks are 32-bit integers; this -may then miss corrupt agbnos for the last ag, which can in -turn lead to out of bounds memory accesses later, for example -when the block nr is used to offset in set_agbno_state(): - - addr = ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM; - -Similar problems in mk_incore_fstree - -Reported-by: Jesse Stroik -Signed-off-by: Eric Sandeen -Reviewed-by: Felix Blyakher ---- - - -From: Eric Sandeen -Date: Mon, 6 Jul 2009 19:53:35 +0000 (-0500) -Subject: xfs_metadump: agcount*agblocks overflow -X-Git-Url: http://git.kernel.org/?p=fs%2Fxfs%2Fxfsprogs-dev.git;a=commitdiff_plain;h=66be354ed0dfb73566f504ac7301fab7915e9475 - -xfs_metadump: agcount*agblocks overflow - -Found another potential overflow in xfs_metadump, -similar to those just fixed in repair. - -Signed-off-by: Eric Sandeen -Reviewed-by: Christoph Hellwig ---- - -diff --git a/repair/dinode.c b/repair/dinode.c -index fdf52db..84e1d05 100644 ---- a/repair/dinode.c -+++ b/repair/dinode.c -@@ -319,7 +319,8 @@ verify_ag_bno(xfs_sb_t *sbp, - return (agbno >= sbp->sb_agblocks); - if (agno == (sbp->sb_agcount - 1)) - return (agbno >= (sbp->sb_dblocks - -- ((sbp->sb_agcount - 1) * sbp->sb_agblocks))); -+ ((xfs_drfsbno_t)(sbp->sb_agcount - 1) * -+ sbp->sb_agblocks))); - return 1; - } - -diff --git a/repair/phase5.c b/repair/phase5.c -index 2c243b6..26f5aa2 100644 ---- a/repair/phase5.c -+++ b/repair/phase5.c -@@ -113,7 +113,8 @@ mk_incore_fstree(xfs_mount_t *mp, xfs_agnumber_t agno) - ag_end = mp->m_sb.sb_agblocks; - else - ag_end = mp->m_sb.sb_dblocks - -- mp->m_sb.sb_agblocks * (mp->m_sb.sb_agcount - 1); -+ (xfs_drfsbno_t)mp->m_sb.sb_agblocks * -+ (mp->m_sb.sb_agcount - 1); - - /* - * ok, now find the number of extents, keep track of the -diff --git a/db/metadump.c b/db/metadump.c -index 19aed4f..ef6e571 100644 ---- a/db/metadump.c -+++ b/db/metadump.c -@@ -222,7 +222,8 @@ valid_bno( - return 1; - if (agno == (mp->m_sb.sb_agcount - 1) && agbno > 0 && - agbno <= (mp->m_sb.sb_dblocks - -- (mp->m_sb.sb_agcount - 1) * mp->m_sb.sb_agblocks)) -+ (xfs_drfsbno_t)(mp->m_sb.sb_agcount - 1) * -+ mp->m_sb.sb_agblocks)) - return 1; - - return 0; - diff --git a/xfsprogs-3.0.1-readline.patch b/xfsprogs-3.0.1-readline.patch deleted file mode 100644 index b2e9b36..0000000 --- a/xfsprogs-3.0.1-readline.patch +++ /dev/null @@ -1,55 +0,0 @@ -[PATCH] xfsprogs: fix readline/editline for xfs_io and xfs_quota - -It looks like libxcmd wasn't ever being built with -DENABLE_READLINE -even when it was asked for by configure --enable-readline=yes -so xfs_io & xfs_quota didn't get the functionality. - -This seems to fix it up for me (fixes editline too while we're -at it). - -Signed-off-by: Eric Sandeen ---- - - -Index: xfsprogs-3.0.1/libxcmd/Makefile -=================================================================== ---- xfsprogs-3.0.1.orig/libxcmd/Makefile -+++ xfsprogs-3.0.1/libxcmd/Makefile -@@ -20,6 +20,14 @@ ifeq ($(HAVE_GETMNTINFO),yes) - LCFLAGS += -DHAVE_GETMNTINFO - endif - -+ifeq ($(ENABLE_READLINE),yes) -+LCFLAGS += -DENABLE_READLINE -+endif -+ -+ifeq ($(ENABLE_EDITLINE),yes) -+LCFLAGS += -DENABLE_EDITLINE -+endif -+ - default: $(LTLIBRARY) - - include $(BUILDRULES) - -Index: xfsprogs-3.0.1/growfs/Makefile -=================================================================== ---- xfsprogs-3.0.1.orig/growfs/Makefile -+++ xfsprogs-3.0.1/growfs/Makefile -@@ -10,6 +10,14 @@ LTCOMMAND = xfs_growfs - CFILES = xfs_growfs.c - - LLDLIBS = $(LIBXFS) $(LIBXCMD) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) -+ifeq ($(ENABLE_READLINE),yes) -+LLDLIBS += $(LIBREADLINE) $(LIBTERMCAP) -+endif -+ -+ifeq ($(ENABLE_EDITLINE),yes) -+LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP) -+endif -+ - LTDEPENDENCIES = $(LIBXFS) $(LIBXCMD) - LLDFLAGS = -static - LSRCFILES = xfs_info.sh - - - diff --git a/xfsprogs.spec b/xfsprogs.spec index e806d10..5640a28 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing the XFS filesystem Name: xfsprogs -Version: 3.0.1 -Release: 10%{?dist} +Version: 3.0.3 +Release: 1%{?dist} # Licensing based on generic "GNU GENERAL PUBLIC LICENSE" # in source, with no mention of version. # doc/COPYING file specifies what is GPL and what is LGPL @@ -17,12 +17,10 @@ Provides: xfs-cmds Obsoletes: xfs-cmds <= %{version} Conflicts: xfsdump < 3.0.1 -# These are upstream -Patch0: xfsprogs-3.0.1-readline.patch -Patch1: xfsprogs-3.0.1-fallocate.patch -Patch2: xfsprogs-3.0.1-overflows.patch -# This one, not yet -Patch3: xfsprogs-3.0.1-mkfs-lazy-count-default.patch +# Upstream patches: + +# Not-yet-upstream patches: +Patch1: xfsprogs-3.0.1-mkfs-lazy-count-default.patch %description A set of commands to use the XFS filesystem, including mkfs.xfs. @@ -67,10 +65,7 @@ in building or running the xfstests QA suite. %prep %setup -q -%patch0 -p1 %patch1 -p1 -%patch2 -p1 -%patch3 -p1 %build export tagname=CC DEBUG=-DNDEBUG @@ -197,6 +192,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/xfs/xfs_types.h %changelog +* Tue Sep 01 2009 Eric Sandeen 3.0.3-1 +- New upstream release + * Mon Jul 27 2009 Fedora Release Engineering - 3.0.1-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild