Skip to contentSkip to conversation

xfstests: miscellaneous patches

PATCH In review Dave Chinner 4 participants 16 messages Apr 29, 2010 – Apr 30, 2010

lore
Share & tools
lore
#0 lore raw

cover xfstests: miscellaneous patches

I've been carrying the following patches in my workarea for some time now. I figure I'm always applying them, so I might as well push them upstream. The first makes 030 pass again by filtering out the additional verbose messages that the latest repair has. The second adds more debug to test 222 so that if it fails theres a better chance of working out what went wrong. The last patch enables debian platforms to configure and compile dbtest and hence run test 10.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

PATCH 1/3 xfsqa: clean up 030 repair output

With the new checks in xfs_repair, it outputs more information about errors found than previously. This new output can be ignored for the purposeѕ of this test, so filter it all out. This will allow the test to run on new and old reapir binaries.

---
 common.repair |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
common.repair +5 -0
index ba42b8f..23a1ed6 100644
@@ -72,6 +72,11 @@ s/        - generate realtime summary info and bitmap...\n//g;
 s/\s+- creating \d+ worker thread\(s\)\n//g;
 s/\s+- reporting progress in intervals of \d+ minutes\n//g;
 s/\s+- \d+:\d\d:\d\d:.*\n//g;
+# 3.1.0 extra accounting output
+/^agf_/ && next; # remove agf counts
+/^agi_/ && next; # remove agi counts
+/^sb_/ && next; # remove sb counts
+/^agi unlinked/ && next; # remove agi unlinked bucket warning
 	print;'
 }
 
Signature · 6 lines
1.5.6.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] xfsqa: clean up 030 repair output

Quoted 4 lines · Dave Chinner

With the new checks in xfs_repair, it outputs more information about errors found than previously. This new output can be ignored for the purpose?? of this test, so filter it all out. This will allow the test to run on new and old reapir binaries.

Oh well, I had promised faking up the new output for too long time but never managed to do it, so let's just put this one in.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

PATCH 2/3 xfsqa: keep xfs_fsr output around in test 222

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

To confirm that xfs_fsr is doing the right thing, make it output debug and verbose messages and store them in the 222.full file so that it can be checked after the fact for correct operation.

---
 222 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
222 +1 -1
index 574c181..a65c845 100644
@@ -51,7 +51,7 @@ _supported_os Linux
 
 [ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found"
 
-xfs_fsr $TEST_MNT > /dev/null 2>&1
+xfs_fsr -d -v $TEST_MNT > $seq.full 2>&1
 
 echo "--- silence is golden ---"
 status=0 ; exit
Signature · 6 lines
1.5.6.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] xfsqa: keep xfs_fsr output around in test 222

Quoted 7 lines · Dave Chinner

From: Dave Chinner <[email protected]>

To confirm that xfs_fsr is doing the right thing, make it output debug and verbose messages and store them in the 222.full file so that it can be checked after the fact for correct operation.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw

PATCH 3/3 xfsqa: build dbtest on debian platforms

In reply to Dave Chinner

Set up autoconf to find the correct headers and compat libraries for debian squeeze, and massage the includes to ensure the right headers get included. Also fix a compile warning that was emitted now that it is being compiled.

---
 m4/package_gdbmdev.m4 |    8 ++++++--
 src/dbtest.c          |   18 +++++++++---------
 2 files changed, 15 insertions(+), 11 deletions(-)
m4/package_gdbmdev.m4 +6 -2
index d826acd..6580fba 100644
@@ -6,9 +6,13 @@ AC_DEFUN([AC_PACKAGE_WANT_NDBM],
   ])
 
 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
