From patchwork Wed Mar 14 11:07:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yang xu X-Patchwork-Id: 885696 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 401TTT2Fd2z9sV3 for ; Wed, 14 Mar 2018 22:07:41 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 153123E76E0 for ; Wed, 14 Mar 2018 12:07:38 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) by picard.linux.it (Postfix) with ESMTP id 3D65C3E76D1 for ; Wed, 14 Mar 2018 12:07:36 +0100 (CET) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-2.smtp.seeweb.it (Postfix) with ESMTP id DE453601D4D for ; Wed, 14 Mar 2018 12:07:33 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="37818986" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 14 Mar 2018 19:07:28 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id B86154D0EFF7 for ; Wed, 14 Mar 2018 19:07:28 +0800 (CST) Received: from 7u4GA.g08.fujitsu.local (10.167.220.33) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 14 Mar 2018 19:07:33 +0800 From: yang xu To: Date: Wed, 14 Mar 2018 19:07:24 +0800 Message-ID: <1521025644-18312-1-git-send-email-xuyang.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.33] X-yoursite-MailScanner-ID: B86154D0EFF7.AC7B1 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: xuyang.jy@cn.fujitsu.com X-Spam-Status: No, score=-0.0 required=7.0 tests=T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH] fs/read_all: Filter /dev/watchdog* X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" On some distros with Magic Close feature or built-in CONFIG_WATCHDOG_NOWAYOUT, just closing /dev/watchdog* enabled by open leads to system reboot as expected. If Magic Close feature is supported, just writing a specific magic character 'V' into /dev/watchdog* before closing it can disable the watchdog. If CONFIG_WATCHDOG_NOWAYOUT is built-in, there is no way to disable the watchdog. Magic Close feature is introduced by: commit 017cf080("watchDog Timer Driver Core - Add Magic Close feature") Please see the following url for detailed watchdog info: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/watchdog/watchdog-api.txt Signed-off-by: yang xu Signed-off-by: Xiao Yang --- testcases/kernel/fs/read_all/read_all.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c index 81806e7..a841b88 100644 --- a/testcases/kernel/fs/read_all/read_all.c +++ b/testcases/kernel/fs/read_all/read_all.c @@ -393,6 +393,9 @@ static void visit_dir(const char *path) snprintf(dent_path, MAX_PATH, "%s/%s", path, dent->d_name); + if (!strncmp(dent_path, "/dev/watchdog", 13)) + continue; + if (act == DA_UNKNOWN) { if (lstat(dent_path, &dent_st)) tst_res(TINFO | TERRNO, "lstat(%s)", path);