From: Xiao Yang Date: Mon, 3 Sep 2018 09:36:20 +0000 (+0800) Subject: generic/504: Check inode number accurately X-Git-Tag: v2022.05.01~1428 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=860405a41198a5820a37ef50489a6047905721f5;p=users%2Fhch%2Fxfstests-dev.git generic/504: Check inode number accurately 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 Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/tests/generic/504 b/tests/generic/504 index c7d015db0..21d860513 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