-  [ AC_CHECK_HEADERS([gdbm/ndbm.h], [ have_db=true ], [ have_db=false ])
+  [ AC_CHECK_HEADERS([gdbm/ndbm.h, gdbm-ndbm.h], [ have_db=true ], [ have_db=false ])
+    libgdbm=""
+    if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm_compat.a; then
+	libgdbm="${libexecdir}${libdirsuffix}/libgdbm_compat.a"
+    fi
     if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm.a; then
-	libgdbm="${libexecdir}${libdirsuffix}/libgdbm.a"
+	libgdbm="${libgdbm} ${libexecdir}${libdirsuffix}/libgdbm.a"
     fi
     AC_SUBST(libgdbm)
     AC_SUBST(have_db)
src/dbtest.c +9 -9
index 48667b7..297540f 100644
@@ -18,19 +18,17 @@
  
 #include "global.h"
 
-#ifdef HAVE_GDBM_NDBM_H
+#ifdef HAVE_GDBM_NDBM_H_
 #include <gdbm/ndbm.h>
-#else
-#ifdef HAVE_GDBM_H
+#elif HAVE_GDBM_NDBM_H
+#include <gdbm-ndbm.h>
+#elif HAVE_GDBM_H
 #include <gdbm.h>
-#else
-#ifdef HAVE_NDBM_H
+#elif HAVE_NDBM_H
 #include <ndbm.h>
 #else
 bozo!
 #endif
-#endif
-#endif
 
 
 /* #define WorkDir	"/xfs" */
@@ -144,7 +142,8 @@ int InitDbmLookup(int howmany)
 		fflush(stdout);
 	}
 	dbm = dbm_open(filename, O_WRONLY|O_CREAT, 0644);
-	if(dbm == NULL) DoSysError("\ndbm_open", (int)dbm);
+	if(dbm == NULL)
+		DoSysError("\ndbm_open", -1);
 
 	if ((KeyArray = (unsigned short *)calloc( howmany,
 				sizeof(unsigned short))) == NULL)
@@ -195,7 +194,8 @@ int InitDbmLookup(int howmany)
 		fflush(stdout);
 	}
 	dbm = dbm_open(filename, O_RDONLY, 0);
-	if(dbm == NULL) DoSysError("\ndbm_open", (int)dbm);
+	if(dbm == NULL)
+		DoSysError("\ndbm_open", -1);
 	return 0;
 }
 
Signature · 6 lines
1.5.6.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#6 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

Quoted 6 lines · Dave Chinner

Set up autoconf to find the correct headers and compat libraries for debian squeeze, and massage the includes to ensure the right headers get included. Also fix a compile warning that was emitted now that it is being compiled.

I missed a O_WRONLY->O_RDWR dbm_open fix (forgot to refresh the patch before sending the patchbomb) in this, so it builds but doesn't run.

Updated patch below.

Cheers,

Dave.

Signature · 15 lines
Dave Chinner
[email protected]

xfsqa: build dbtest on debian platforms

Set up autoconf to find the correct headers and compat libraries for
debian squeeze, and massage the includes to ensure the right headers get
included. Also fix a compile warning that was emitted now that it is being
compiled.

Signed-off-by: Dave Chinner <[email protected]>
---
 m4/package_gdbmdev.m4 |    8 ++++++--
 src/dbtest.c          |   24 ++++++++++++------------
 2 files changed, 18 insertions(+), 14 deletions(-)
m4/package_gdbmdev.m4 +6 -2
index d826acd..6580fba 100644
@@ -6,9 +6,13 @@ AC_DEFUN([AC_PACKAGE_WANT_NDBM],
   ])
 
 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
