]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/423: statx mask of the reference file is different from the original file
authorCui Yue <cuiyue-fnst@cn.fujitsu.com>
Thu, 10 Jan 2019 03:14:59 +0000 (22:14 -0500)
committerEryu Guan <guaneryu@gmail.com>
Thu, 10 Jan 2019 08:11:27 +0000 (16:11 +0800)
When running xfstests generic/423 to test system call statx() on
hard link files of NFS, it fails.  error message:

[!] attr 'stx_mask' differs from ref file, 7ff != e0

The values of parameter "mask" between the original file and the
reference file are different.  One is STATX_ALL;
The other is STATX_ATIME | STATX_BTIME | STATX_CTIME | STATX_MTIME.

Modify the function get_reference() to pass the "mask" in, and
change STATX_ATIME | STATX_BTIME | STATX_CTIME | STATX_MTIME to
"mask".

Signed-off-by: Cui Yue <cuiyue-fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/stat_test.c

index 94c20d60c972dd83f4e179b83b6707608c115712..95cfdc4f8c5fb4f431e5e994d8388d6ce938ddc2 100644 (file)
@@ -290,7 +290,7 @@ static void set_origin_timestamp(const char *arg)
 /*
  * Get reference stats from a file.
  */
-static void get_reference(const char *file)
+static void get_reference(const char *file, unsigned int mask)
 {
        int ret;
 
@@ -298,9 +298,7 @@ static void get_reference(const char *file)
                bad_arg("ref= requires a filename\n");
 
        memset(&ref, 0xfb, sizeof(ref));
-       ret = xfstests_statx(AT_FDCWD, file, AT_SYMLINK_NOFOLLOW,
-                            STATX_ATIME | STATX_BTIME | STATX_CTIME | STATX_MTIME,
-                            &ref);
+       ret = xfstests_statx(AT_FDCWD, file, AT_SYMLINK_NOFOLLOW, mask, &ref);
        switch (ret) {
        case 0:
                ref_set = true;
@@ -751,7 +749,7 @@ int main(int argc, char **argv)
 
                if (strncmp("ref=", arg, 4) == 0) {
                        /* ref=<file> - set reference stats from file */
-                       get_reference(arg + 4);
+                       get_reference(arg + 4, mask);
                        continue;
                }