rpms/xfsprogs/F-10 xfsprogs-2.10.1-libdisk-gfs2.patch, NONE, 1.1 xfsprogs-2.10.1-parallel-build.patch, NONE, 1.1 xfsprogs-2.10.1-ustat.patch, NONE, 1.1 .cvsignore, 1.17, 1.18 sources, 1.18, 1.19 xfsprogs.spec, 1.41, 1.42

Eric Sandeen sandeen at fedoraproject.org
Mon Dec 8 05:29:46 UTC 2008


Author: sandeen

Update of /cvs/pkgs/rpms/xfsprogs/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14695

Modified Files:
	.cvsignore sources xfsprogs.spec 
Added Files:
	xfsprogs-2.10.1-libdisk-gfs2.patch 
	xfsprogs-2.10.1-parallel-build.patch 
	xfsprogs-2.10.1-ustat.patch 
Log Message:
* Sun Dec 07 2008 Eric Sandeen <sandeen at redhat.com> 2.10.2-1
- New upstream release, bugfix only.

* Wed Nov 26 2008 Eric Sandeen <sandeen at redhat.com> 2.10.1-4
- Add protection from borken sys_ustat
- Add final upstream versions of gfs2 & parallel build patches

* Wed Nov 12 2008 Eric Sandeen <sandeen at redhat.com> 2.10.1-2
- Recognize gfs/gfs2 in libdisk
- Enable parallel builds



xfsprogs-2.10.1-libdisk-gfs2.patch:

--- NEW FILE xfsprogs-2.10.1-libdisk-gfs2.patch ---
Recognize gfs & gfs2 disk formats.

Signed-off-by: Eric Sandeen <sandeen at sandeen.net>
---

