From patchwork Tue Sep 11 14:56:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 968584 X-Patchwork-Delegate: petr.vorel@gmail.com 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=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QttUxPgF"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 428nzf5hpqz9s4V for ; Wed, 12 Sep 2018 00:56:14 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 46FE33E61FB for ; Tue, 11 Sep 2018 16:56:12 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) by picard.linux.it (Postfix) with ESMTP id 8625C3E61C3 for ; Tue, 11 Sep 2018 16:56:10 +0200 (CEST) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id BADAD1400536 for ; Tue, 11 Sep 2018 16:56:09 +0200 (CEST) Received: by mail-wm0-x244.google.com with SMTP id r1-v6so8025051wmh.0 for ; Tue, 11 Sep 2018 07:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=fF6E++BbrVy/Zqlc3TbXj6RgOiUfyKa5QjbpjY7rbuM=; b=QttUxPgFxfUSoIRLy2h5K/A+eTbeRfUZB47QbjsCE1++zOvaL49nt8YF5xzUpJx3hd STahNPmFWR7ijOpe/zS/8vX45nFMOIRXvtwVLlnn3rtWBxBKLb58KmWQH4qS70tDIM6A /DFoP3fNDfZ530BgwnyUhUY0UKHdhTcKG4dE9IrW2M1m6KgMuJmqVT49byLqX3htpBrs 1FXUq6vOPWWEuVaWNKG6+xiNgyPu4GywRxX4NjmRjLKbjQlmMCl9Gkh6lNwTbKOjpERG /09sdA9KS0d2TXGAUAvegs+laJF56OCYrsI+O0T/3Dr5vquDJA86SwCufNXXPbuDxJpF OHuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fF6E++BbrVy/Zqlc3TbXj6RgOiUfyKa5QjbpjY7rbuM=; b=gfPbw5UOYK3tiSEfnal3RLqFgQo0+AAwPc3Cc4r18vE2HbufP0ShZHr59jdb9Gwftq hlsltdSzfMvbEBnR6Ypl99OeQFEWMknOaAJoY3iaze0oh82iWo8bU4sQDByQa7KmE/x+ b7IxGSNBCl1ftXF1pIuRkV5rcpDHnwyBN28UDldX75hLhGFglCice90NLd30Mo06N9Ki Zcet0ILps9a8FzSLm2oQ3qwr4iTBMTTFqB5QSNPBEu4bvViaUHE6ZQBDMYoWnKSWT4ru QdPqBmpGfcE9BElAX8os323dE5D/2GAEA7vgU2gjdRPjcLeDr7OM6osB24tlPhfuin1J JmAg== X-Gm-Message-State: APzg51APSrNAVa1s5bQGw+O00uJVmEBby3fzMi9PRkxASSkBYo32L2Fz N7yJuUh7FXa0kBMUkd1tAmImEWsz X-Google-Smtp-Source: ANB0VdYZrSRhqONM5gZJ3FJcZ40HxktIApbL7l/f1wwURk1hsY4CtPDCeuWgn4Us/zl/qx0e6DFSSA== X-Received: by 2002:a1c:e455:: with SMTP id b82-v6mr1678737wmh.93.1536677769078; Tue, 11 Sep 2018 07:56:09 -0700 (PDT) Received: from localhost.localdomain ([141.226.8.68]) by smtp.gmail.com with ESMTPSA id m68-v6sm2137578wmb.10.2018.09.11.07.56.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 07:56:08 -0700 (PDT) From: Amir Goldstein To: Cyril Hrubis Date: Tue, 11 Sep 2018 17:56:02 +0300 Message-Id: <20180911145602.18106-1-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Cc: Jan Kara , ltp@lists.linux.it Subject: [LTP] [PATCH] syscalls/fanotify03: Cleanup backup file descriptor 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: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Amir Goldstein --- Cyril, As requested by Richard, here is the fanotify03 minor fix separated from whitespace cleanup. If you wish to take the whitespace cleanup patch you can find it here: https://github.com/amir73il/ltp/commits/fanotify_sb Thanks, Amir. testcases/kernel/syscalls/fanotify/fanotify03.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/fanotify/fanotify03.c b/testcases/kernel/syscalls/fanotify/fanotify03.c index 50401157b..966366a72 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify03.c +++ b/testcases/kernel/syscalls/fanotify/fanotify03.c @@ -57,6 +57,7 @@ static char fname[BUF_SIZE]; static char buf[BUF_SIZE]; static volatile int fd_notify; +static int fd_notify_backup = -1; static pid_t child_pid; @@ -140,7 +141,7 @@ static void check_child(void) void test01(void) { - int tst_count, fd_notify_backup = -1; + int tst_count; int ret, len = 0, i = 0, test_num = 0; @@ -262,6 +263,8 @@ static void cleanup(void) { if (fd_notify > 0) SAFE_CLOSE(fd_notify); + if (fd_notify_backup > 0) + SAFE_CLOSE(fd_notify_backup); } static struct tst_test test = {