From 7178b715eb0ba5d55ee9cf51b75765e5c19ba67c Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Thu, 1 Sep 2011 16:00:23 -0600 Subject: [PATCH] LU-517 tests: don't fail mkstemp() on Lustre fs The tst_read_ea test tries to find a filesystem with "user_xattr" as a mount option (which the MDS mountpoint matches) and then tries to create a temporary file in /mnt/mds via the VFS and read it back via libext2fs and verify the value. Unfortunately, it is not possible to create files in /mnt/mds, so the test fails. If mkstemp() fails, just continue looking for a suitable ext3/4 filesystem to run the test on. Signed-off-by: Andreas Dilger Change-Id: I4a11b9edd7adf3cc76f364e3a900811aa242b0c1 --- patches/e2fsprogs-attr_cleanup.patch | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/patches/e2fsprogs-attr_cleanup.patch b/patches/e2fsprogs-attr_cleanup.patch index d24aad8..8bffcb6 100644 --- a/patches/e2fsprogs-attr_cleanup.patch +++ b/patches/e2fsprogs-attr_cleanup.patch @@ -65,7 +65,7 @@ Index: e2fsprogs/lib/ext2fs/ext2fs.h =================================================================== --- e2fsprogs.orig/lib/ext2fs/ext2fs.h +++ e2fsprogs/lib/ext2fs/ext2fs.h -@@ -1004,6 +1004,10 @@ extern errcode_t ext2fs_dup_handle(ext2_ +@@ -1003,6 +1003,10 @@ extern errcode_t ext2fs_dup_handle(ext2_ extern errcode_t ext2fs_expand_dir(ext2_filsys fs, ext2_ino_t dir); /* ext_attr.c */ @@ -314,7 +314,7 @@ Index: e2fsprogs/lib/ext2fs/tst_read_ea.c =================================================================== --- /dev/null +++ e2fsprogs/lib/ext2fs/tst_read_ea.c -@@ -0,0 +1,233 @@ +@@ -0,0 +1,235 @@ +/* + * tst_getsize.c --- this function tests the getsize function + * @@ -509,23 +509,25 @@ Index: e2fsprogs/lib/ext2fs/tst_read_ea.c + err = ext2fs_open(mnt->mnt_fsname, 0, 0, 0, + unix_io_manager, &fs); + if (err) { -+ com_err("tst_read_ea", err, -+ "opening fs %s:%s", ++ com_err("tst_read_ea", err, "opening fs %s:%s", + mnt->mnt_fsname, mnt->mnt_type); + continue; + } + ext2fs_close(fs); + -+ printf("(%s)%s:%s\n", mnt->mnt_type, mnt->mnt_fsname, mnt->mnt_dir); ++ printf("type=%s, fsname=%s, mtpt=%s\n", mnt->mnt_type, ++ mnt->mnt_fsname, mnt->mnt_dir); + + asprintf(&name, "%s/readeaXXXXXX", mnt->mnt_dir); + fd = mkstemp(name); + if (fd == -1) { -+ perror("mkstemp failed"); -+ exit(1); ++ fprintf("tst_read_ea: mkstemp failed for %s: %s", ++ name, strerror(errno)); ++ continue; + } + if (fstat(fd, &st)) { -+ perror("fstat failed"); ++ fprintf("tst_read_ea: create ok, fstat failed %s: %s\n", ++ name, strerror(errno)); + exit(1); + } + nr = set_xattrs(fd); -- 1.8.3.1