Commit 90b2c9b4 authored by Pavel Emelyanov's avatar Pavel Emelyanov

zdtm: Print /proc/locks in lock tests to investigate random failures

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent e10b3ef4
...@@ -85,7 +85,11 @@ static int check_file_locks() ...@@ -85,7 +85,11 @@ static int check_file_locks()
if (!fp_locks) if (!fp_locks)
return -1; return -1;
test_msg("C: %d/%d/%d\n", inodes[0], inodes[1], inodes[2]);
while (fgets(buf, sizeof(buf), fp_locks)) { while (fgets(buf, sizeof(buf), fp_locks)) {
test_msg("c: %s", buf);
if (strstr(buf, "->")) if (strstr(buf, "->"))
continue; continue;
......
...@@ -27,7 +27,11 @@ static int check_file_locks() ...@@ -27,7 +27,11 @@ static int check_file_locks()
if (!fp_locks) if (!fp_locks)
return -1; return -1;
test_msg("C: %d\n", pid);
while (fgets(buf, sizeof(buf), fp_locks)) { while (fgets(buf, sizeof(buf), fp_locks)) {
test_msg("c: %s", buf);
if (strstr(buf, "->")) if (strstr(buf, "->"))
continue; continue;
......
...@@ -27,7 +27,11 @@ static int check_file_locks(int alt_pid) ...@@ -27,7 +27,11 @@ static int check_file_locks(int alt_pid)
if (!fp_locks) if (!fp_locks)
return -1; return -1;
test_msg("C: %d/%d\n", pid, alt_pid);
while (fgets(buf, sizeof(buf), fp_locks)) { while (fgets(buf, sizeof(buf), fp_locks)) {
test_msg("c: %s", buf);
if (strstr(buf, "->")) if (strstr(buf, "->"))
continue; continue;
......
...@@ -27,7 +27,11 @@ static int check_file_locks(int alt_pid, int fd) ...@@ -27,7 +27,11 @@ static int check_file_locks(int alt_pid, int fd)
if (!fp_locks) if (!fp_locks)
return -1; return -1;
test_msg("C: %d/%d\n", pid, alt_pid);
while (fgets(buf, sizeof(buf), fp_locks)) { while (fgets(buf, sizeof(buf), fp_locks)) {
test_msg("c: %s", buf);
if (strstr(buf, "->")) if (strstr(buf, "->"))
continue; continue;
......
...@@ -42,7 +42,7 @@ int main(int argc, char **argv) ...@@ -42,7 +42,7 @@ int main(int argc, char **argv)
if (flock(fd2, LOCK_SH) == 0) if (flock(fd2, LOCK_SH) == 0)
pass(); pass();
else else
fail("Flock file locks check failed"); fail("Flock file locks check failed (%d)", errno);
close(fd); close(fd);
close(fd2); close(fd2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment