* [PATCH 0/9] xfstests: more generic fs work
@ 2009-05-27 18:53 Eric Sandeen
2009-05-27 18:53 ` [PATCH 1/9] Use xfs.h rather than libxfs.h Eric Sandeen
` (8 more replies)
0 siblings, 9 replies; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs
Several patches to facilitate generic filesystem testing in
xfstests.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 1/9] Use xfs.h rather than libxfs.h
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
@ 2009-05-27 18:53 ` Eric Sandeen
2009-05-28 9:56 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 2/9] Make libxfs.h optional Eric Sandeen
` (7 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs; +Cc: Eric Sandeen
Use xfs/xfs.h when possible rather than xfs/libxfs.h,
now that libxfs.h isn't part of a normal xfsprogs-devel
install.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
aclocal.m4 | 15 +++++++++++++--
configure.in | 1 +
m4/package_xfslibs.m4 | 10 ++++++++++
src/global.h | 12 ++++++++++++
src/godown.c | 2 +-
src/iopat.c | 2 +-
src/t_immutable.c | 6 +++++-
src/unwritten_mmap.c | 2 +-
src/xfsctl.c | 2 +-
9 files changed, 45 insertions(+), 7 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 52f1c7d..6cc5dce 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -405,6 +405,17 @@ AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE],
AC_SUBST(libuuid)
])
+AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
+ [ AC_CHECK_HEADERS([xfs/xfs.h])
+ if test "$ac_cv_header_xfs_xfs_h" != "yes"; then
+ echo
+ echo 'FATAL ERROR: cannot find a valid <xfs/xfs.h> header file.'
+ echo 'Install or upgrade the XFS development package.'
+ echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
+ exit 1
+ fi
+ ])
+
AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
[ AC_CHECK_HEADERS([xfs/libxfs.h])
if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
@@ -500,8 +511,8 @@ AC_DEFUN([AC_PACKAGE_NEED_IRIX_LIBHANDLE],
])
AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
- [ AC_MSG_CHECKING([xfsctl from xfs/libxfs.h])
- AC_TRY_LINK([#include <xfs/libxfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
+ [ AC_MSG_CHECKING([xfsctl from xfs/xfs.h])
+ AC_TRY_LINK([#include <xfs/xfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
[ echo ok ],
[ echo
echo 'FATAL ERROR: cannot find required macros in the XFS headers.'
diff --git a/configure.in b/configure.in
index 32a2496..f087454 100644
--- a/configure.in
+++ b/configure.in
@@ -44,6 +44,7 @@ in
;;
*)
AC_MULTILIB($enable_lib64)
+ AC_PACKAGE_NEED_XFS_XFS_H
AC_PACKAGE_NEED_XFS_LIBXFS_H
AC_PACKAGE_NEED_XFS_XQM_H
AC_PACKAGE_NEED_XFSCTL_MACRO
diff --git a/m4/package_xfslibs.m4 b/m4/package_xfslibs.m4
index cafd959..2c8d694 100644
--- a/m4/package_xfslibs.m4
+++ b/m4/package_xfslibs.m4
@@ -1,3 +1,13 @@
+AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
+ [ AC_CHECK_HEADERS([xfs/xfs.h])
+ if test "$ac_cv_header_xfs_xfs_h" != "yes"; then
+ echo
+ echo 'FATAL ERROR: cannot find a valid <xfs/xfs.h> header file.'
+ echo 'Run "make install-qa" from the xfsprogs source.'
+ exit 1
+ fi
+ ])
+
AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
[ AC_CHECK_HEADERS([xfs/libxfs.h])
if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
diff --git a/src/global.h b/src/global.h
index 158c1fa..a766cfd 100644
--- a/src/global.h
+++ b/src/global.h
@@ -26,6 +26,10 @@
#include <../../xfsprogs/include/irix.h>
#endif
+#ifdef HAVE_XFS_XFS_H
+#include <xfs/xfs.h>
+#endif
+
#ifdef HAVE_XFS_LIBXFS_H
#include <xfs/libxfs.h>
#endif
@@ -150,4 +154,12 @@
#include <sys/param.h>
#endif
+/*
+ * MAXNAMELEN is the length (including the terminating null) of
+ * the longest permissible file (component) name.
+ */
+#ifndef MAXNAMELEN
+#define MAXNAMELEN 256
+#endif
+
#endif
diff --git a/src/godown.c b/src/godown.c
index 4105aee..fa04f24 100644
--- a/src/godown.c
+++ b/src/godown.c
@@ -18,7 +18,7 @@
#include "global.h"
-/* These should be in libxfs.h */
+/* These should be in xfs.h */
#ifndef XFS_IOC_GOINGDOWN
#define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t)
#endif
diff --git a/src/iopat.c b/src/iopat.c
index 1e7d61b..c06071f 100644
--- a/src/iopat.c
+++ b/src/iopat.c
@@ -18,7 +18,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
-#include <xfs/libxfs.h>
+#include <xfs/xfs.h>
struct xfs_flock64 f;
int main(int argc, char **argv)
diff --git a/src/t_immutable.c b/src/t_immutable.c
index 667355b..07a36cd 100644
--- a/src/t_immutable.c
+++ b/src/t_immutable.c
@@ -38,7 +38,7 @@
#include <libgen.h>
#include <sys/acl.h>
#include <attr/xattr.h>
-#include <xfs/libxfs.h>
+#include <xfs/xfs.h>
#include <xfs/handle.h>
#include <xfs/jdm.h>
@@ -47,6 +47,10 @@
#define EXT2_APPEND_FL 0x00000020
#define EXT2_IOC_SETFLAGS _IOW('f', 2, long)
+#ifndef XFS_SUPER_MAGIC
+#define XFS_SUPER_MAGIC 0x58465342
+#endif
+
extern const char *__progname;
static int fsetflag(const char *path, int fd, int on, int immutable)
diff --git a/src/unwritten_mmap.c b/src/unwritten_mmap.c
index 5e63486..aec6a69 100644
--- a/src/unwritten_mmap.c
+++ b/src/unwritten_mmap.c
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
-#include <xfs/libxfs.h>
+#include <xfs/xfs.h>
#include <sys/mman.h>
/*
diff --git a/src/xfsctl.c b/src/xfsctl.c
index f8afb16..8fa3348 100644
--- a/src/xfsctl.c
+++ b/src/xfsctl.c
@@ -16,7 +16,7 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <xfs/libxfs.h>
+#include <xfs/xfs.h>
#include <xfs/jdm.h>
/* simple test program to try out a bunch of xfsctls:
--
1.5.5.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 2/9] Make libxfs.h optional
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
2009-05-27 18:53 ` [PATCH 1/9] Use xfs.h rather than libxfs.h Eric Sandeen
@ 2009-05-27 18:53 ` Eric Sandeen
2009-05-28 9:57 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 3/9] Support "generic" filesystem type Eric Sandeen
` (6 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs; +Cc: Eric Sandeen
libxfs.h is really only needed for the loggen test;
make it config-time optional.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
044 | 2 ++
aclocal.m4 | 12 +++---------
configure.in | 2 +-
include/builddefs.in | 1 +
m4/package_xfslibs.m4 | 11 +++--------
src/Makefile | 6 +++++-
6 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/044 b/044
index 7975db4..ba2d33b 100755
--- a/044
+++ b/044
@@ -108,6 +108,8 @@ _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1
[ $lversion -ne 1 ] && \
_notrun "Cannot run this test yet using MKFS_OPTIONS specified"
+[ $here/src/loggen ] || _notrun "loggen not built, skipping test"
+
_check_mount
_check_require_logdev
diff --git a/aclocal.m4 b/aclocal.m4
index 6cc5dce..ac616d1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -416,15 +416,9 @@ AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
fi
])
-AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
- [ AC_CHECK_HEADERS([xfs/libxfs.h])
- if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
- echo
- echo 'FATAL ERROR: cannot find a valid <xfs/libxfs.h> header file.'
- echo 'Install or upgrade the XFS development package.'
- echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
- exit 1
- fi
+AC_DEFUN([AC_PACKAGE_WANT_XFS_LIBXFS_H],
+ [ AC_CHECK_HEADERS([xfs/libxfs.h], [ have_libxfs=true ], [ have_libxfs=false ])
+ AC_SUBST(have_libxfs)
])
AC_DEFUN([AC_PACKAGE_NEED_XFS_XQM_H],
diff --git a/configure.in b/configure.in
index f087454..210a91e 100644
--- a/configure.in
+++ b/configure.in
@@ -45,7 +45,7 @@ in
*)
AC_MULTILIB($enable_lib64)
AC_PACKAGE_NEED_XFS_XFS_H
- AC_PACKAGE_NEED_XFS_LIBXFS_H
+ AC_PACKAGE_WANT_XFS_LIBXFS_H
AC_PACKAGE_NEED_XFS_XQM_H
AC_PACKAGE_NEED_XFSCTL_MACRO
AC_PACKAGE_NEED_XFS_HANDLE_H
diff --git a/include/builddefs.in b/include/builddefs.in
index 636f632..e8f4b6b 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -14,6 +14,7 @@ LOADERFLAGS = @LDFLAGS@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
+HAVE_LIBXFS = @have_libxfs@
LIBXFS = @libxfs@
LIBACL = @libacl@
LIBATTR = @libattr@
diff --git a/m4/package_xfslibs.m4 b/m4/package_xfslibs.m4
index 2c8d694..903e4a7 100644
--- a/m4/package_xfslibs.m4
+++ b/m4/package_xfslibs.m4
@@ -8,14 +8,9 @@ AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
fi
])
-AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
- [ AC_CHECK_HEADERS([xfs/libxfs.h])
- if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
- echo
- echo 'FATAL ERROR: cannot find a valid <xfs/libxfs.h> header file.'
- echo 'Run "make install-qa" from the xfsprogs source.'
- exit 1
- fi
+AC_DEFUN([AC_PACKAGE_WANT_LIBXFS_H],
+ [ AC_CHECK_HEADERS([xfs/libxfs.h], [ have_libxfs=true ], [ have_libxfs=false ])
+ AC_SUBST(have_libxfs)
])
AC_DEFUN([AC_PACKAGE_NEED_XFS_XQM_H],
diff --git a/src/Makefile b/src/Makefile
index 634e1b3..2a09488 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -12,11 +12,15 @@ TARGETS = dirstress fill fill2 getpagesize holes lstat64 \
godown resvtest writemod makeextents itrash rename \
multi_open_unlink dmiperf unwritten_sync genhashnames
-LINUX_TARGETS = loggen xfsctl bstat t_mtab getdevicesize \
+LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize \
preallo_rw_pattern_reader preallo_rw_pattern_writer ftrunc trunc \
fs_perms testx looptest locktest unwritten_mmap \
bulkstat_unlink_test bulkstat_unlink_test_modified t_dir_offset
+ifeq ($(HAVE_LIBXFS), true)
+LINUX_TARGETS += loggen
+endif
+
IRIX_TARGETS = open_unlink
ifeq ($(PKG_PLATFORM),linux)
--
1.5.5.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 3/9] Support "generic" filesystem type
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
2009-05-27 18:53 ` [PATCH 1/9] Use xfs.h rather than libxfs.h Eric Sandeen
2009-05-27 18:53 ` [PATCH 2/9] Make libxfs.h optional Eric Sandeen
@ 2009-05-27 18:53 ` Eric Sandeen
2009-05-28 9:58 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 4/9] 069: make scratch mkfs quiet Eric Sandeen
` (5 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs; +Cc: Eric Sandeen
Create a new "generic" _supported_fs type for tests
which are not really filesystem-specific. "generic"
tests do expect that acl & attr are supported though.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
001 | 2 +-
002 | 2 +-
005 | 2 +-
006 | 2 +-
007 | 2 +-
010 | 2 +-
011 | 2 +-
013 | 2 +-
014 | 2 +-
069 | 2 +-
070 | 2 +-
074 | 2 +-
076 | 2 +-
093 | 2 +-
097 | 2 +-
099 | 2 +-
100 | 2 +-
105 | 2 +-
123 | 2 +-
124 | 2 +-
125 | 2 +-
128 | 2 +-
131 | 2 +-
184 | 2 +-
193 | 2 +-
common.rc | 2 +-
new | 2 +-
27 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/001 b/001
index 2ff2c05..2dddffb 100755
--- a/001
+++ b/001
@@ -33,7 +33,7 @@ done_cleanup=false
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
verbose=true
diff --git a/002 b/002
index 13c6be3..c2d2b5a 100755
--- a/002
+++ b/002
@@ -30,7 +30,7 @@ _cleanup()
}
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
_setup_testdir
diff --git a/005 b/005
index d21dcb5..644f63d 100755
--- a/005
+++ b/005
@@ -53,7 +53,7 @@ _touch()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
# IRIX UDF does not support symlinks
if [ $FSTYP == 'udf' ]; then
diff --git a/006 b/006
index 4da277f..49b5949 100755
--- a/006
+++ b/006
@@ -40,7 +40,7 @@ _count()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
_setup_testdir
diff --git a/007 b/007
index 290f716..7a97d71 100755
--- a/007
+++ b/007
@@ -34,7 +34,7 @@ _cleanup()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
_setup_testdir
diff --git a/010 b/010
index c51ecb2..f1bc885 100755
--- a/010
+++ b/010
@@ -42,7 +42,7 @@ _filter_dbtest()
[ -x $here/src/dbtest ] || _notrun "dbtest was not built for this platform"
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
_setup_testdir
diff --git a/011 b/011
index 655229b..e1a3d7d 100755
--- a/011
+++ b/011
@@ -32,7 +32,7 @@ _cleanup()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
_setup_testdir
diff --git a/013 b/013
index 1c99e8f..e417d5a 100755
--- a/013
+++ b/013
@@ -78,7 +78,7 @@ _do_test()
# real QA test starts here
-_supported_fs xfs udf
+_supported_fs generic
_supported_os IRIX Linux
_setup_testdir
diff --git a/014 b/014
index acc3696..f5b64d0 100755
--- a/014
+++ b/014
@@ -30,7 +30,7 @@ _cleanup()
. ./common.rc
. ./common.filter
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
_setup_testdir
diff --git a/069 b/069
index 11efd98..4950901 100755
--- a/069
+++ b/069
@@ -23,7 +23,7 @@ trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
_require_scratch
diff --git a/070 b/070
index 65e158a..9302500 100755
--- a/070
+++ b/070
@@ -30,7 +30,7 @@ _cleanup()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
_setup_testdir
diff --git a/074 b/074
index d5e0364..0bd0807 100755
--- a/074
+++ b/074
@@ -97,7 +97,7 @@ _process_args()
# real QA test starts here
rm -f $here/$seq.full
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
#
diff --git a/076 b/076
index 975de2e..c0f6675 100755
--- a/076
+++ b/076
@@ -39,7 +39,7 @@ trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf
+_supported_fs generic
_supported_os IRIX Linux
_require_scratch
diff --git a/093 b/093
index c1243e2..1139788 100755
--- a/093
+++ b/093
@@ -43,7 +43,7 @@ _filefilter()
}
# real QA test starts here
-_supported_fs xfs udf
+_supported_fs generic
_supported_os IRIX
[ -x $runas ] || _notrun "$runas executable not found"
diff --git a/097 b/097
index b7fe1f2..9c38d18 100755
--- a/097
+++ b/097
@@ -58,7 +58,7 @@ else
fi
# real QA test starts here
-_supported_fs udf xfs
+_supported_fs generic
_supported_os IRIX
_require_scratch
diff --git a/099 b/099
index 1c5daeb..6b824dd 100755
--- a/099
+++ b/099
@@ -62,7 +62,7 @@ rm -f $seq.full
#-------------------------------------------------------
# real QA test starts here
-_supported_fs xfs udf
+_supported_fs generic
_supported_os IRIX
_acl_setup_ids
diff --git a/100 b/100
index aa6c4ca..57e9bb6 100755
--- a/100
+++ b/100
@@ -29,7 +29,7 @@ _cleanup()
}
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
# Use _populate_fs() in common.rc to create a directory structure.
diff --git a/105 b/105
index cd201dd..f154422 100755
--- a/105
+++ b/105
@@ -32,7 +32,7 @@ _cleanup()
. ./common.attr
# Modify as appropriate.
-_supported_fs xfs udf
+_supported_fs generic
_supported_os IRIX Linux
# real QA test starts here
diff --git a/123 b/123
index 63cd48f..ba7c454 100755
--- a/123
+++ b/123
@@ -57,7 +57,7 @@ _user_do()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os Linux IRIX
_require_user
diff --git a/124 b/124
index 29af340..5adef48 100755
--- a/124
+++ b/124
@@ -33,7 +33,7 @@ _cleanup()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os Linux
_setup_testdir
diff --git a/125 b/125
index ff538ef..f432034 100755
--- a/125
+++ b/125
@@ -28,7 +28,7 @@ _cleanup()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os Linux
_require_user
diff --git a/128 b/128
index 24bdac7..227d05c 100755
--- a/128
+++ b/128
@@ -30,7 +30,7 @@ _cleanup()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os Linux
_setup_testdir
diff --git a/131 b/131
index 78627f5..67adb81 100755
--- a/131
+++ b/131
@@ -28,7 +28,7 @@ _cleanup()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os Linux
_setup_testdir
diff --git a/184 b/184
index 30839cb..408e645 100755
--- a/184
+++ b/184
@@ -30,7 +30,7 @@ _cleanup()
. ./common.filter
# real QA test starts here
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
_setup_testdir
diff --git a/193 b/193
index 54c51a2..743c70f 100755
--- a/193
+++ b/193
@@ -50,7 +50,7 @@ _cleanup_files()
. ./common.filter
# real QA test starts here
-_supported_fs xfs nfs udf
+_supported_fs generic
_supported_os Linux
_require_user
diff --git a/common.rc b/common.rc
index 317e009..f649bc2 100644
--- a/common.rc
+++ b/common.rc
@@ -546,7 +546,7 @@ _supported_fs()
{
for f
do
- if [ "$f" = "$FSTYP" ]
+ if [ "$f" = "$FSTYP" -o "$f" = "generic" ]
then
return
fi
diff --git a/new b/new
index c924ffe..ac61221 100755
--- a/new
+++ b/new
@@ -99,7 +99,7 @@ _cleanup()
# real QA test starts here
# Modify as appropriate.
-_supported_fs xfs udf nfs
+_supported_fs generic
_supported_os IRIX Linux
# if error
--
1.5.5.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 4/9] 069: make scratch mkfs quiet
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
` (2 preceding siblings ...)
2009-05-27 18:53 ` [PATCH 3/9] Support "generic" filesystem type Eric Sandeen
@ 2009-05-27 18:53 ` Eric Sandeen
2009-05-28 9:58 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 5/9] Set up testdir for generic filesystems Eric Sandeen
` (4 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs; +Cc: Eric Sandeen
The _scratch_mkfs call in test 069 was not redirecting
stderr to /dev/null; other mkfs's may be more noisy
on stderr.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
069 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/069 b/069
index 4950901..78689ed 100755
--- a/069
+++ b/069
@@ -32,7 +32,7 @@ rm -f $seq.full
umount $SCRATCH_DEV >/dev/null 2>&1
echo "*** mkfs"
-_scratch_mkfs >/dev/null || _fail "mkfs failed"
+_scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
echo "*** mount FS"
_scratch_mount >/dev/null || _fail "mount failed"
--
1.5.5.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 5/9] Set up testdir for generic filesystems
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
` (3 preceding siblings ...)
2009-05-27 18:53 ` [PATCH 4/9] 069: make scratch mkfs quiet Eric Sandeen
@ 2009-05-27 18:53 ` Eric Sandeen
2009-05-28 9:59 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 6/9] Detect FS type to test based on TEST_DEV Eric Sandeen
` (3 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs; +Cc: Eric Sandeen
Make the default filesystem testdir setup the same as
what xfs did; simply set up the testdir variable.
Update the comment for UDF & NFS, as to why they are
currently doing something different.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
common.rc | 31 ++++++++++---------------------
1 files changed, 10 insertions(+), 21 deletions(-)
diff --git a/common.rc b/common.rc
index f649bc2..78514f4 100644
--- a/common.rc
+++ b/common.rc
@@ -988,15 +988,6 @@ _check_testdir()
esac
}
-
-_setup_xfs_testdir()
-{
- [ "$FSTYP" != "xfs" ] \
- && _fail "setup_xfs_testdir: \$FSTYP ($FSTYP) is not xfs"
-
- testdir=$TEST_DIR
-}
-
_setup_udf_scratchdir()
{
[ "$FSTYP" != "udf" ] \
@@ -1050,16 +1041,17 @@ _setup_nfs_scratchdir()
}
#
-# Warning for UDF and NFS this function calls _setup_udf_scratchdir and
-# _setup_udf_scratchdir. This is done because testdir is a persistent
-# XFS only partition.
+# Warning for UDF and NFS:
+# this function calls _setup_udf_scratchdir and _setup_udf_scratchdir
+# which actually uses the scratch dir for the test dir.
+#
+# This was done because testdir was intended to be a persistent
+# XFS only partition. This should eventually change, and treat
+# at least local filesystems all the same.
#
_setup_testdir()
{
case $FSTYP in
- xfs)
- _setup_xfs_testdir
- ;;
udf)
_setup_udf_scratchdir
;;
@@ -1067,7 +1059,7 @@ _setup_testdir()
_setup_nfs_scratchdir
;;
*)
- _fail "\$FSTYP is not xfs, udf or nfs"
+ testdir=$TEST_DIR
;;
esac
}
@@ -1075,10 +1067,6 @@ _setup_testdir()
_cleanup_testdir()
{
case $FSTYP in
- xfs)
- # do nothing, testdir is $TEST_DIR
- :
- ;;
udf)
# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
[ -n "$testdir" ] && $UMOUNT_PROG $testdir
@@ -1088,7 +1076,8 @@ _cleanup_testdir()
[ -n "$testdir" ] && $UMOUNT_PROG $testdir
;;
*)
- _fail "\$FSTYP is not xfs, udf or nfs"
+ # do nothing, testdir is $TEST_DIR
+ :
;;
esac
}
--
1.5.5.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 6/9] Detect FS type to test based on TEST_DEV
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
` (4 preceding siblings ...)
2009-05-27 18:53 ` [PATCH 5/9] Set up testdir for generic filesystems Eric Sandeen
@ 2009-05-27 18:53 ` Eric Sandeen
2009-05-28 9:59 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 7/9] Set default extN mount options Eric Sandeen
` (2 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs; +Cc: Eric Sandeen
This helps support generic / non-xfs fileystems.
Rather than defaulting to xfs or expecting a fs
type passed in, just look at what is on TEST_DEV
and use that for FSTYP by default.
We may wish to add a generic way to override this later.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
common | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/common b/common
index 92ec9e2..b5ca5d0 100644
--- a/common
+++ b/common
@@ -30,7 +30,13 @@ have_test_arg=false
randomize=false
rm -f $tmp.list $tmp.tmp $tmp.sed
-export FSTYP=xfs
+# Autodetect fs type based on what's on $TEST_DEV
+if [ "$HOSTOS" == "Linux" ]
+then
+ export FSTYP=`blkid -s TYPE -o value $TEST_DEV`
+else
+ export FSTYP=xfs
+fi
for r
do
--
1.5.5.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 7/9] Set default extN mount options
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
` (5 preceding siblings ...)
2009-05-27 18:53 ` [PATCH 6/9] Detect FS type to test based on TEST_DEV Eric Sandeen
@ 2009-05-27 18:53 ` Eric Sandeen
2009-05-28 9:11 ` Michael Monnerie
2009-05-28 10:01 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 8/9] Enable generic filesystems to be fsck'd Eric Sandeen
2009-05-27 18:53 ` [PATCH 9/9] Report which tests did get run Eric Sandeen
8 siblings, 2 replies; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs; +Cc: Eric Sandeen
ext2/3/4 don't support acls & attrs w/o specific mount
options, so make those the default whenever we mount
these filesystems.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
common.rc | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/common.rc b/common.rc
index 78514f4..54c36f3 100644
--- a/common.rc
+++ b/common.rc
@@ -49,6 +49,10 @@ _mount_opts()
nfs)
export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS
;;
+ ext2|ext3|ext4)
+ # acls & xattrs aren't turned on by default on ext$FOO
+ export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
+ ;;
*)
;;
esac
@@ -585,7 +589,7 @@ _require_scratch()
_notrun "this test requires a valid \$SCRATCH_DEV"
fi
;;
- nfs*|ext2|ext3|reiserfs)
+ nfs*|ext2|ext3|ext4|reiserfs)
echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
then
--
1.5.5.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 8/9] Enable generic filesystems to be fsck'd
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
` (6 preceding siblings ...)
2009-05-27 18:53 ` [PATCH 7/9] Set default extN mount options Eric Sandeen
@ 2009-05-27 18:53 ` Eric Sandeen
2009-05-28 12:51 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 9/9] Report which tests did get run Eric Sandeen
8 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs; +Cc: Eric Sandeen
This includes a fair bit of rearranging to avoid code duplication,
but the goal is to allow 'fsck -n -t $FSTYP $device' to be run on
any generic filesystem.
Any FS for which this doesn't work will need it's own fsck routine.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
common.rc | 164 ++++++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 130 insertions(+), 34 deletions(-)
diff --git a/common.rc b/common.rc
index 54c36f3..c0e6582 100644
--- a/common.rc
+++ b/common.rc
@@ -693,29 +693,36 @@ _require_user()
[ "$?" == "0" ] || _notrun "$qa_user user not defined."
}
-# check that a FS is mounted as XFS. if so, return mount point
+# check that a FS on a device ($1) is mounted (optionally as fstype ($2)).
+# if so, return mount point
#
-_xfs_mounted()
+_is_mounted()
{
- if [ $# -ne 1 ]
+ if [ $# -le 0 -o $# -ge 3 ]
then
- echo "Usage: _xfs_mounted device" 1>&2
+ echo "Usage: _is_mounted device [fstype]" 1>&2
exit 1
fi
device=$1
- if _mount | grep "$device " | $AWK_PROG '
- /type xfs/ { print $3 ; exit 0 }
- END { exit 1 }
+ if [ $# -eq 2 ]
+ then
+ fstype=$2
+ else
+ fstype=$FSTYP
+ fi
+
+ if _mount | grep "$device " | $AWK_PROG -v pattern="type $fstype" '
+ pattern { print $3 ; exit 0 }
+ END { exit 1 }
'
then
- echo "_xfs_mounted: $device is not a mounted XFS FS"
+ echo "_is_mounted: $device is not a mounted $fstype FS"
exit 1
fi
}
-
# remount a FS to a new mode (ro or rw)
#
_remount()
@@ -735,14 +742,105 @@ _remount()
fi
}
-# run xfs_check and friends on a FS.
+# Run the apropriate repair/check on a filesystem
#
# if the filesystem is mounted, it's either remounted ro before being
# checked or it's unmounted and then remounted
#
+# If set, we remount ro instead of unmounting for fsck
USE_REMOUNT=0
+_umount_or_remount_ro()
+{
+ if [ $# -ne 1 ]
+ then
+ echo "Usage: _umount_or_remount_ro device" 1>&2
+ exit 1
+ fi
+ device=$1
+
+ if [ $USE_REMOUNT -eq 0 ]
+ then
+ mountpoint=`_is_mounted $device`
+ $UMOUNT_PROG $device
+ else
+ _remount $device ro
+ fi
+ echo "$mountpoint"
+}
+
+_mount_or_remount_rw()
+{
+ if [ $# -ne 3 ]
+ then
+ echo "Usage: _mount_or_remount_rw opts device mountpoint" 1>&2
+ exit 1
+ fi
+ mount_opts=$1
+ device=$2
+ mountpoint=$3
+
+ if [ $USE_REMOUNT -eq 0 ]
+ then
+ if ! _mount -t $FSTYP $mount_opts $device $mountpoint
+ then
+ echo "!!! failed to remount $device on $mountpoint"
+ return 0 # ok=0
+ fi
+ else
+ _remount $device rw
+ fi
+
+ return 1 # ok=1
+}
+
+_check_generic_filesystem()
+{
+ device=$1
+
+ # If type is set, we're mounted
+ type=`_fs_type $device`
+ ok=1
+
+ if [ "$type" = "$FSTYP" ]
+ then
+ # mounted ...
+ mountpoint=`_umount_or_remount_ro $device`
+ fi
+
+ fsck -t $FSTYP -n $device >$tmp.fsck 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo "_check_generic_filesystem: filesystem on $device is inconsistent (see $seq.full)"
+
+ echo "_check_generic filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
+ echo "*** fsck.$FSTYP output ***" >>$here/$seq.full
+ cat $tmp.fsck >>$here/$seq.full
+ echo "*** end fsck.$FSTYP output" >>$here/$seq.full
+
+ ok=0
+ fi
+ rm -f $tmp.fsck
+
+ if [ $ok -eq 0 ]
+ then
+ echo "*** mount output ***" >>$here/$seq.full
+ _mount >>$here/$seq.full
+ echo "*** end mount output" >>$here/$seq.full
+ elif [ "$type" = "$FSTYP" ]
+ then
+ # was mounted ...
+ _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint
+ ok=$?
+ fi
+
+ [ $ok -eq 0 ] && exit 1
+ return 0
+}
+
+# run xfs_check and friends on a FS.
+
_check_xfs_filesystem()
{
if [ $# -ne 3 ]
@@ -773,15 +871,8 @@ _check_xfs_filesystem()
if [ "$type" = "xfs" ]
then
- # mounted...
-
- if [ $USE_REMOUNT -eq 0 ]
- then
- mountpoint=`_xfs_mounted $device`
- $UMOUNT_PROG $device
- else
- _remount $device ro
- fi
+ # mounted ...
+ mountpoint=`_umount_or_remount_ro $device`
fi
$XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \
@@ -834,17 +925,7 @@ _check_xfs_filesystem()
echo "*** end mount output" >>$here/$seq.full
elif [ "$type" = "xfs" ]
then
- # mounted...
- if [ $USE_REMOUNT -eq 0 ]
- then
- if ! _mount -t xfs $extra_mount_options $device $mountpoint
- then
- echo "!!! failed to remount $device on $mountpoint"
- ok=0
- fi
- else
- _remount $device rw
- fi
+ _mount_or_remount_rw "$extra_mount_options" $device $mountpoint
fi
[ $ok -eq 0 ] && exit 1
@@ -894,12 +975,13 @@ _check_udf_filesystem()
}
-_check_test_fs()
+_check_generic_test_fs()
{
- if [ "$FSTYP" != "xfs" ]; then
- return
- fi
+ _check_generic_filesystem $TEST_DEV
+}
+_check_xfs_test_fs()
+{
TEST_LOG="none"
TEST_RT="none"
[ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
@@ -918,6 +1000,18 @@ _check_test_fs()
fi
}
+_check_test_fs()
+{
+ case $FSTYP in
+ xfs)
+ _check_xfs_test_fs
+ ;;
+ *)
+ _check_generic_test_fs
+ ;;
+ esac
+}
+
_check_scratch_fs()
{
case $FSTYP in
@@ -939,6 +1033,7 @@ _check_scratch_fs()
# Don't know how to check an NFS filesystem, yet.
;;
*)
+ _check_generic_filesystem $SCRATCH_DEV
;;
esac
}
@@ -988,6 +1083,7 @@ _check_testdir()
# Don't know how to check an NFS filesystem, yet.
;;
*)
+ _check_generic_test_fs
;;
esac
}
--
1.5.5.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 9/9] Report which tests did get run
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
` (7 preceding siblings ...)
2009-05-27 18:53 ` [PATCH 8/9] Enable generic filesystems to be fsck'd Eric Sandeen
@ 2009-05-27 18:53 ` Eric Sandeen
2009-05-28 12:51 ` Christoph Hellwig
8 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-27 18:53 UTC (permalink / raw)
To: xfs; +Cc: Eric Sandeen
fs type mismatches are now likely enough that it may be
nice to report which tests -were- run at the end...
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
check | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/check b/check
index 7ca17ef..348b68e 100755
--- a/check
+++ b/check
@@ -8,7 +8,8 @@
tmp=/tmp/$$
status=0
needwrap=true
-try=0
+n_try=0
+try=""
n_bad=0
bad=""
notrun=""
@@ -86,7 +87,7 @@ END { if (NR > 0) {
if [ -f $tmp.expunged ]
then
notrun=`wc -l <$tmp.expunged | sed -e 's/ *//g'`
- try=`expr $try - $notrun`
+ n_try=`expr $n_try - $notrun`
list=`echo "$list" | sed -f $tmp.expunged`
fi
@@ -95,20 +96,26 @@ END { if (NR > 0) {
echo $list | fmt | sed -e 's/^/ /' >>check.log
$interrupt && echo "Interrupted!" >>check.log
+ if [ ! -z "$n_try" -a $n_try != 0 ]
+ then
+ echo "Ran:$try"
+ fi
+
if [ ! -z "$notrun" ]
then
echo "Not run:$notrun"
echo "Not run:$notrun" >>check.log
fi
+
if [ ! -z "$n_bad" -a $n_bad != 0 ]
then
echo "Failures:$bad"
- echo "Failed $n_bad of $try tests"
+ echo "Failed $n_bad of $n_try tests"
echo "Failures:$bad" | fmt >>check.log
- echo "Failed $n_bad of $try tests" >>check.log
+ echo "Failed $n_bad of $n_try tests" >>check.log
else
- echo "Passed all $try tests"
- echo "Passed all $try tests" >>check.log
+ echo "Passed all $n_try tests"
+ echo "Passed all $n_try tests" >>check.log
fi
needwrap=false
fi
@@ -281,7 +288,11 @@ do
n_bad=`expr $n_bad + 1`
quick=false
fi
- [ -f $seq.notrun ] || try=`expr $try + 1`
+ if [ ! -f $seq.notrun ]
+ then
+ try="$try $seq"
+ n_try=`expr $n_try + 1`
+ fi
seq="after_$seq"
_check_test_fs
--
1.5.5.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 7/9] Set default extN mount options
2009-05-27 18:53 ` [PATCH 7/9] Set default extN mount options Eric Sandeen
@ 2009-05-28 9:11 ` Michael Monnerie
2009-05-28 10:02 ` Christoph Hellwig
2009-05-28 10:01 ` Christoph Hellwig
1 sibling, 1 reply; 35+ messages in thread
From: Michael Monnerie @ 2009-05-28 9:11 UTC (permalink / raw)
To: xfs
[-- Attachment #1.1: Type: text/plain, Size: 608 bytes --]
On Mittwoch 27 Mai 2009 Eric Sandeen wrote:
> ext2/3/4 don't support acls & attrs w/o specific mount
> options, so make those the default whenever we mount
> these filesystems.
The same for reiserfs, but I don't know if that is wanted/needed.
mfg zmi
--
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/9] Use xfs.h rather than libxfs.h
2009-05-27 18:53 ` [PATCH 1/9] Use xfs.h rather than libxfs.h Eric Sandeen
@ 2009-05-28 9:56 ` Christoph Hellwig
2009-05-28 15:46 ` [PATCH 0.5/9] Replace MAXNAMELEN with NAME_MAX + 1 Eric Sandeen
2009-05-28 16:16 ` [PATCH 1/9 V2] Use xfs.h rather than libxfs.h Eric Sandeen
0 siblings, 2 replies; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 9:56 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Wed, May 27, 2009 at 01:53:25PM -0500, Eric Sandeen wrote:
> Use xfs/xfs.h when possible rather than xfs/libxfs.h,
> now that libxfs.h isn't part of a normal xfsprogs-devel
> install.
> +/*
> + * MAXNAMELEN is the length (including the terminating null) of
> + * the longest permissible file (component) name.
> + */
> +#ifndef MAXNAMELEN
> +#define MAXNAMELEN 256
> +#endif
Just switch all users to the posix NAME_MAX instead. Note that NAME_MAX
does not include the NULL termination, so it's one-off vs MAXNAMELEN.
> diff --git a/src/godown.c b/src/godown.c
> index 4105aee..fa04f24 100644
> --- a/src/godown.c
> +++ b/src/godown.c
> @@ -18,7 +18,7 @@
>
> #include "global.h"
>
> -/* These should be in libxfs.h */
> +/* These should be in xfs.h */
> #ifndef XFS_IOC_GOINGDOWN
> #define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t)
> #endif
Might be worth to remove now as we had it in xfs_fs.h forever.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/9] Make libxfs.h optional
2009-05-27 18:53 ` [PATCH 2/9] Make libxfs.h optional Eric Sandeen
@ 2009-05-28 9:57 ` Christoph Hellwig
2009-05-28 14:59 ` Eric Sandeen
0 siblings, 1 reply; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 9:57 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Wed, May 27, 2009 at 01:53:26PM -0500, Eric Sandeen wrote:
> libxfs.h is really only needed for the loggen test;
> make it config-time optional.
Maybe we should just move loggen into xfsprogs?
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/9] Support "generic" filesystem type
2009-05-27 18:53 ` [PATCH 3/9] Support "generic" filesystem type Eric Sandeen
@ 2009-05-28 9:58 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 9:58 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Wed, May 27, 2009 at 01:53:27PM -0500, Eric Sandeen wrote:
> Create a new "generic" _supported_fs type for tests
> which are not really filesystem-specific. "generic"
> tests do expect that acl & attr are supported though.
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 4/9] 069: make scratch mkfs quiet
2009-05-27 18:53 ` [PATCH 4/9] 069: make scratch mkfs quiet Eric Sandeen
@ 2009-05-28 9:58 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 9:58 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Wed, May 27, 2009 at 01:53:28PM -0500, Eric Sandeen wrote:
> The _scratch_mkfs call in test 069 was not redirecting
> stderr to /dev/null; other mkfs's may be more noisy
> on stderr.
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 5/9] Set up testdir for generic filesystems
2009-05-27 18:53 ` [PATCH 5/9] Set up testdir for generic filesystems Eric Sandeen
@ 2009-05-28 9:59 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 9:59 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 6/9] Detect FS type to test based on TEST_DEV
2009-05-27 18:53 ` [PATCH 6/9] Detect FS type to test based on TEST_DEV Eric Sandeen
@ 2009-05-28 9:59 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 9:59 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Wed, May 27, 2009 at 01:53:30PM -0500, Eric Sandeen wrote:
> This helps support generic / non-xfs fileystems.
>
> Rather than defaulting to xfs or expecting a fs
> type passed in, just look at what is on TEST_DEV
> and use that for FSTYP by default.
>
> We may wish to add a generic way to override this later.
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 7/9] Set default extN mount options
2009-05-27 18:53 ` [PATCH 7/9] Set default extN mount options Eric Sandeen
2009-05-28 9:11 ` Michael Monnerie
@ 2009-05-28 10:01 ` Christoph Hellwig
2009-05-28 14:57 ` Eric Sandeen
1 sibling, 1 reply; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 10:01 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Wed, May 27, 2009 at 01:53:31PM -0500, Eric Sandeen wrote:
> ext2/3/4 don't support acls & attrs w/o specific mount
> options, so make those the default whenever we mount
> these filesystems.
>
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
> ---
> common.rc | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/common.rc b/common.rc
> index 78514f4..54c36f3 100644
> --- a/common.rc
> +++ b/common.rc
> @@ -49,6 +49,10 @@ _mount_opts()
> nfs)
> export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS
> ;;
> + ext2|ext3|ext4)
> + # acls & xattrs aren't turned on by default on ext$FOO
> + export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
> + ;;
This part looks good.
> @@ -585,7 +589,7 @@ _require_scratch()
> _notrun "this test requires a valid \$SCRATCH_DEV"
> fi
> ;;
> - nfs*|ext2|ext3|reiserfs)
> + nfs*|ext2|ext3|ext4|reiserfs)
> echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
> if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
This whole function looks fishy to me, but just treating ext4 the same
as ext2/ext3 makes sense at least.
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 7/9] Set default extN mount options
2009-05-28 9:11 ` Michael Monnerie
@ 2009-05-28 10:02 ` Christoph Hellwig
2009-05-28 10:35 ` Michael Monnerie
0 siblings, 1 reply; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 10:02 UTC (permalink / raw)
To: Michael Monnerie; +Cc: xfs
On Thu, May 28, 2009 at 11:11:31AM +0200, Michael Monnerie wrote:
> On Mittwoch 27 Mai 2009 Eric Sandeen wrote:
> > ext2/3/4 don't support acls & attrs w/o specific mount
> > options, so make those the default whenever we mount
> > these filesystems.
>
> The same for reiserfs, but I don't know if that is wanted/needed.
>From a look at the point option parser it would need the same
options.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 7/9] Set default extN mount options
2009-05-28 10:02 ` Christoph Hellwig
@ 2009-05-28 10:35 ` Michael Monnerie
2009-05-28 14:56 ` Eric Sandeen
0 siblings, 1 reply; 35+ messages in thread
From: Michael Monnerie @ 2009-05-28 10:35 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
[-- Attachment #1.1: Type: text/plain, Size: 760 bytes --]
On Donnerstag 28 Mai 2009 Christoph Hellwig wrote:
> > The same for reiserfs, but I don't know if that is wanted/needed.
>
> From a look at the point option parser it would need the same
> options.
Sorry, didn't express it well. Try to clear up: I know the options are
needed for ACLs, as I use reiserfs a lot, but I don't know if it's in
the list of FSs that are to be directly supported.
mfg zmi
--
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 8/9] Enable generic filesystems to be fsck'd
2009-05-27 18:53 ` [PATCH 8/9] Enable generic filesystems to be fsck'd Eric Sandeen
@ 2009-05-28 12:51 ` Christoph Hellwig
2009-06-02 12:38 ` Christoph Hellwig
0 siblings, 1 reply; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 12:51 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Wed, May 27, 2009 at 01:53:32PM -0500, Eric Sandeen wrote:
> This includes a fair bit of rearranging to avoid code duplication,
> but the goal is to allow 'fsck -n -t $FSTYP $device' to be run on
> any generic filesystem.
>
> Any FS for which this doesn't work will need it's own fsck routine.
Looks generally good, some comments:
- I would get rid of _check_generic_test_fs and just opencode the
_check_generic_filesystem $TEST_DEV in the two callers.
- why the odd calling convention of _is_mounted which allows to
optionally pass the fstype? Currently we only have one caller
that doesn't pass it, and if we grow one that needs it I would
rather always pass it explicitly..
Btw, I seems like _check_testdir is never actually called, and I can't
really see a reason why it would be different from _check_test_fs.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 9/9] Report which tests did get run
2009-05-27 18:53 ` [PATCH 9/9] Report which tests did get run Eric Sandeen
@ 2009-05-28 12:51 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 12:51 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Wed, May 27, 2009 at 01:53:33PM -0500, Eric Sandeen wrote:
> fs type mismatches are now likely enough that it may be
> nice to report which tests -were- run at the end...
Good idea.
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 7/9] Set default extN mount options
2009-05-28 10:35 ` Michael Monnerie
@ 2009-05-28 14:56 ` Eric Sandeen
2009-05-29 6:37 ` Michael Monnerie
0 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-28 14:56 UTC (permalink / raw)
To: Michael Monnerie; +Cc: Christoph Hellwig, xfs
Michael Monnerie wrote:
> On Donnerstag 28 Mai 2009 Christoph Hellwig wrote:
>>> The same for reiserfs, but I don't know if that is wanted/needed.
>> From a look at the point option parser it would need the same
>> options.
>
> Sorry, didn't express it well. Try to clear up: I know the options are
> needed for ACLs, as I use reiserfs a lot, but I don't know if it's in
> the list of FSs that are to be directly supported.
>
> mfg zmi
I'd be happy to include support for reiserfs as well. I'd be even
happier if you tested this yourself and sent patches to make it work :)
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 7/9] Set default extN mount options
2009-05-28 10:01 ` Christoph Hellwig
@ 2009-05-28 14:57 ` Eric Sandeen
0 siblings, 0 replies; 35+ messages in thread
From: Eric Sandeen @ 2009-05-28 14:57 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Christoph Hellwig wrote:
>> @@ -585,7 +589,7 @@ _require_scratch()
>> _notrun "this test requires a valid \$SCRATCH_DEV"
>> fi
>> ;;
>> - nfs*|ext2|ext3|reiserfs)
>> + nfs*|ext2|ext3|ext4|reiserfs)
>> echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
>> if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
>
> This whole function looks fishy to me, but just treating ext4 the same
> as ext2/ext3 makes sense at least.
I agree, I Need to sort out what's going on here but this was a "make it
work" patch :)
Thanks,
-Eric
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/9] Make libxfs.h optional
2009-05-28 9:57 ` Christoph Hellwig
@ 2009-05-28 14:59 ` Eric Sandeen
2009-05-28 15:35 ` Christoph Hellwig
0 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-28 14:59 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Christoph Hellwig wrote:
> On Wed, May 27, 2009 at 01:53:26PM -0500, Eric Sandeen wrote:
>> libxfs.h is really only needed for the loggen test;
>> make it config-time optional.
>
> Maybe we should just move loggen into xfsprogs?
Perhaps, though it has no use outside of qa ... even if we do that it'll
take a while to trickle into people's xfsprogs, so any problem with
putting this patch in for now, even if we move loggen?
Thanks,
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/9] Make libxfs.h optional
2009-05-28 14:59 ` Eric Sandeen
@ 2009-05-28 15:35 ` Christoph Hellwig
2009-05-28 16:15 ` Eric Sandeen
0 siblings, 1 reply; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 15:35 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Christoph Hellwig, xfs
On Thu, May 28, 2009 at 09:59:49AM -0500, Eric Sandeen wrote:
> Christoph Hellwig wrote:
> > On Wed, May 27, 2009 at 01:53:26PM -0500, Eric Sandeen wrote:
> >> libxfs.h is really only needed for the loggen test;
> >> make it config-time optional.
> >
> > Maybe we should just move loggen into xfsprogs?
>
> Perhaps, though it has no use outside of qa ... even if we do that it'll
> take a while to trickle into people's xfsprogs, so any problem with
> putting this patch in for now, even if we move loggen?
I will send a patch to add loggen to xfsprogs ASAP. After that we can
remove loggen and thus the requirement for libxfs.h from xfstests
completely. The tests that use loggen would ismply check for a
xfs_loggen binary in their PATH and not run, so far less drama then
the current situation.
>
> Thanks,
> -Eric
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
---end quoted text---
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 0.5/9] Replace MAXNAMELEN with NAME_MAX + 1
2009-05-28 9:56 ` Christoph Hellwig
@ 2009-05-28 15:46 ` Eric Sandeen
2009-05-28 15:48 ` Christoph Hellwig
2009-05-28 16:16 ` [PATCH 1/9 V2] Use xfs.h rather than libxfs.h Eric Sandeen
1 sibling, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-28 15:46 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Drop the xfs-specific MAXNAMELEN in favor of the Posix NAME_MAX
This makes it easier to lose libxfs.h later.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
diff --git a/dmapi/src/common/lib/print.c b/dmapi/src/common/lib/print.c
index 373064f..bbed8f3 100644
--- a/dmapi/src/common/lib/print.c
+++ b/dmapi/src/common/lib/print.c
@@ -25,9 +25,6 @@
#include <lib/hsm.h>
#include <string.h>
-#ifdef linux
-#define MAXNAMELEN 256
-#endif
/*
* Define some standard formats for the printf statements below.
@@ -96,7 +93,7 @@ print_one_mount_event(
char hans1[HANDLE_STR], hans2[HANDLE_STR], hans3[HANDLE_STR];
void *namp1, *namp2;
size_t nlen1, nlen2;
- char nams1[MAXNAMELEN], nams2[MAXNAMELEN];
+ char nams1[NAME_MAX + 1], nams2[NAME_MAX + 1];
mode_t mode;
#if VERITAS_21
@@ -207,7 +204,7 @@ print_one_message(
void *hanp1, *hanp2, *namp1, *namp2;
u_int hlen1, hlen2, nlen1, nlen2;
char hans1[HANDLE_STR], hans2[HANDLE_STR];
- char nams1[MAXNAMELEN], nams2[MAXNAMELEN];
+ char nams1[NAME_MAX + 1], nams2[NAME_MAX + 1];
/***** USER EVENTS *****/
diff --git a/dmapi/src/suite1/cmd/print_event.c b/dmapi/src/suite1/cmd/print_event.c
index 9a4beba..e34cafe 100644
--- a/dmapi/src/suite1/cmd/print_event.c
+++ b/dmapi/src/suite1/cmd/print_event.c
@@ -65,8 +65,6 @@ clear_region_event(
size_t hlen,
char *hans1);
-#define MAXNAMELEN 256
-
/*
* Keep these global so the exit_handler and err_msg routines can get to them
*/
@@ -294,7 +292,7 @@ print_one_mount_event(
char hans1[HANDLE_STR], hans2[HANDLE_STR], hans3[HANDLE_STR];
void *namp1, *namp2;
size_t nlen1, nlen2;
- char nams1[MAXNAMELEN], nams2[MAXNAMELEN];
+ char nams1[NAME_MAX + 1], nams2[NAME_MAX + 1];
mode_t mode;
#if VERITAS_21
@@ -391,7 +389,7 @@ handle_message(
void *hanp1, *hanp2, *namp1, *namp2;
u_int hlen1, hlen2, nlen1, nlen2;
char hans1[HANDLE_STR], hans2[HANDLE_STR];
- char nams1[MAXNAMELEN], nams2[MAXNAMELEN];
+ char nams1[NAME_MAX + 1], nams2[NAME_MAX + 1];
/*
* Set the defaults for responding to events
diff --git a/dmapi/src/suite2/src/dm_test_daemon.c b/dmapi/src/suite2/src/dm_test_daemon.c
index 214750a..02f5d0e 100644
--- a/dmapi/src/suite2/src/dm_test_daemon.c
+++ b/dmapi/src/suite2/src/dm_test_daemon.c
@@ -39,10 +39,6 @@
#include <lib/dmport.h>
#include <lib/hsm.h>
-#ifdef linux
-#define MAXNAMELEN 256
-#endif
-
/*
* Define some standard formats for the printf statements below.
*/
@@ -291,7 +287,7 @@ print_one_mount_event(
char hans1[HANDLE_STR], hans2[HANDLE_STR], hans3[HANDLE_STR];
void *namp1, *namp2;
size_t nlen1, nlen2;
- char nams1[MAXNAMELEN], nams2[MAXNAMELEN];
+ char nams1[NAME_MAX + 1], nams2[NAME_MAX + 1];
mode_t mode;
#if VERITAS
@@ -386,7 +382,7 @@ handle_message(
void *hanp1, *hanp2, *namp1, *namp2;
u_int hlen1, hlen2, nlen1, nlen2;
char hans1[HANDLE_STR], hans2[HANDLE_STR];
- char nams1[MAXNAMELEN], nams2[MAXNAMELEN];
+ char nams1[NAME_MAX + 1], nams2[NAME_MAX + 1];
void *fs_hanp;
size_t fs_hlen;
dm_timestruct_t *pending_time;
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 308b9bb..6978381 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -477,7 +477,7 @@ attr_list_path(pathname_t *name,
int flags,
attrlist_cursor_t *cursor)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -501,7 +501,7 @@ attr_list_path(pathname_t *name,
int
attr_remove_path(pathname_t *name, const char *attrname, int flags)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -521,7 +521,7 @@ int
attr_set_path(pathname_t *name, const char *attrname, const char *attrvalue,
const int valuelength, int flags)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -556,7 +556,7 @@ check_cwd(void)
int
creat_path(pathname_t *name, mode_t mode)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -697,7 +697,7 @@ doproc(void)
int
fent_to_name(pathname_t *name, flist_t *flp, fent_t *fep)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
int i;
fent_t *pfep;
int e;
@@ -762,7 +762,7 @@ free_pathname(pathname_t *name)
int
generate_fname(fent_t *fep, int ft, pathname_t *name, int *idp, int *v)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
flist_t *flp;
int id;
int j;
@@ -890,7 +890,7 @@ init_pathname(pathname_t *name)
int
lchown_path(pathname_t *name, uid_t owner, gid_t group)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -909,8 +909,8 @@ lchown_path(pathname_t *name, uid_t owner, gid_t group)
int
link_path(pathname_t *name1, pathname_t *name2)
{
- char buf1[MAXNAMELEN];
- char buf2[MAXNAMELEN];
+ char buf1[NAME_MAX + 1];
+ char buf2[NAME_MAX + 1];
int down1;
pathname_t newname1;
pathname_t newname2;
@@ -964,7 +964,7 @@ link_path(pathname_t *name1, pathname_t *name2)
int
lstat64_path(pathname_t *name, struct stat64 *sbuf)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -1000,7 +1000,7 @@ make_freq_table(void)
int
mkdir_path(pathname_t *name, mode_t mode)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -1019,7 +1019,7 @@ mkdir_path(pathname_t *name, mode_t mode)
int
mknod_path(pathname_t *name, mode_t mode, dev_t dev)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -1040,7 +1040,7 @@ namerandpad(int id, char *buf, int i)
{
int bucket;
static int buckets[] =
- { 2, 4, 8, 16, 32, 64, 128, MAXNAMELEN - 1 };
+ { 2, 4, 8, 16, 32, 64, 128, NAME_MAX };
int padlen;
int padmod;
@@ -1060,7 +1060,7 @@ namerandpad(int id, char *buf, int i)
int
open_path(pathname_t *name, int oflag)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -1079,7 +1079,7 @@ open_path(pathname_t *name, int oflag)
DIR *
opendir_path(pathname_t *name)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
DIR *rval;
@@ -1120,7 +1120,7 @@ process_freq(char *arg)
int
readlink_path(pathname_t *name, char *lbuf, size_t lbufsiz)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -1139,8 +1139,8 @@ readlink_path(pathname_t *name, char *lbuf, size_t lbufsiz)
int
rename_path(pathname_t *name1, pathname_t *name2)
{
- char buf1[MAXNAMELEN];
- char buf2[MAXNAMELEN];
+ char buf1[NAME_MAX + 1];
+ char buf2[NAME_MAX + 1];
int down1;
pathname_t newname1;
pathname_t newname2;
@@ -1194,7 +1194,7 @@ rename_path(pathname_t *name1, pathname_t *name2)
int
rmdir_path(pathname_t *name)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -1267,7 +1267,7 @@ show_ops(int flag, char *lead_str)
int
stat64_path(pathname_t *name, struct stat64 *sbuf)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -1286,7 +1286,7 @@ stat64_path(pathname_t *name, struct stat64 *sbuf)
int
symlink_path(const char *name1, pathname_t *name)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -1310,7 +1310,7 @@ symlink_path(const char *name1, pathname_t *name)
int
truncate64_path(pathname_t *name, off64_t length)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
@@ -1329,7 +1329,7 @@ truncate64_path(pathname_t *name, off64_t length)
int
unlink_path(pathname_t *name)
{
- char buf[MAXNAMELEN];
+ char buf[NAME_MAX + 1];
pathname_t newname;
int rval;
diff --git a/src/dirperf.c b/src/dirperf.c
index a222fff..459ae34 100644
--- a/src/dirperf.c
+++ b/src/dirperf.c
@@ -28,7 +28,6 @@
#include <string.h>
#include <unistd.h>
-#define MAXNAMELEN 256
#ifndef __sgi__
typedef unsigned int uint_t;
#endif
@@ -81,7 +80,7 @@ main(int argc, char **argv)
DIR *dirp;
int i;
int j;
- char name[MAXNAMELEN];
+ char name[NAME_MAX + 1];
struct stat stb;
double stime;
@@ -150,8 +149,8 @@ main(int argc, char **argv)
minchars = hexchars(lastsize - 1);
if (nchars < minchars)
nchars = minchars;
- else if (nchars >= MAXNAMELEN)
- nchars = MAXNAMELEN - 1;
+ else if (nchars >= NAME_MAX + 1)
+ nchars = NAME_MAX;
if (ndirs > MAX_DIR_COUNT)
ndirs = MAX_DIR_COUNT;
if (ndirs < MIN_DIR_COUNT)
diff --git a/src/dmiperf.c b/src/dmiperf.c
index e27d783..bcd0625 100644
--- a/src/dmiperf.c
+++ b/src/dmiperf.c
@@ -34,7 +34,6 @@
#include <attr/attributes.h>
#endif
-#define MAXNAMELEN 256
#ifndef sgi
typedef unsigned int uint_t;
#endif
@@ -92,7 +91,7 @@ main(int argc, char **argv)
uint_t cursize;
int i;
int j;
- char name[MAXNAMELEN];
+ char name[NAME_MAX + 1];
char attr[DMFATTRLEN];
double stime;
@@ -168,8 +167,8 @@ main(int argc, char **argv)
minchars = hexchars(lastsize - 1);
if (nchars < minchars)
nchars = minchars;
- else if (nchars >= MAXNAMELEN)
- nchars = MAXNAMELEN - 1;
+ else if (nchars >= NAME_MAX + 1)
+ nchars = NAME_MAX;
if (ndirs > MAX_DIR_COUNT)
ndirs = MAX_DIR_COUNT;
if (ndirs < MIN_DIR_COUNT)
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 0.5/9] Replace MAXNAMELEN with NAME_MAX + 1
2009-05-28 15:46 ` [PATCH 0.5/9] Replace MAXNAMELEN with NAME_MAX + 1 Eric Sandeen
@ 2009-05-28 15:48 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 15:48 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Christoph Hellwig, xfs
On Thu, May 28, 2009 at 10:46:46AM -0500, Eric Sandeen wrote:
> Drop the xfs-specific MAXNAMELEN in favor of the Posix NAME_MAX
>
> This makes it easier to lose libxfs.h later.
Looks good.
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/9] Make libxfs.h optional
2009-05-28 15:35 ` Christoph Hellwig
@ 2009-05-28 16:15 ` Eric Sandeen
0 siblings, 0 replies; 35+ messages in thread
From: Eric Sandeen @ 2009-05-28 16:15 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Christoph Hellwig wrote:
> On Thu, May 28, 2009 at 09:59:49AM -0500, Eric Sandeen wrote:
>> Christoph Hellwig wrote:
>>> On Wed, May 27, 2009 at 01:53:26PM -0500, Eric Sandeen wrote:
>>>> libxfs.h is really only needed for the loggen test;
>>>> make it config-time optional.
>>> Maybe we should just move loggen into xfsprogs?
>> Perhaps, though it has no use outside of qa ... even if we do that it'll
>> take a while to trickle into people's xfsprogs, so any problem with
>> putting this patch in for now, even if we move loggen?
>
> I will send a patch to add loggen to xfsprogs ASAP. After that we can
> remove loggen and thus the requirement for libxfs.h from xfstests
> completely. The tests that use loggen would ismply check for a
> xfs_loggen binary in their PATH and not run, so far less drama then
> the current situation.
Ok, sounds fine.
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 1/9 V2] Use xfs.h rather than libxfs.h
2009-05-28 9:56 ` Christoph Hellwig
2009-05-28 15:46 ` [PATCH 0.5/9] Replace MAXNAMELEN with NAME_MAX + 1 Eric Sandeen
@ 2009-05-28 16:16 ` Eric Sandeen
2009-05-28 16:22 ` Christoph Hellwig
1 sibling, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-05-28 16:16 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Use xfs/xfs.h when possible rather than xfs/libxfs.h,
now that libxfs.h isn't part of a normal xfsprogs-devel
install.
v2: take the MAXNAMELEN changes out of the mix and
remove redefinitions of ioctls easily available from xfs.h
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
diff --git a/aclocal.m4 b/aclocal.m4
index 52f1c7d..6cc5dce 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -405,6 +405,17 @@ AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE],
AC_SUBST(libuuid)
])
+AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
+ [ AC_CHECK_HEADERS([xfs/xfs.h])
+ if test "$ac_cv_header_xfs_xfs_h" != "yes"; then
+ echo
+ echo 'FATAL ERROR: cannot find a valid <xfs/xfs.h> header file.'
+ echo 'Install or upgrade the XFS development package.'
+ echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
+ exit 1
+ fi
+ ])
+
AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
[ AC_CHECK_HEADERS([xfs/libxfs.h])
if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
@@ -500,8 +511,8 @@ AC_DEFUN([AC_PACKAGE_NEED_IRIX_LIBHANDLE],
])
AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
- [ AC_MSG_CHECKING([xfsctl from xfs/libxfs.h])
- AC_TRY_LINK([#include <xfs/libxfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
+ [ AC_MSG_CHECKING([xfsctl from xfs/xfs.h])
+ AC_TRY_LINK([#include <xfs/xfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
[ echo ok ],
[ echo
echo 'FATAL ERROR: cannot find required macros in the XFS headers.'
diff --git a/configure.in b/configure.in
index 32a2496..f087454 100644
--- a/configure.in
+++ b/configure.in
@@ -44,6 +44,7 @@ in
;;
*)
AC_MULTILIB($enable_lib64)
+ AC_PACKAGE_NEED_XFS_XFS_H
AC_PACKAGE_NEED_XFS_LIBXFS_H
AC_PACKAGE_NEED_XFS_XQM_H
AC_PACKAGE_NEED_XFSCTL_MACRO
diff --git a/m4/package_xfslibs.m4 b/m4/package_xfslibs.m4
index cafd959..2c8d694 100644
--- a/m4/package_xfslibs.m4
+++ b/m4/package_xfslibs.m4
@@ -1,3 +1,13 @@
+AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
+ [ AC_CHECK_HEADERS([xfs/xfs.h])
+ if test "$ac_cv_header_xfs_xfs_h" != "yes"; then
+ echo
+ echo 'FATAL ERROR: cannot find a valid <xfs/xfs.h> header file.'
+ echo 'Run "make install-qa" from the xfsprogs source.'
+ exit 1
+ fi
+ ])
+
AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
[ AC_CHECK_HEADERS([xfs/libxfs.h])
if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
diff --git a/src/global.h b/src/global.h
index 158c1fa..61862f6 100644
--- a/src/global.h
+++ b/src/global.h
@@ -26,6 +26,10 @@
#include <../../xfsprogs/include/irix.h>
#endif
+#ifdef HAVE_XFS_XFS_H
+#include <xfs/xfs.h>
+#endif
+
#ifdef HAVE_XFS_LIBXFS_H
#include <xfs/libxfs.h>
#endif
diff --git a/src/godown.c b/src/godown.c
index 4105aee..07b6980 100644
--- a/src/godown.c
+++ b/src/godown.c
@@ -18,20 +18,6 @@
#include "global.h"
-/* These should be in libxfs.h */
-#ifndef XFS_IOC_GOINGDOWN
-#define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t)
-#endif
-#ifndef XFS_FSOP_GOING_FLAGS_DEFAULT
-#define XFS_FSOP_GOING_FLAGS_DEFAULT 0x0 /* going down */
-#endif
-#ifndef XFS_FSOP_GOING_FLAGS_LOGFLUSH
-#define XFS_FSOP_GOING_FLAGS_LOGFLUSH 0x1 /* flush log */
-#endif
-#ifndef XFS_FSOP_GOING_FLAGS_NOLOGFLUSH
-#define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log */
-#endif
-
static char *xprogname;
diff --git a/src/iopat.c b/src/iopat.c
index 1e7d61b..c06071f 100644
--- a/src/iopat.c
+++ b/src/iopat.c
@@ -18,7 +18,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
-#include <xfs/libxfs.h>
+#include <xfs/xfs.h>
struct xfs_flock64 f;
int main(int argc, char **argv)
diff --git a/src/t_immutable.c b/src/t_immutable.c
index 667355b..07a36cd 100644
--- a/src/t_immutable.c
+++ b/src/t_immutable.c
@@ -38,7 +38,7 @@
#include <libgen.h>
#include <sys/acl.h>
#include <attr/xattr.h>
-#include <xfs/libxfs.h>
+#include <xfs/xfs.h>
#include <xfs/handle.h>
#include <xfs/jdm.h>
@@ -47,6 +47,10 @@
#define EXT2_APPEND_FL 0x00000020
#define EXT2_IOC_SETFLAGS _IOW('f', 2, long)
+#ifndef XFS_SUPER_MAGIC
+#define XFS_SUPER_MAGIC 0x58465342
+#endif
+
extern const char *__progname;
static int fsetflag(const char *path, int fd, int on, int immutable)
diff --git a/src/unwritten_mmap.c b/src/unwritten_mmap.c
index 5e63486..aec6a69 100644
--- a/src/unwritten_mmap.c
+++ b/src/unwritten_mmap.c
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
-#include <xfs/libxfs.h>
+#include <xfs/xfs.h>
#include <sys/mman.h>
/*
diff --git a/src/xfsctl.c b/src/xfsctl.c
index f8afb16..8fa3348 100644
--- a/src/xfsctl.c
+++ b/src/xfsctl.c
@@ -16,7 +16,7 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <xfs/libxfs.h>
+#include <xfs/xfs.h>
#include <xfs/jdm.h>
/* simple test program to try out a bunch of xfsctls:
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 1/9 V2] Use xfs.h rather than libxfs.h
2009-05-28 16:16 ` [PATCH 1/9 V2] Use xfs.h rather than libxfs.h Eric Sandeen
@ 2009-05-28 16:22 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2009-05-28 16:22 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Christoph Hellwig, xfs
> +#ifndef XFS_SUPER_MAGIC
> +#define XFS_SUPER_MAGIC 0x58465342
> +#endif
This should eventually be replaced by just using platform_test_xfs_fd
from xfs.h
But for now the patch is fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 7/9] Set default extN mount options
2009-05-28 14:56 ` Eric Sandeen
@ 2009-05-29 6:37 ` Michael Monnerie
0 siblings, 0 replies; 35+ messages in thread
From: Michael Monnerie @ 2009-05-29 6:37 UTC (permalink / raw)
To: xfs
[-- Attachment #1.1: Type: text/plain, Size: 1149 bytes --]
On Donnerstag 28 Mai 2009 Eric Sandeen wrote:
> 'd be happy to include support for reiserfs as well. I'd be even
> happier if you tested this yourself and sent patches to make it work
> :)
I'm not a coder, really, but just changing your line:
+ ext2|ext3|ext4)
to:
+ ext2|ext3|ext4|reiserfs)
does the job here. I meant that part:
diff --git a/common.rc b/common.rc
index 78514f4..54c36f3 100644
--- a/common.rc
+++ b/common.rc
@@ -49,6 +49,10 @@ _mount_opts()
nfs)
export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS
;;
+ ext2|ext3|ext4)
+ # acls & xattrs aren't turned on by default on ext$FOO
+ export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
I never used xfstest as well, and won't realistically have time to do
it.
mfg zmi
--
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 8/9] Enable generic filesystems to be fsck'd
2009-05-28 12:51 ` Christoph Hellwig
@ 2009-06-02 12:38 ` Christoph Hellwig
2009-06-02 15:10 ` Eric Sandeen
0 siblings, 1 reply; 35+ messages in thread
From: Christoph Hellwig @ 2009-06-02 12:38 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Thu, May 28, 2009 at 08:51:28AM -0400, Christoph Hellwig wrote:
> On Wed, May 27, 2009 at 01:53:32PM -0500, Eric Sandeen wrote:
> > This includes a fair bit of rearranging to avoid code duplication,
> > but the goal is to allow 'fsck -n -t $FSTYP $device' to be run on
> > any generic filesystem.
> >
> > Any FS for which this doesn't work will need it's own fsck routine.
>
> Looks generally good, some comments:
>
> - I would get rid of _check_generic_test_fs and just opencode the
> _check_generic_filesystem $TEST_DEV in the two callers.
> - why the odd calling convention of _is_mounted which allows to
> optionally pass the fstype? Currently we only have one caller
> that doesn't pass it, and if we grow one that needs it I would
> rather always pass it explicitly..
>
> Btw, I seems like _check_testdir is never actually called, and I can't
> really see a reason why it would be different from _check_test_fs.
Here's a version with those changes and additionally making sure
_check_test_fs continues to be a no-op for nfs and udf.
Index: xfstests-dev/common.rc
===================================================================
--- xfstests-dev.orig/common.rc 2009-06-02 12:12:24.000000000 +0000
+++ xfstests-dev/common.rc 2009-06-02 12:21:36.000000000 +0000
@@ -707,29 +707,29 @@
[ "$?" == "0" ] || _notrun "$qa_user user not defined."
}
-# check that a FS is mounted as XFS. if so, return mount point
+# check that a FS on a device is mounted
+# if so, return mount point
#
-_xfs_mounted()
+_is_mounted()
{
if [ $# -ne 1 ]
then
- echo "Usage: _xfs_mounted device" 1>&2
+ echo "Usage: _is_mounted device" 1>&2
exit 1
fi
device=$1
- if _mount | grep "$device " | $AWK_PROG '
- /type xfs/ { print $3 ; exit 0 }
- END { exit 1 }
+ if _mount | grep "$device " | $AWK_PROG -v pattern="type $FSTYP" '
+ pattern { print $3 ; exit 0 }
+ END { exit 1 }
'
then
- echo "_xfs_mounted: $device is not a mounted XFS FS"
+ echo "_is_mounted: $device is not a mounted $FSTYP FS"
exit 1
fi
}
-
# remount a FS to a new mode (ro or rw)
#
_remount()
@@ -749,14 +749,105 @@
fi
}
-# run xfs_check and friends on a FS.
+# Run the apropriate repair/check on a filesystem
#
# if the filesystem is mounted, it's either remounted ro before being
# checked or it's unmounted and then remounted
#
+# If set, we remount ro instead of unmounting for fsck
USE_REMOUNT=0
+_umount_or_remount_ro()
+{
+ if [ $# -ne 1 ]
+ then
+ echo "Usage: _umount_or_remount_ro device" 1>&2
+ exit 1
+ fi
+ device=$1
+
+ if [ $USE_REMOUNT -eq 0 ]
+ then
+ mountpoint=`_is_mounted $device`
+ $UMOUNT_PROG $device
+ else
+ _remount $device ro
+ fi
+ echo "$mountpoint"
+}
+
+_mount_or_remount_rw()
+{
+ if [ $# -ne 3 ]
+ then
+ echo "Usage: _mount_or_remount_rw opts device mountpoint" 1>&2
+ exit 1
+ fi
+ mount_opts=$1
+ device=$2
+ mountpoint=$3
+
+ if [ $USE_REMOUNT -eq 0 ]
+ then
+ if ! _mount -t $FSTYP $mount_opts $device $mountpoint
+ then
+ echo "!!! failed to remount $device on $mountpoint"
+ return 0 # ok=0
+ fi
+ else
+ _remount $device rw
+ fi
+
+ return 1 # ok=1
+}
+
+_check_generic_filesystem()
+{
+ device=$1
+
+ # If type is set, we're mounted
+ type=`_fs_type $device`
+ ok=1
+
+ if [ "$type" = "$FSTYP" ]
+ then
+ # mounted ...
+ mountpoint=`_umount_or_remount_ro $device`
+ fi
+
+ fsck -t $FSTYP -n $device >$tmp.fsck 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo "_check_generic_filesystem: filesystem on $device is inconsistent (see $seq.full)"
+
+ echo "_check_generic filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
+ echo "*** fsck.$FSTYP output ***" >>$here/$seq.full
+ cat $tmp.fsck >>$here/$seq.full
+ echo "*** end fsck.$FSTYP output" >>$here/$seq.full
+
+ ok=0
+ fi
+ rm -f $tmp.fsck
+
+ if [ $ok -eq 0 ]
+ then
+ echo "*** mount output ***" >>$here/$seq.full
+ _mount >>$here/$seq.full
+ echo "*** end mount output" >>$here/$seq.full
+ elif [ "$type" = "$FSTYP" ]
+ then
+ # was mounted ...
+ _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint
+ ok=$?
+ fi
+
+ [ $ok -eq 0 ] && exit 1
+ return 0
+}
+
+# run xfs_check and friends on a FS.
+
_check_xfs_filesystem()
{
if [ $# -ne 3 ]
@@ -787,15 +878,8 @@
if [ "$type" = "xfs" ]
then
- # mounted...
-
- if [ $USE_REMOUNT -eq 0 ]
- then
- mountpoint=`_xfs_mounted $device`
- $UMOUNT_PROG $device
- else
- _remount $device ro
- fi
+ # mounted ...
+ mountpoint=`_umount_or_remount_ro $device`
fi
$XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \
@@ -848,17 +932,7 @@
echo "*** end mount output" >>$here/$seq.full
elif [ "$type" = "xfs" ]
then
- # mounted...
- if [ $USE_REMOUNT -eq 0 ]
- then
- if ! _mount -t xfs $extra_mount_options $device $mountpoint
- then
- echo "!!! failed to remount $device on $mountpoint"
- ok=0
- fi
- else
- _remount $device rw
- fi
+ _mount_or_remount_rw "$extra_mount_options" $device $mountpoint
fi
[ $ok -eq 0 ] && exit 1
@@ -908,12 +982,8 @@
}
-_check_test_fs()
+_check_xfs_test_fs()
{
- if [ "$FSTYP" != "xfs" ]; then
- return
- fi
-
TEST_LOG="none"
TEST_RT="none"
[ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
@@ -932,6 +1002,24 @@
fi
}
+_check_test_fs()
+{
+ case $FSTYP in
+ xfs)
+ _check_xfs_test_fs
+ ;;
+ nfs)
+ # no way to check consistency for nfs
+ ;;
+ udf)
+ # do nothing for now
+ ;;
+ *)
+ _check_generic_filesystem $TEST_DEV
+ ;;
+ esac
+}
+
_check_scratch_fs()
{
case $FSTYP in
@@ -953,6 +1041,7 @@
# Don't know how to check an NFS filesystem, yet.
;;
*)
+ _check_generic_filesystem $SCRATCH_DEV
;;
esac
}
@@ -987,25 +1076,6 @@
echo "$os/$platform $host $kernel"
}
-_check_testdir()
-{
- case $FSTYP in
- xfs)
- _check_test_fs
- ;;
- udf)
- _cleanup_testdir
- _check_scratch_fs
- _scratch_mount
- ;;
- nfs*)
- # Don't know how to check an NFS filesystem, yet.
- ;;
- *)
- ;;
- esac
-}
-
_setup_udf_scratchdir()
{
[ "$FSTYP" != "udf" ] \
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 8/9] Enable generic filesystems to be fsck'd
2009-06-02 12:38 ` Christoph Hellwig
@ 2009-06-02 15:10 ` Eric Sandeen
2009-06-02 17:25 ` Christoph Hellwig
0 siblings, 1 reply; 35+ messages in thread
From: Eric Sandeen @ 2009-06-02 15:10 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Christoph Hellwig wrote:
> On Thu, May 28, 2009 at 08:51:28AM -0400, Christoph Hellwig wrote:
>> On Wed, May 27, 2009 at 01:53:32PM -0500, Eric Sandeen wrote:
>>> This includes a fair bit of rearranging to avoid code duplication,
>>> but the goal is to allow 'fsck -n -t $FSTYP $device' to be run on
>>> any generic filesystem.
>>>
>>> Any FS for which this doesn't work will need it's own fsck routine.
>> Looks generally good, some comments:
>>
>> - I would get rid of _check_generic_test_fs and just opencode the
>> _check_generic_filesystem $TEST_DEV in the two callers.
>> - why the odd calling convention of _is_mounted which allows to
>> optionally pass the fstype? Currently we only have one caller
>> that doesn't pass it, and if we grow one that needs it I would
>> rather always pass it explicitly..
>>
>> Btw, I seems like _check_testdir is never actually called, and I can't
>> really see a reason why it would be different from _check_test_fs.
>
> Here's a version with those changes and additionally making sure
> _check_test_fs continues to be a no-op for nfs and udf.
Thanks :) nitpicky comments below, mostly probably nitpicking stuff
that was in my original patch ;)
> Index: xfstests-dev/common.rc
> ===================================================================
> --- xfstests-dev.orig/common.rc 2009-06-02 12:12:24.000000000 +0000
> +++ xfstests-dev/common.rc 2009-06-02 12:21:36.000000000 +0000
> @@ -707,29 +707,29 @@
> [ "$?" == "0" ] || _notrun "$qa_user user not defined."
> }
>
> -# check that a FS is mounted as XFS. if so, return mount point
> +# check that a FS on a device is mounted
> +# if so, return mount point
> #
> -_xfs_mounted()
> +_is_mounted()
> {
> if [ $# -ne 1 ]
> then
> - echo "Usage: _xfs_mounted device" 1>&2
> + echo "Usage: _is_mounted device" 1>&2
> exit 1
> fi
>
> device=$1
>
> - if _mount | grep "$device " | $AWK_PROG '
> - /type xfs/ { print $3 ; exit 0 }
> - END { exit 1 }
> + if _mount | grep "$device " | $AWK_PROG -v pattern="type $FSTYP" '
> + pattern { print $3 ; exit 0 }
> + END { exit 1 }
> '
> then
> - echo "_xfs_mounted: $device is not a mounted XFS FS"
> + echo "_is_mounted: $device is not a mounted $FSTYP FS"
> exit 1
> fi
> }
>
> -
> # remount a FS to a new mode (ro or rw)
> #
> _remount()
> @@ -749,14 +749,105 @@
> fi
> }
>
> -# run xfs_check and friends on a FS.
> +# Run the apropriate repair/check on a filesystem
appropriate (that was probably my typo to start with!)
> #
> # if the filesystem is mounted, it's either remounted ro before being
> # checked or it's unmounted and then remounted
> #
>
> +# If set, we remount ro instead of unmounting for fsck
> USE_REMOUNT=0
>
> +_umount_or_remount_ro()
> +{
> + if [ $# -ne 1 ]
> + then
> + echo "Usage: _umount_or_remount_ro device" 1>&2
<device> might be clearer
> + exit 1
> + fi
> + device=$1
> +
> + if [ $USE_REMOUNT -eq 0 ]
> + then
> + mountpoint=`_is_mounted $device`
> + $UMOUNT_PROG $device
> + else
> + _remount $device ro
> + fi
> + echo "$mountpoint"
Maybe we should move the mountpoint assignment outside the conditional,
since we echo it unconditionally. Only the !USE_REMOUNT case cares
anyway but still...
> +}
> +
> +_mount_or_remount_rw()
> +{
> + if [ $# -ne 3 ]
> + then
> + echo "Usage: _mount_or_remount_rw opts device mountpoint" 1>&2
<opts> <device> <mountpoint>
> + exit 1
> + fi
> + mount_opts=$1
> + device=$2
> + mountpoint=$3
> +
> + if [ $USE_REMOUNT -eq 0 ]
> + then
> + if ! _mount -t $FSTYP $mount_opts $device $mountpoint
> + then
> + echo "!!! failed to remount $device on $mountpoint"
> + return 0 # ok=0
> + fi
> + else
> + _remount $device rw
> + fi
> +
> + return 1 # ok=1
> +}
# Check a generic filesystem in no-op mode; this assumes that the
# underlying fsck program accepts "-n" for a no-op (check-only) run,
# and that it will still return an errno for corruption in this mode.
#
# Filesystems which don't support this will need to define their
# own check routine.
> +_check_generic_filesystem()
> +{
> + device=$1
> +
> + # If type is set, we're mounted
> + type=`_fs_type $device`
> + ok=1
> +
> + if [ "$type" = "$FSTYP" ]
> + then
> + # mounted ...
> + mountpoint=`_umount_or_remount_ro $device`
> + fi
> +
> + fsck -t $FSTYP -n $device >$tmp.fsck 2>&1
> + if [ $? -ne 0 ]
> + then
> + echo "_check_generic_filesystem: filesystem on $device is inconsistent (see $seq.full)"
> +
> + echo "_check_generic filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
> + echo "*** fsck.$FSTYP output ***" >>$here/$seq.full
> + cat $tmp.fsck >>$here/$seq.full
> + echo "*** end fsck.$FSTYP output" >>$here/$seq.full
> +
> + ok=0
> + fi
> + rm -f $tmp.fsck
> +
> + if [ $ok -eq 0 ]
> + then
> + echo "*** mount output ***" >>$here/$seq.full
> + _mount >>$here/$seq.full
> + echo "*** end mount output" >>$here/$seq.full
> + elif [ "$type" = "$FSTYP" ]
> + then
> + # was mounted ...
> + _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint
oops tab vs. space here
> + ok=$?
> + fi
> +
> + [ $ok -eq 0 ] && exit 1
> + return 0
> +}
> +
> +# run xfs_check and friends on a FS.
> +
> _check_xfs_filesystem()
> {
> if [ $# -ne 3 ]
> @@ -787,15 +878,8 @@
>
> if [ "$type" = "xfs" ]
> then
> - # mounted...
> -
> - if [ $USE_REMOUNT -eq 0 ]
> - then
> - mountpoint=`_xfs_mounted $device`
> - $UMOUNT_PROG $device
> - else
> - _remount $device ro
> - fi
> + # mounted ...
> + mountpoint=`_umount_or_remount_ro $device`
> fi
>
> $XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \
> @@ -848,17 +932,7 @@
> echo "*** end mount output" >>$here/$seq.full
> elif [ "$type" = "xfs" ]
> then
> - # mounted...
> - if [ $USE_REMOUNT -eq 0 ]
> - then
> - if ! _mount -t xfs $extra_mount_options $device $mountpoint
> - then
> - echo "!!! failed to remount $device on $mountpoint"
> - ok=0
> - fi
> - else
> - _remount $device rw
> - fi
> + _mount_or_remount_rw "$extra_mount_options" $device $mountpoint
> fi
>
> [ $ok -eq 0 ] && exit 1
> @@ -908,12 +982,8 @@
>
> }
>
> -_check_test_fs()
> +_check_xfs_test_fs()
> {
> - if [ "$FSTYP" != "xfs" ]; then
> - return
> - fi
> -
> TEST_LOG="none"
> TEST_RT="none"
> [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
> @@ -932,6 +1002,24 @@
> fi
> }
>
> +_check_test_fs()
> +{
> + case $FSTYP in
> + xfs)
> + _check_xfs_test_fs
> + ;;
> + nfs)
> + # no way to check consistency for nfs
> + ;;
> + udf)
> + # do nothing for now
> + ;;
> + *)
> + _check_generic_filesystem $TEST_DEV
fix indentation here ...
> + ;;
> + esac
> +}
> +
> _check_scratch_fs()
> {
> case $FSTYP in
> @@ -953,6 +1041,7 @@
> # Don't know how to check an NFS filesystem, yet.
> ;;
> *)
> + _check_generic_filesystem $SCRATCH_DEV
> ;;
> esac
> }
> @@ -987,25 +1076,6 @@
> echo "$os/$platform $host $kernel"
> }
>
> -_check_testdir()
> -{
> - case $FSTYP in
> - xfs)
> - _check_test_fs
> - ;;
> - udf)
> - _cleanup_testdir
> - _check_scratch_fs
> - _scratch_mount
> - ;;
> - nfs*)
> - # Don't know how to check an NFS filesystem, yet.
> - ;;
> - *)
> - ;;
> - esac
> -}
> -
> _setup_udf_scratchdir()
> {
> [ "$FSTYP" != "udf" ] \
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 8/9] Enable generic filesystems to be fsck'd
2009-06-02 15:10 ` Eric Sandeen
@ 2009-06-02 17:25 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2009-06-02 17:25 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Christoph Hellwig, xfs
On Tue, Jun 02, 2009 at 10:10:44AM -0500, Eric Sandeen wrote:
> Maybe we should move the mountpoint assignment outside the conditional,
> since we echo it unconditionally. Only the !USE_REMOUNT case cares
> anyway but still...
It's only used to be passed as an argument to _mount_or_remount_rw
where we only care for the !USE_REMOUNT case.
So I've left this one as-is and fixed up all other issues.
Index: xfstests-dev/common.rc
===================================================================
--- xfstests-dev.orig/common.rc 2009-06-02 12:12:24.000000000 +0000
+++ xfstests-dev/common.rc 2009-06-02 17:10:20.000000000 +0000
@@ -707,29 +707,29 @@
[ "$?" == "0" ] || _notrun "$qa_user user not defined."
}
-# check that a FS is mounted as XFS. if so, return mount point
+# check that a FS on a device is mounted
+# if so, return mount point
#
-_xfs_mounted()
+_is_mounted()
{
if [ $# -ne 1 ]
then
- echo "Usage: _xfs_mounted device" 1>&2
+ echo "Usage: _is_mounted device" 1>&2
exit 1
fi
device=$1
- if _mount | grep "$device " | $AWK_PROG '
- /type xfs/ { print $3 ; exit 0 }
- END { exit 1 }
+ if _mount | grep "$device " | $AWK_PROG -v pattern="type $FSTYP" '
+ pattern { print $3 ; exit 0 }
+ END { exit 1 }
'
then
- echo "_xfs_mounted: $device is not a mounted XFS FS"
+ echo "_is_mounted: $device is not a mounted $FSTYP FS"
exit 1
fi
}
-
# remount a FS to a new mode (ro or rw)
#
_remount()
@@ -749,14 +749,112 @@
fi
}
-# run xfs_check and friends on a FS.
+# Run the appropriate repair/check on a filesystem
#
# if the filesystem is mounted, it's either remounted ro before being
# checked or it's unmounted and then remounted
#
+# If set, we remount ro instead of unmounting for fsck
USE_REMOUNT=0
+_umount_or_remount_ro()
+{
+ if [ $# -ne 1 ]
+ then
+ echo "Usage: _umount_or_remount_ro <device>" 1>&2
+ exit 1
+ fi
+ device=$1
+
+ if [ $USE_REMOUNT -eq 0 ]
+ then
+ mountpoint=`_is_mounted $device`
+ $UMOUNT_PROG $device
+ else
+ _remount $device ro
+ fi
+ echo "$mountpoint"
+}
+
+_mount_or_remount_rw()
+{
+ if [ $# -ne 3 ]
+ then
+ echo "Usage: _mount_or_remount_rw <opts> <device> <mountpoint>" 1>&2
+ exit 1
+ fi
+ mount_opts=$1
+ device=$2
+ mountpoint=$3
+
+ if [ $USE_REMOUNT -eq 0 ]
+ then
+ if ! _mount -t $FSTYP $mount_opts $device $mountpoint
+ then
+ echo "!!! failed to remount $device on $mountpoint"
+ return 0 # ok=0
+ fi
+ else
+ _remount $device rw
+ fi
+
+ return 1 # ok=1
+}
+
+# Check a generic filesystem in no-op mode; this assumes that the
+# underlying fsck program accepts "-n" for a no-op (check-only) run,
+# and that it will still return an errno for corruption in this mode.
+#
+# Filesystems which don't support this will need to define their
+# own check routine.
+#
+_check_generic_filesystem()
+{
+ device=$1
+
+ # If type is set, we're mounted
+ type=`_fs_type $device`
+ ok=1
+
+ if [ "$type" = "$FSTYP" ]
+ then
+ # mounted ...
+ mountpoint=`_umount_or_remount_ro $device`
+ fi
+
+ fsck -t $FSTYP -n $device >$tmp.fsck 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo "_check_generic_filesystem: filesystem on $device is inconsistent (see $seq.full)"
+
+ echo "_check_generic filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
+ echo "*** fsck.$FSTYP output ***" >>$here/$seq.full
+ cat $tmp.fsck >>$here/$seq.full
+ echo "*** end fsck.$FSTYP output" >>$here/$seq.full
+
+ ok=0
+ fi
+ rm -f $tmp.fsck
+
+ if [ $ok -eq 0 ]
+ then
+ echo "*** mount output ***" >>$here/$seq.full
+ _mount >>$here/$seq.full
+ echo "*** end mount output" >>$here/$seq.full
+ elif [ "$type" = "$FSTYP" ]
+ then
+ # was mounted ...
+ _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint
+ ok=$?
+ fi
+
+ [ $ok -eq 0 ] && exit 1
+ return 0
+}
+
+# run xfs_check and friends on a FS.
+
_check_xfs_filesystem()
{
if [ $# -ne 3 ]
@@ -787,15 +885,8 @@
if [ "$type" = "xfs" ]
then
- # mounted...
-
- if [ $USE_REMOUNT -eq 0 ]
- then
- mountpoint=`_xfs_mounted $device`
- $UMOUNT_PROG $device
- else
- _remount $device ro
- fi
+ # mounted ...
+ mountpoint=`_umount_or_remount_ro $device`
fi
$XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \
@@ -848,17 +939,7 @@
echo "*** end mount output" >>$here/$seq.full
elif [ "$type" = "xfs" ]
then
- # mounted...
- if [ $USE_REMOUNT -eq 0 ]
- then
- if ! _mount -t xfs $extra_mount_options $device $mountpoint
- then
- echo "!!! failed to remount $device on $mountpoint"
- ok=0
- fi
- else
- _remount $device rw
- fi
+ _mount_or_remount_rw "$extra_mount_options" $device $mountpoint
fi
[ $ok -eq 0 ] && exit 1
@@ -908,12 +989,8 @@
}
-_check_test_fs()
+_check_xfs_test_fs()
{
- if [ "$FSTYP" != "xfs" ]; then
- return
- fi
-
TEST_LOG="none"
TEST_RT="none"
[ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
@@ -932,6 +1009,24 @@
fi
}
+_check_test_fs()
+{
+ case $FSTYP in
+ xfs)
+ _check_xfs_test_fs
+ ;;
+ nfs)
+ # no way to check consistency for nfs
+ ;;
+ udf)
+ # do nothing for now
+ ;;
+ *)
+ _check_generic_filesystem $TEST_DEV
+ ;;
+ esac
+}
+
_check_scratch_fs()
{
case $FSTYP in
@@ -953,6 +1048,7 @@
# Don't know how to check an NFS filesystem, yet.
;;
*)
+ _check_generic_filesystem $SCRATCH_DEV
;;
esac
}
@@ -987,25 +1083,6 @@
echo "$os/$platform $host $kernel"
}
-_check_testdir()
-{
- case $FSTYP in
- xfs)
- _check_test_fs
- ;;
- udf)
- _cleanup_testdir
- _check_scratch_fs
- _scratch_mount
- ;;
- nfs*)
- # Don't know how to check an NFS filesystem, yet.
- ;;
- *)
- ;;
- esac
-}
-
_setup_udf_scratchdir()
{
[ "$FSTYP" != "udf" ] \
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2009-06-02 17:25 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 18:53 [PATCH 0/9] xfstests: more generic fs work Eric Sandeen
2009-05-27 18:53 ` [PATCH 1/9] Use xfs.h rather than libxfs.h Eric Sandeen
2009-05-28 9:56 ` Christoph Hellwig
2009-05-28 15:46 ` [PATCH 0.5/9] Replace MAXNAMELEN with NAME_MAX + 1 Eric Sandeen
2009-05-28 15:48 ` Christoph Hellwig
2009-05-28 16:16 ` [PATCH 1/9 V2] Use xfs.h rather than libxfs.h Eric Sandeen
2009-05-28 16:22 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 2/9] Make libxfs.h optional Eric Sandeen
2009-05-28 9:57 ` Christoph Hellwig
2009-05-28 14:59 ` Eric Sandeen
2009-05-28 15:35 ` Christoph Hellwig
2009-05-28 16:15 ` Eric Sandeen
2009-05-27 18:53 ` [PATCH 3/9] Support "generic" filesystem type Eric Sandeen
2009-05-28 9:58 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 4/9] 069: make scratch mkfs quiet Eric Sandeen
2009-05-28 9:58 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 5/9] Set up testdir for generic filesystems Eric Sandeen
2009-05-28 9:59 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 6/9] Detect FS type to test based on TEST_DEV Eric Sandeen
2009-05-28 9:59 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 7/9] Set default extN mount options Eric Sandeen
2009-05-28 9:11 ` Michael Monnerie
2009-05-28 10:02 ` Christoph Hellwig
2009-05-28 10:35 ` Michael Monnerie
2009-05-28 14:56 ` Eric Sandeen
2009-05-29 6:37 ` Michael Monnerie
2009-05-28 10:01 ` Christoph Hellwig
2009-05-28 14:57 ` Eric Sandeen
2009-05-27 18:53 ` [PATCH 8/9] Enable generic filesystems to be fsck'd Eric Sandeen
2009-05-28 12:51 ` Christoph Hellwig
2009-06-02 12:38 ` Christoph Hellwig
2009-06-02 15:10 ` Eric Sandeen
2009-06-02 17:25 ` Christoph Hellwig
2009-05-27 18:53 ` [PATCH 9/9] Report which tests did get run Eric Sandeen
2009-05-28 12:51 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox