diff mbox series

generic/504: Check inode number accurately

Message ID 1535967380-22601-1-git-send-email-yangx.jy@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show
Series generic/504: Check inode number accurately | expand

Commit Message

Xiao Yang Sept. 3, 2018, 9:36 a.m. UTC
If inode number is equal to the line number of locks which is
first column in /proc/locks, generic/504 will match wrong number
and get PASS. For example:
-----------------------------------------------------------
inode 12
...
12: FLOCK  ADVISORY  WRITE 1615 00:2e:37889 0 EOF
-----------------------------------------------------------

We should match correct inode number by six column in /proc/locks.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tests/generic/504 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/generic/504 b/tests/generic/504
index c7d015d..21d8605 100755
--- a/tests/generic/504
+++ b/tests/generic/504
@@ -51,7 +51,7 @@  flock -x 9
 cat /proc/locks >> $seqres.full
 
 # Checking
-grep -qw $tf_inode /proc/locks || echo "lock info not found"
+grep -q ":$tf_inode " /proc/locks || echo "lock info not found"
 
 # success, all done
 status=0