Index: xfs-cmds-build/xfsprogs/libdisk/fstype.c
===================================================================
--- xfs-cmds-build.orig/xfsprogs/libdisk/fstype.c
+++ xfs-cmds-build/xfsprogs/libdisk/fstype.c
@@ -68,6 +68,7 @@ swapped(unsigned short a) {
     Added jfs - Christoph Hellwig
     Added sysv - Tim Launchbury
     Added udf - Bryce Nesbitt
+    Added gfs/gfs2 - Eric Sandeen
 */
 
 /*
@@ -192,6 +193,7 @@ fstype(const char *device) {
     struct hpfs_super_block hpfssb;
     struct adfs_super_block adfssb;
     struct sysv_super_block svsb;
+    struct gfs2_sb gfs2sb;
     struct stat statbuf;
 
     /* opening and reading an arbitrary unknown path can have
@@ -382,6 +384,21 @@ fstype(const char *device) {
     }
 
     if (!type) {
+	/* block 64 */
+	if (lseek(fd, GFS_SUPERBLOCK_OFFSET, SEEK_SET) != GFS_SUPERBLOCK_OFFSET
+	    || read(fd, (char *) &gfs2sb, sizeof(gfs2sb)) != sizeof(gfs2sb))
+	    goto io_error;
+	if (gfsmagic(gfs2sb)) {
+		if (gfsformat(gfs2sb) == GFS_FORMAT_FS &&
+		    gfsmultiformat(gfs2sb) == GFS_FORMAT_MULTI)
+			type = "gfs";
+		else if (gfsformat(gfs2sb) == GFS2_FORMAT_FS &&
+			 gfsmultiformat(gfs2sb) == GFS2_FORMAT_MULTI)
+			type = "gfs2";
+	}
+    }
+
+    if (!type) {
 	    /* perhaps the user tries to mount the swap space
 	       on a new disk; warn her before she does mkfs on it */
 	    int pagesize = getpagesize();
Index: xfs-cmds-build/xfsprogs/libdisk/fstype.h
===================================================================
--- xfs-cmds-build.orig/xfsprogs/libdisk/fstype.h
+++ xfs-cmds-build/xfsprogs/libdisk/fstype.h
@@ -242,6 +242,56 @@ struct ocfs_volume_label {
 #define ocfslabellen(o)	assemble2le(o.label_len)
 #define OCFS_MAGIC	"OracleCFS"
 
+/* Common gfs/gfs2 constants: */
+#define GFS_MAGIC               0x01161970
+#define GFS_DEFAULT_BSIZE       4096
+#define GFS_SUPERBLOCK_OFFSET	(0x10 * GFS_DEFAULT_BSIZE)
+#define GFS_LOCKNAME_LEN        64
+
+/* gfs1 constants: */
+#define GFS_FORMAT_FS           1309
+#define GFS_FORMAT_MULTI        1401
+/* gfs2 constants: */
+#define GFS2_FORMAT_FS          1801
+#define GFS2_FORMAT_MULTI       1900
+
+struct gfs2_meta_header {
+	char mh_magic[4];
+	char mh_type[4];
+	char __pad0[8];          /* Was generation number in gfs1 */
+	char mh_format[4];
+	char __pad1[4];          /* Was incarnation number in gfs1 */
+};
+
+struct gfs2_inum {
+	char no_formal_ino[8];
+	char no_addr[8];
+};
+
+struct gfs2_sb {
+	struct gfs2_meta_header sb_header;
+
+	char sb_fs_format[4];
+	char sb_multihost_format[4];
+	char  __pad0[4];  /* Was superblock flags in gfs1 */
+
+	char sb_bsize[4];
+	char sb_bsize_shift[4];
+	char __pad1[4];   /* Was journal segment size in gfs1 */
+
+	struct gfs2_inum sb_master_dir; /* Was jindex dinode in gfs1 */
+	struct gfs2_inum __pad2; /* Was rindex dinode in gfs1 */
+	struct gfs2_inum sb_root_dir;
+
+	char sb_lockproto[GFS_LOCKNAME_LEN];
+	char sb_locktable[GFS_LOCKNAME_LEN];
+	/* In gfs1, quota and license dinodes followed */
+};
+
+#define gfsmagic(s)		assemble4be(s.sb_header.mh_magic)
+#define gfsformat(s)		assemble4be(s.sb_fs_format)
+#define gfsmultiformat(s)	assemble4be(s.sb_multihost_format)
+
 static inline int
 assemble2le(char *p) {
 	return (p[0] | (p[1] << 8));
@@ -251,3 +301,8 @@ static inline int
 assemble4le(char *p) {
 	return (p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24));
 }
+
+static inline int
+assemble4be(char *p) {
+	return (p[3] | (p[2] << 8) | (p[1] << 16) | (p[0] << 24));
+}




xfsprogs-2.10.1-parallel-build.patch:

--- NEW FILE xfsprogs-2.10.1-parallel-build.patch ---

w parallel builds of the xfsprogs package

I got tired of waiting for xfsprogs to build
serially...

On a 16p altix, make -j16 (excluding the configure
phase) went from 2m16s to 15s.

I tossed this into an rpm and did a fedora scratch
build on all arches, they all passed - some of them,
at least, should have been doing parallel builds too.

So this has had reasonable testing.

Signed-off-by: Eric Sandeen <sandeen at sandeen.net>
---

Index: xfs-cmds/xfsprogs/Makefile
===================================================================
--- xfs-cmds.orig/xfsprogs/Makefile
+++ xfs-cmds/xfsprogs/Makefile
@@ -15,24 +15,36 @@ LSRCFILES = configure configure.in Makep
 LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
 	Logs/* built .census install.* install-dev.* *.gz
 
-SUBDIRS = include libxfs libxlog libxcmd libhandle libdisk \
-	copy db fsck growfs io logprint mkfs quota mdrestore repair rtcp \
-	m4 man doc po debian build
+LIB_SUBDIRS = include libxfs libxlog libxcmd libhandle libdisk
+TOOL_SUBDIRS = copy db fsck growfs io logprint mkfs quota \
+		mdrestore repair rtcp m4 man doc po debian build
 
-default: $(CONFIGURE)
+SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
+
+default: include/builddefs include/platform_defs.h
 ifeq ($(HAVE_BUILDDEFS), no)
 	$(MAKE) -C . $@
 else
-	$(SUBDIRS_MAKERULE)
+	$(MAKE) $(SUBDIRS)
 endif
 
+# tool/lib dependencies
+libxcmd: include
+copy mdrestore: libxfs
+db logprint: libxfs libxlog
+growfs: libxfs libxcmd
+io: libxcmd libhandle
+mkfs: libxfs libdisk
+quota: libxcmd
+repair: libxfs libxlog
+
 ifeq ($(HAVE_BUILDDEFS), yes)
 include $(BUILDRULES)
 else
 clean:	# if configure hasn't run, nothing to clean
 endif
 
-$(CONFIGURE):
+include/builddefs:
 	autoconf
 	./configure \
 		--prefix=/ \
@@ -48,16 +60,27 @@ $(CONFIGURE):
 		$$LOCAL_CONFIGURE_OPTIONS
 	touch .census
 
+include/platform_defs.h: include/builddefs
+## Recover from the removal of $@
+	@if test -f $@; then :; else \
+		rm -f include/builddefs; \
+		$(MAKE) $(AM_MAKEFLAGS) include/builddefs; \
+	fi
+
 aclocal.m4::
 	aclocal --acdir=`pwd`/m4 --output=$@
 
-install: default
-	$(SUBDIRS_MAKERULE)
+install: default $(addsuffix -install,$(SUBDIRS))
 	$(INSTALL) -m 755 -d $(PKG_DOC_DIR)
 	$(INSTALL) -m 644 README $(PKG_DOC_DIR)
 
-install-dev: default
-	$(SUBDIRS_MAKERULE)
+install-dev: default $(addsuffix -install-dev,$(SUBDIRS))
+
+%-install:
+	$(MAKE) -C $* install
+
+%-install-dev:
+	$(MAKE) -C $* install-dev
 
 realclean distclean: clean
 	rm -f $(LDIRT) $(CONFIGURE)
Index: xfs-cmds/xfsprogs/include/buildrules
===================================================================
--- xfs-cmds.orig/xfsprogs/include/buildrules
+++ xfs-cmds/xfsprogs/include/buildrules
@@ -6,16 +6,19 @@ _BUILDRULES_INCLUDED_ = 1
 
 include $(TOPDIR)/include/builddefs
 
-clean clobber : $(SUBDIRS)
+clean clobber : $(addsuffix -clean,$(SUBDIRS))
 	rm -f $(DIRT)
 	@rm -fr .libs
-	$(SUBDIRS_MAKERULE)
+%-clean:
+	$(MAKE) -C $* clean
 
 # Never blow away subdirs
 ifdef SUBDIRS
 .PRECIOUS: $(SUBDIRS)
+.PHONY: $(SUBDIRS)
+
 $(SUBDIRS):
-	$(SUBDIRS_MAKERULE)
+	$(MAKE) -C $@
 endif
 
 #
@@ -69,11 +72,13 @@ ifdef LTLIBRARY
 DEPENDSCRIPT := $(DEPENDSCRIPT) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,'
 endif
 
-depend : $(CFILES) $(HFILES)
-	$(SUBDIRS_MAKERULE)
+depend : $(CFILES) $(HFILES) $(addsuffix -depend,$(SUBDIRS))
 	$(DEPENDSCRIPT) > .dep
 	test -s .dep || rm -f .dep
 
+%-depend:
+	$(MAKE) -C $* depend
+
 # Include dep, but only if it exists
 ifeq ($(shell test -f .dep && echo .dep), .dep)
 include .dep
Index: xfs-cmds/xfsprogs/include/buildmacros
===================================================================
--- xfs-cmds.orig/xfsprogs/include/buildmacros
+++ xfs-cmds/xfsprogs/include/buildmacros
@@ -123,14 +123,6 @@ INSTALL_LINGUAS = \
 	done
 endif
 
-SUBDIRS_MAKERULE = \
-	@for d in $(SUBDIRS) ""; do \
-		if test -d "$$d" -a ! -z "$$d"; then \
-			$(ECHO) === $$d ===; \
-			$(MAKEF) -C $$d $@ || exit $$?; \
-		fi; \
-	done
-
 MAN_MAKERULE = \
 	@for f in *.[12345678] ""; do \
 		if test ! -z "$$f"; then \
Index: xfs-cmds/xfsprogs/man/Makefile
===================================================================
--- xfs-cmds.orig/xfsprogs/man/Makefile
+++ xfs-cmds/xfsprogs/man/Makefile
@@ -7,7 +7,16 @@ include $(TOPDIR)/include/builddefs
 
 SUBDIRS = man3 man5 man8
 
-default install install-dev : $(SUBDIRS)
-	$(SUBDIRS_MAKERULE)
+default : $(SUBDIRS)
+
+install : $(addsuffix -install,$(SUBDIRS))
+
+install-dev : $(addsuffix -install-dev,$(SUBDIRS))
+
+%-install:
+	$(MAKE) -C $* install
+
+%-install-dev:
+	$(MAKE) -C $* install-dev
 
 include $(BUILDRULES)

_______________________________________________
xfs mailing list
xfs at oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs



xfsprogs-2.10.1-ustat.patch:

--- NEW FILE xfsprogs-2.10.1-ustat.patch ---
Linux kernels (at least up until 2.6.27) are lacking compat sys_ustat
handlers on some platforms (notably PPC) so that if called from 32 bits
on a 64-bit kernel, the kernel will copy out too much (32 bytes onto a
20-byte structure):

[root at xero xfstests]# xfs_logprint /dev/loop0
xfs_logprint:
*** stack smashing detected ***: xfs_logprint terminated
Aborted

This will be fixed upstream, but for the benefit of older kernels we
may want to guard against this by padding the structure we pass into
the syscall.   We don't care about the values anyway, just the return
value.

Signed-off-by: Eric Sandeen <sandeen at sandeen.net>
---

Index: xfs-cmds/xfsprogs/libxfs/linux.c
===================================================================
--- xfs-cmds.orig/xfsprogs/libxfs/linux.c
+++ xfs-cmds/xfsprogs/libxfs/linux.c
@@ -49,7 +49,8 @@ static int max_block_alignment;
 int
 platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
 {
-	struct ustat	ust;
+	/* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */
+	struct ustat	ust[2];
 	struct stat64	st;
 
 	if (!s) {
@@ -60,7 +61,7 @@ platform_check_ismounted(char *name, cha
 		s = &st;
 	}
 
-	if (ustat(s->st_rdev, &ust) >= 0) {
+	if (ustat(s->st_rdev, ust) >= 0) {
 		if (verbose)
 			fprintf(stderr,
 				_("%s: %s contains a mounted filesystem\n"),


_______________________________________________
xfs mailing list
xfs at oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs




Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/xfsprogs/F-10/.cvsignore,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- .cvsignore	5 Sep 2008 20:01:35 -0000	1.17
+++ .cvsignore	8 Dec 2008 05:29:15 -0000	1.18
@@ -1 +1 @@
-xfsprogs_2.10.1-1.tar.gz
+xfsprogs_2.10.2-1.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xfsprogs/F-10/sources,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- sources	5 Sep 2008 20:01:35 -0000	1.18
+++ sources	8 Dec 2008 05:29:15 -0000	1.19
@@ -1 +1 @@
-8f0410aa8cfea0936969a3aab447009c  xfsprogs_2.10.1-1.tar.gz
+7d3d917b41dae79f9bc9b6ed24f45aa0  xfsprogs_2.10.2-1.tar.gz


Index: xfsprogs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xfsprogs/F-10/xfsprogs.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- xfsprogs.spec	5 Sep 2008 20:01:35 -0000	1.41
+++ xfsprogs.spec	8 Dec 2008 05:29:15 -0000	1.42
@@ -1,6 +1,6 @@
 Summary:	Utilities for managing the XFS filesystem
 Name:		xfsprogs
-Version:	2.10.1
+Version:	2.10.2
 Release:	1%{?dist}
 # Licensing based on generic "GNU GENERAL PUBLIC LICENSE"
 # in source, with no mention of version.
@@ -9,15 +9,19 @@
 License:	GPL+ and LGPLv2+
 Group:		System Environment/Base
 URL:		http://oss.sgi.com/projects/xfs/
-Source0:	ftp://oss.sgi.com/projects/xfs/download/cmd_tars/%{name}_%{version}-1.tar.gz
+Source0:	ftp://oss.sgi.com/projects/xfs/cmd_tars/%{name}_%{version}-1.tar.gz
 Source1:	xfsprogs-wrapper.h
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	libtool, gettext
-BuildRequires:	/usr/include/uuid/uuid.h
+BuildRequires:	e2fsprogs-devel
 Provides:	xfs-cmds
 Obsoletes:	xfs-cmds <= %{version}
 Conflicts:	xfsdump < 2.0.0
 
+Patch0:		xfsprogs-2.10.1-parallel-build.patch
+Patch1:		xfsprogs-2.10.1-libdisk-gfs2.patch
+Patch2:		xfsprogs-2.10.1-ustat.patch
+
 %description
 A set of commands to use the XFS filesystem, including mkfs.xfs.
 
@@ -47,6 +51,9 @@
 
 %prep
 %setup -q
+%patch0 -p2
+%patch1 -p2
+%patch2 -p2
 
 %build
 # xfsprogs abuses libexecdir
@@ -110,6 +117,17 @@
 %{_libdir}/*.so
 
 %changelog
+* Sun Dec 07 2008 Eric Sandeen <sandeen at redhat.com> 2.10.2-1
+- New upstream release, bugfix only.
+
+* Wed Nov 26 2008 Eric Sandeen <sandeen at redhat.com> 2.10.1-4
+- Add protection from borken sys_ustat
+- Add final upstream versions of gfs2 & parallel build patches
+
+* Wed Nov 12 2008 Eric Sandeen <sandeen at redhat.com> 2.10.1-2
+- Recognize gfs/gfs2 in libdisk
+- Enable parallel builds
+
 * Fri Sep 05 2008 Eric Sandeen <sandeen at redhat.com> 2.10.1-1
 - Update to xfsprogs 2.10.1
 - Add ASCII case-insensitive support to xfsprogs.




More information about the fedora-extras-commits mailing list