diff options
author | Andrew Vagin <avagin@openvz.org> | 2015-08-24 21:07:00 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2015-08-25 16:01:40 +0300 |
commit | 8189eda7b98022a00c7a372c13801651fcf067b6 (patch) | |
tree | bcd7e589a88780452f09eba6552538b0e760a5ab | |
parent | 439de67a4bdc58e5634cd4d983b906aeaf4313e6 (diff) |
zdtm/file_locks1: compare devices in addition to inodes
You can see two equal inode numbers with differen devices and
it was a reason why the test failed.
4: C: 12491/12495/12496
4: c: 1: POSIX ADVISORY WRITE 0 fc:03:12468 0 EOF
4: c: 2: POSIX ADVISORY READ 0 fc:03:12421 0 EOF
4: c: 3: POSIX ADVISORY WRITE 0 00:14:16285 0 EOF
4: c: 4: FLOCK MSNFS READ 4 fc:03:12496 0 EOF
4: c: 5: FLOCK ADVISORY WRITE 4 fc:03:12495 0 EOF
4: c: 6: FLOCK ADVISORY READ 4 fc:03:12491 0 EOF
4: c: 7: POSIX ADVISORY WRITE 0 00:14:16280 0 EOF
4: c: 8: POSIX ADVISORY WRITE 0 00:14:12677 0 EOF
4: c: 9: FLOCK ADVISORY WRITE 0 00:14:12520 0 EOF
4: c: 10: FLOCK ADVISORY WRITE 0 00:14:12495 0 EOF
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
-rw-r--r-- | test/zdtm/live/static/file_locks01.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/zdtm/live/static/file_locks01.c b/test/zdtm/live/static/file_locks01.c index 4ff46d80c..1bdff9a5b 100644 --- a/test/zdtm/live/static/file_locks01.c +++ b/test/zdtm/live/static/file_locks01.c @@ -21,6 +21,7 @@ char file0[PATH_MAX]; char file1[PATH_MAX]; char file2[PATH_MAX]; unsigned int inodes[3]; +dev_t dev; static int open_all_files(int *fd_0, int *fd_1, int *fd_2) { @@ -37,6 +38,7 @@ static int open_all_files(int *fd_0, int *fd_1, int *fd_2) fstat(*fd_0, &buf); inodes[0] = buf.st_ino; + dev = buf.st_dev; *fd_1 = open(file1, O_RDWR | O_CREAT | O_EXCL, 0666); if (*fd_1 < 0) { @@ -103,7 +105,7 @@ static int check_file_locks() break; } - if (i_no != inodes[0] && i_no != inodes[1] && i_no != inodes[2]) + if (i_no != inodes[0] && i_no != inodes[1] && i_no != inodes[2] && makedev(maj, min) != dev) continue; if (!strcmp(fl_flag, "FLOCK") && !strcmp(fl_type, "ADVISORY")) { |