-  [ AC_CHECK_HEADERS([gdbm/ndbm.h], [ have_db=true ], [ have_db=false ])
+  [ AC_CHECK_HEADERS([gdbm/ndbm.h, gdbm-ndbm.h], [ have_db=true ], [ have_db=false ])
+    libgdbm=""
+    if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm_compat.a; then
+	libgdbm="${libexecdir}${libdirsuffix}/libgdbm_compat.a"
+    fi
     if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm.a; then
-	libgdbm="${libexecdir}${libdirsuffix}/libgdbm.a"
+	libgdbm="${libgdbm} ${libexecdir}${libdirsuffix}/libgdbm.a"
     fi
     AC_SUBST(libgdbm)
     AC_SUBST(have_db)
src/dbtest.c +12 -12
index 48667b7..ec8db0b 100644
@@ -18,19 +18,17 @@
  
 #include "global.h"
 
-#ifdef HAVE_GDBM_NDBM_H
+#ifdef HAVE_GDBM_NDBM_H_
 #include <gdbm/ndbm.h>
-#else
-#ifdef HAVE_GDBM_H
+#elif HAVE_GDBM_NDBM_H
+#include <gdbm-ndbm.h>
+#elif HAVE_GDBM_H
 #include <gdbm.h>
-#else
-#ifdef HAVE_NDBM_H
+#elif HAVE_NDBM_H
 #include <ndbm.h>
 #else
 bozo!
 #endif
-#endif
-#endif
 
 
 /* #define WorkDir	"/xfs" */
@@ -140,11 +138,12 @@ int InitDbmLookup(int howmany)
 
 	sprintf(filename, "%s-%d", DBNAME, (int)getpid());
 	if (debugflg) {
-		printf("dbm_open(%s, O_WRONLY|O_CREAT, 0644)\n", filename);
+		printf("dbm_open(%s, O_RDWR|O_CREAT, 0644)\n", filename);
 		fflush(stdout);
 	}
-	dbm = dbm_open(filename, O_WRONLY|O_CREAT, 0644);
-	if(dbm == NULL) DoSysError("\ndbm_open", (int)dbm);
+	dbm = dbm_open(filename, O_RDWR|O_CREAT, 0644);
+	if(dbm == NULL)
+		DoSysError("\ndbm_open", -1);
 
 	if ((KeyArray = (unsigned short *)calloc( howmany,
 				sizeof(unsigned short))) == NULL)
@@ -191,11 +190,12 @@ int InitDbmLookup(int howmany)
 	}
 	dbm_close(dbm); /* close to eliminate chance of in-memory caching */
 	if (debugflg) {
-		printf("dbm_open(%s, O_RDNLY, 0)\n", filename);
+		printf("dbm_open(%s, O_RDONLY, 0)\n", filename);
 		fflush(stdout);
 	}
 	dbm = dbm_open(filename, O_RDONLY, 0);
-	if(dbm == NULL) DoSysError("\ndbm_open", (int)dbm);
+	if(dbm == NULL)
+		DoSysError("\ndbm_open", -1);
 	return 0;
 }
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#7 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

Quoted 6 lines · Dave Chinner
Quoted 5 lines · Dave Chinner

Set up autoconf to find the correct headers and compat libraries for debian squeeze, and massage the includes to ensure the right headers get included. Also fix a compile warning that was emitted now that it is being compiled.

Quoted 7 lines
Quoted 1 line

I missed a O_WRONLY->O_RDWR dbm_open fix (forgot to refresh the patch before sending the patchbomb) in this, so it builds but doesn't run.

Updated patch below.

Well, that needs some documentation in the patch description.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

In reply to Dave Chinner

Spoken too soon. While this second patch at least compiles on my Debian testing system it doesn't link:

/tmp/ccWcHXtY.o: In function CleanupDbmLookup': /root/xfstests-dev/src/dbtest.c:304: undefined reference to dbm_close' /tmp/ccWcHXtY.o: In function `DoDbmLookup':
/root/xfstests-dev/src/dbtest.c:220: undefined reference to dbm_fetch' /root/xfstests-dev/src/dbtest.c:264: undefined reference to dbm_fetch' /tmp/ccWcHXtY.o: In function `InitDbmLookup':
/root/xfstests-dev/src/dbtest.c:144: undefined reference to dbm_open' /root/xfstests-dev/src/dbtest.c:178: undefined reference to dbm_store' /root/xfstests-dev/src/dbtest.c:191: undefined reference to dbm_close' /root/xfstests-dev/src/dbtest.c:196: undefined reference to dbm_open'
collect2: ld returned 1 exit status
make[2]: *** [dbtest] Error 1
make[1]: *** [src] Error 2
make: *** [default] Error 2

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#9 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

Quoted 15 lines · Christoph Hellwig

Spoken too soon. While this second patch at least compiles on my Debian testing system it doesn't link:

