From patchwork Mon Sep 3 09:36:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 10585621 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D66EB920 for ; Mon, 3 Sep 2018 09:15:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD030295D1 for ; Mon, 3 Sep 2018 09:15:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF8E0295DB; Mon, 3 Sep 2018 09:15:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6926C295D1 for ; Mon, 3 Sep 2018 09:15:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725920AbeICNfJ (ORCPT ); Mon, 3 Sep 2018 09:35:09 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:47287 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725866AbeICNfI (ORCPT ); Mon, 3 Sep 2018 09:35:08 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="44380558" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Sep 2018 17:15:52 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 9F6E34B6EC75; Mon, 3 Sep 2018 17:15:49 +0800 (CST) Received: from RHEL7U5Alpha_SERVER.g08.fujitsu.local (10.167.220.156) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Sep 2018 17:15:51 +0800 From: Xiao Yang To: CC: , Xiao Yang Subject: [PATCH] generic/504: Check inode number accurately Date: Mon, 3 Sep 2018 17:36:20 +0800 Message-ID: <1535967380-22601-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.156] X-yoursite-MailScanner-ID: 9F6E34B6EC75.AC5CF X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- tests/generic/504 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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