From patchwork Fri Nov 16 06:51:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 998775 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=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="ScK2X8AB"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42x86F6xPyz9s8F for ; Fri, 16 Nov 2018 17:51:49 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 3F89E3E768D for ; Fri, 16 Nov 2018 07:51:47 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [IPv6:2001:4b78:1:20::5]) by picard.linux.it (Postfix) with ESMTP id 893563E6592 for ; Fri, 16 Nov 2018 07:51:35 +0100 (CET) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 2A6E4600F96 for ; Fri, 16 Nov 2018 07:51:35 +0100 (CET) Received: by mail-wr1-x442.google.com with SMTP id j10so9455297wru.4 for ; Thu, 15 Nov 2018 22:51:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2mmXfO4Fw9IykNZTqe/X325Rv79/LSKtNYpl+g+Cazw=; b=ScK2X8ABPskmOlDEmfEE47Z87RSf3Wnh8MOUcw5J460IChcFsl+GIuvQ9Tbvw3gZDy YaAEqB8LNF4HmVSLvAgR19afC5ZGmPsJqenoY6NughgvlfluX87l57JO4aDaTJBxswal J2PgU2YW7x5V0mixCqrVxmBfVJq45R1rJxXcW1mTpnrNHbOxuzo0cMrQ7sWiqZiVK5j9 Cr8oSEfFKNvi0IXtgIaaoMXBOGU/dnFFdTTILPun9CFPK3WFt3ai0fmyS4JwJpdISoKo s/aEcavonfLliNdqIc8fbHxHoSoQUH4ZAc8qGmzTW7CLKWeYDtCdW5kdU8EfjMGswky5 GdzQ== 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:in-reply-to :references; bh=2mmXfO4Fw9IykNZTqe/X325Rv79/LSKtNYpl+g+Cazw=; b=sG/J72fzf2JvmTAPXKDrST0OWGOUCDB/mM18QysEIC/vWiflR7aSXhWqE6Z19uknV8 /OH+5v6WrGGECUdYEwmP2txeGIjoxA2fUyrKfRZZtH5mHFIXsmxdepsbq3gZJYOpGKo5 4pqWM2PUKfgCJ0NWJocEKNlfOvyccy9oYWUopWIaJAD69xnEF71oBEhoS7DW1VVLqdEq hF46iKUgkPgOJ8/t6cpYVv7KzwbxL+fuGh2XOr40lZbdNAT6HAoHZ9vkoDrdo2dAjaOe CaVckX1M9cMmudqex1nwh1+NjZAg9roX5SUaElCYzNsbU3YLygX/RbuoQ8KTZEDEd2iF STnw== X-Gm-Message-State: AGRZ1gLDig82gi6hXDiKotlo1XjibYzFjjP9M20HeimbGd+/V6odyNb3 y2jqpD802IrPCHXiqqTN++9J2/OQ X-Google-Smtp-Source: AJdET5ddrlMl0fpwb6tYPseSZs4NY6RicUOqEy00AryoNdPzkUHgWM6sG7CQ/oj66LJlREg4E5aJ5A== X-Received: by 2002:adf:bb44:: with SMTP id x4mr8560211wrg.24.1542351094688; Thu, 15 Nov 2018 22:51:34 -0800 (PST) Received: from localhost.localdomain ([37.46.46.74]) by smtp.gmail.com with ESMTPSA id z8sm8200598wrr.52.2018.11.15.22.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Nov 2018 22:51:34 -0800 (PST) From: Amir Goldstein To: Cyril Hrubis Date: Fri, 16 Nov 2018 08:51:17 +0200 Message-Id: <20181116065119.6912-4-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181116065119.6912-1-amir73il@gmail.com> References: <20181116065119.6912-1-amir73il@gmail.com> X-Virus-Scanned: clamav-milter 0.99.2 at in-5.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-5.smtp.seeweb.it Cc: Jan Kara , ltp@lists.linux.it Subject: [LTP] [PATCH 3/5] syscalls/fanotify01: add test for FAN_MARK_FILESYSTEM events 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 --- testcases/kernel/syscalls/fanotify/fanotify.h | 3 +++ testcases/kernel/syscalls/fanotify/fanotify01.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h index 5adef54d7..535f1cef2 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify.h +++ b/testcases/kernel/syscalls/fanotify/fanotify.h @@ -57,6 +57,9 @@ static long fanotify_mark(int fd, unsigned int flags, uint64_t mask, #ifndef FAN_MARK_INODE #define FAN_MARK_INODE 0 #endif +#ifndef FAN_MARK_FILESYSTEM +#define FAN_MARK_FILESYSTEM 0x00000100 +#endif struct fanotify_mark_type { unsigned int flag; diff --git a/testcases/kernel/syscalls/fanotify/fanotify01.c b/testcases/kernel/syscalls/fanotify/fanotify01.c index 5dfb67b61..c3d299474 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify01.c +++ b/testcases/kernel/syscalls/fanotify/fanotify01.c @@ -44,6 +44,10 @@ static struct tcase { "mount mark events", INIT_FANOTIFY_MARK_TYPE(MOUNT), }, + { + "filesystem mark events", + INIT_FANOTIFY_MARK_TYPE(FILESYSTEM), + }, }; static char fname[BUF_SIZE]; @@ -68,6 +72,11 @@ static void test_fanotify(unsigned int n) if (fanotify_mark(fd_notify, FAN_MARK_ADD | mark->flag, FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN, AT_FDCWD, fname) < 0) { + if (errno == EINVAL && mark->flag == FAN_MARK_FILESYSTEM) { + tst_res(TCONF, + "FAN_MARK_FILESYSTEM not supported in kernel?"); + return; + } tst_brk(TBROK | TERRNO, "fanotify_mark (%d, FAN_MARK_ADD, FAN_ACCESS | %s | " "FAN_MODIFY | FAN_CLOSE | FAN_OPEN, AT_FDCWD, %s) "