/tmp/ccWcHXtY.o: In function CleanupDbmLookup': /root/xfstests-dev/src/dbtest.c:304: undefined reference to dbm_close' /tmp/ccWcHXtY.o: In function `DoDbmLookup':
/root/xfstests-dev/src/dbtest.c:220: undefined reference to dbm_fetch' /root/xfstests-dev/src/dbtest.c:264: undefined reference to dbm_fetch' /tmp/ccWcHXtY.o: In function `InitDbmLookup':
/root/xfstests-dev/src/dbtest.c:144: undefined reference to dbm_open' /root/xfstests-dev/src/dbtest.c:178: undefined reference to dbm_store' /root/xfstests-dev/src/dbtest.c:191: undefined reference to dbm_close' /root/xfstests-dev/src/dbtest.c:196: undefined reference to dbm_open'
collect2: ld returned 1 exit status
make[2]: *** [dbtest] Error 1
make[1]: *** [src] Error 2
make: *** [default] Error 2

Where is libgdbm-compat on your system?

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#10 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

Quoted 17 lines · Dave Chinner
Quoted 15 lines · Christoph Hellwig

Spoken too soon. While this second patch at least compiles on my Debian testing system it doesn't link:

/tmp/ccWcHXtY.o: In function CleanupDbmLookup': /root/xfstests-dev/src/dbtest.c:304: undefined reference to dbm_close' /tmp/ccWcHXtY.o: In function `DoDbmLookup':
/root/xfstests-dev/src/dbtest.c:220: undefined reference to dbm_fetch' /root/xfstests-dev/src/dbtest.c:264: undefined reference to dbm_fetch' /tmp/ccWcHXtY.o: In function `InitDbmLookup':
/root/xfstests-dev/src/dbtest.c:144: undefined reference to dbm_open' /root/xfstests-dev/src/dbtest.c:178: undefined reference to dbm_store' /root/xfstests-dev/src/dbtest.c:191: undefined reference to dbm_close' /root/xfstests-dev/src/dbtest.c:196: undefined reference to dbm_open'
collect2: ld returned 1 exit status
make[2]: *** [dbtest] Error 1
make[1]: *** [src] Error 2
make: *** [default] Error 2

Quoted 1 line

Where is libgdbm-compat on your system?

I think we need to do a better job of defining what's required for this stuff--building and running. I know I had trouble the first time I set things up, and now that it works I have no recollection of the stuff that I did. It would be good to make it easier for people to get testing going, we might get more people actually running them in a wider variety of environments.

-Alex

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#11 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

Quoted 19 lines · Alex Elder
Quoted 16 lines · Dave Chinner
Quoted 15 lines · Christoph Hellwig

Spoken too soon. While this second patch at least compiles on my Debian testing system it doesn't link:

/tmp/ccWcHXtY.o: In function CleanupDbmLookup': /root/xfstests-dev/src/dbtest.c:304: undefined reference to dbm_close' /tmp/ccWcHXtY.o: In function `DoDbmLookup':
/root/xfstests-dev/src/dbtest.c:220: undefined reference to dbm_fetch' /root/xfstests-dev/src/dbtest.c:264: undefined reference to dbm_fetch' /tmp/ccWcHXtY.o: In function `InitDbmLookup':
/root/xfstests-dev/src/dbtest.c:144: undefined reference to dbm_open' /root/xfstests-dev/src/dbtest.c:178: undefined reference to dbm_store' /root/xfstests-dev/src/dbtest.c:191: undefined reference to dbm_close' /root/xfstests-dev/src/dbtest.c:196: undefined reference to dbm_open'
collect2: ld returned 1 exit status
make[2]: *** [dbtest] Error 1
make[1]: *** [src] Error 2
make: *** [default] Error 2

Quoted 1 line

Where is libgdbm-compat on your system?

Quoted 7 lines

I think we need to do a better job of defining what's required for this stuff--building and running. I know I had trouble the first time I set things up, and now that it works I have no recollection of the stuff that I did. It would be good to make it easier for people to get testing going, we might get more people actually running them in a wider variety of environments.

Making missing stuff gracefully handled runtime helps...

I also have a hacked up rpm for this, that way package dependencies take care of it all seamlessly:

BuildRequires:  autoconf, libtool, xfsprogs-devel, e2fsprogs-devel
BuildRequires:  libacl-devel, libattr-devel, libaio-devel
Requires:       bash, xfsprogs, xfsdump, perl, acl, attr, bind-utils
Requires:       bc, indent, quota

If I just knew a decent place to drop the stuff that was compliant with fs hierarchy rules, I'd toss it into fedora, and debian might not be far behind ...

-Eric

Quoted 7 lines

-Alex

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#12 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

In reply to Alex Elder
Quoted 18 lines · Alex Elder
Quoted 17 lines · Dave Chinner
Quoted 15 lines · Christoph Hellwig

Spoken too soon. While this second patch at least compiles on my Debian testing system it doesn't link:

/tmp/ccWcHXtY.o: In function CleanupDbmLookup': /root/xfstests-dev/src/dbtest.c:304: undefined reference to dbm_close' /tmp/ccWcHXtY.o: In function `DoDbmLookup':
/root/xfstests-dev/src/dbtest.c:220: undefined reference to dbm_fetch' /root/xfstests-dev/src/dbtest.c:264: undefined reference to dbm_fetch' /tmp/ccWcHXtY.o: In function `InitDbmLookup':
/root/xfstests-dev/src/dbtest.c:144: undefined reference to dbm_open' /root/xfstests-dev/src/dbtest.c:178: undefined reference to dbm_store' /root/xfstests-dev/src/dbtest.c:191: undefined reference to dbm_close' /root/xfstests-dev/src/dbtest.c:196: undefined reference to dbm_open'
collect2: ld returned 1 exit status
make[2]: *** [dbtest] Error 1
make[1]: *** [src] Error 2
make: *** [default] Error 2

Quoted 4 lines
Quoted 1 line

Where is libgdbm-compat on your system?

I think we need to do a better job of defining what's required for this stuff--building and running.

autoconf is supposed to handle that. If you don't have a critical package, autoconf will fail and ask you to install it. For non-critical packages or libraries, it just compiles it out. The above error indicates that my autoconf changes are not detecting the libgdbm_compat library correctly (no surprise, I just hacked a hack to make it work on my system) so once that is sorted dbtest won't even be built unless the libraries are installed and detected.

FWIW, Christoph, does the problem go away with a 'make distclean; make'?

Quoted 5 lines

I know I had trouble the first time I set things up, and now that it works I have no recollection of the stuff that I did. It would be good to make it easier for people to get testing going, we might get more people actually running them in a wider variety of environments.

A real source package for xfstests is the right way to do this, I think. That way installing the package can pull in the correct dependencies before you try to build it. There's only so much we can do if all you do is a git clone to install it...

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#13 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

Quoted 10 lines · Dave Chinner

autoconf is supposed to handle that. If you don't have a critical package, autoconf will fail and ask you to install it. For non-critical packages or libraries, it just compiles it out. The above error indicates that my autoconf changes are not detecting the libgdbm_compat library correctly (no surprise, I just hacked a hack to make it work on my system) so once that is sorted dbtest won't even be built unless the libraries are installed and detected.

FWIW, Christoph, does the problem go away with a 'make distclean; make'?

Yes, that fixes it and now I can run 010.

Thanks!

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#14 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

Quoted 9 lines · Christoph Hellwig
Quoted 8 lines · Dave Chinner

autoconf is supposed to handle that. If you don't have a critical package, autoconf will fail and ask you to install it. For non-critical packages or libraries, it just compiles it out. The above error indicates that my autoconf changes are not detecting the libgdbm_compat library correctly (no surprise, I just hacked a hack to make it work on my system) so once that is sorted dbtest won't even be built unless the libraries are installed and detected.

Quoted 7 lines
Quoted 2 lines

FWIW, Christoph, does the problem go away with a 'make distclean; make'?

Yes, that fixes it and now I can run 010.

Thanks!

OK, I'm about to mark the original post "Reviewed".

Meanwhile I think we should discuss packing, but I'll start that discussion in a separate message.

-Alex

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 3/3
#15 lore raw

Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms

In reply to Dave Chinner
Quoted 6 lines · Dave Chinner

Set up autoconf to find the correct headers and compat libraries for debian squeeze, and massage the includes to ensure the right headers get included. Also fix a compile warning that was emitted now that it is being compiled.

Ah, nice. I've been trying to get this working on Debian off and on again for years, but never got this far.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs