From patchwork Fri Dec 18 07:06:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 1418115 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=klZzU8Oi; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cy0KN1QG8z9sWK for ; Fri, 18 Dec 2020 18:06:48 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 81EEA3C5798 for ; Fri, 18 Dec 2020 08:06:45 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 28CB93C334A for ; Fri, 18 Dec 2020 08:06:36 +0100 (CET) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 71EEE1A01534 for ; Fri, 18 Dec 2020 08:06:36 +0100 (CET) Received: by mail-ed1-x536.google.com with SMTP id h16so1264048edt.7 for ; Thu, 17 Dec 2020 23:06:36 -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 :mime-version:content-transfer-encoding; bh=OfGQUSBa5kFhO/pQmyBDlAfpoLUOWm95waI0qN36zBc=; b=klZzU8Oi3jg4Xwx/2C07km2e0EJvAQAmn/8JY++980ElLrwxlT4tkQkA5V3ujjD6mX 7Qdqk+Jv5hgPyNBqmSznLKinGpe+VGUh3uT5402mFTUrkzF41kKDUe+EZp6wpaGYCEVq XpPR36WTtIGPk+lYQSXp/kMsDzcJ10haIPBIPWi5ElU00L6lgxgYUFHs6UTwP54JFS8B WdZ0L5EKeQpWHZPZ222gHJhKrCcbtO37K4tAknmNxpKqlRxH0BsQd/D28w9I4Kic/Z/T 7R8pxCVVX3bA/MFH8H9TdgXr5ULcVIHhN86vMHLjOum8dAOq351ABakHcmje83/FRDRb PLag== 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:mime-version:content-transfer-encoding; bh=OfGQUSBa5kFhO/pQmyBDlAfpoLUOWm95waI0qN36zBc=; b=OEagRLqeB2Dq6ONLzjsWXx0uZ0NdLJsmPQvQSuuFGQuCRi1SEuwUj01xevDHjp7NG4 BFsSunmX06O7zhU4ZFU0Jlj0iRsh8dZe6BVpHquFFxA1M6YbNz2ttqeHYwOLUqKAK3yC iqy18A4Sw7m4VYSAmkjYqJDWrokfoxgSywcv/4D+yY5Kh8MneM4iiWm2saq8KJv3KCWO JFeYfLgPXxCvVeim1QoaNm8RCowOiztK4ZgtRlgZvh7XrJbH78DVMDassR+kZ8T4DhbU Y8MnFI43dI2A6qxin1v9kOf8ql36SP2YvO4h5H94MqzTFbEo3keKYY/7XHnG9DyoXFLA 7x1w== X-Gm-Message-State: AOAM531VhQE5d7JmGPZp5UeQ1YOSF2EUSpPYud+udEUHUm60Opi+seEJ DcUrvHt/3hWrYXyWdottepA= X-Google-Smtp-Source: ABdhPJzozJDyPT8cF1EFNk7dVYAA6yDnEf7ck/Ri/hQWiMQu/bL4FBjZY7ZuKPY1vL6YmhugURpIMQ== X-Received: by 2002:a50:8004:: with SMTP id 4mr2902453eda.329.1608275196070; Thu, 17 Dec 2020 23:06:36 -0800 (PST) Received: from localhost.localdomain ([31.210.181.203]) by smtp.gmail.com with ESMTPSA id d13sm10852263edx.27.2020.12.17.23.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 23:06:35 -0800 (PST) From: Amir Goldstein To: Petr Vorel Date: Fri, 18 Dec 2020 09:06:29 +0200 Message-Id: <20201218070631.1182292-2-amir73il@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201218070631.1182292-1-amir73il@gmail.com> References: <20201218070631.1182292-1-amir73il@gmail.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-3.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,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 1/3] syscalls/inotify10: Generalize for more test cases X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hugh Dickins , Jan Kara , ltp@lists.linux.it Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Generalize the parent and child watches test to allow adding new parent and child watch related test cases. Signed-off-by: Amir Goldstein Reviewed-by: Petr Vorel --- testcases/kernel/syscalls/inotify/inotify10.c | 81 +++++++++++++------ 1 file changed, 55 insertions(+), 26 deletions(-) diff --git a/testcases/kernel/syscalls/inotify/inotify10.c b/testcases/kernel/syscalls/inotify/inotify10.c index 1c43915a8..baa955a0a 100644 --- a/testcases/kernel/syscalls/inotify/inotify10.c +++ b/testcases/kernel/syscalls/inotify/inotify10.c @@ -5,7 +5,9 @@ * Started by Amir Goldstein * * DESCRIPTION - * Check that event is reported to both watching parent and watching child + * Check that event is reported to watching parent and watching child + * based on their interest + * */ #include "config.h" @@ -37,48 +39,74 @@ struct event_t { #define TEST_DIR "test_dir" #define TEST_FILE "test_file" +static struct tcase { + const char *tname; + unsigned int parent_mask; + unsigned int subdir_mask; + unsigned int child_mask; +} tcases[] = { + { + "Group with parent and child watches", + IN_ATTRIB, IN_ATTRIB, IN_ATTRIB, + }, +}; + struct event_t event_set[EVENT_MAX]; char event_buf[EVENT_BUF_LEN]; int fd_notify; -static void verify_inotify(void) +static void verify_inotify(unsigned int n) { + struct tcase *tc = &tcases[n]; int i = 0, test_num = 0, len; - int wd_parent, wd_dir, wd_file; + int wd_parent = 0, wd_subdir = 0, wd_child = 0; int test_cnt = 0; + tst_res(TINFO, "Test #%d: %s", n, tc->tname); + fd_notify = SAFE_MYINOTIFY_INIT(); - /* Set watch on both parent dir and children */ - wd_parent = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, ".", IN_ATTRIB); - wd_dir = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_DIR, IN_ATTRIB); - wd_file = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_FILE, IN_ATTRIB); + /* Setup watches on parent dir and children */ + if (tc->parent_mask) + wd_parent = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, ".", tc->parent_mask); + if (tc->subdir_mask) + wd_subdir = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_DIR, tc->subdir_mask); + if (tc->child_mask) + wd_child = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_FILE, tc->child_mask); /* - * Generate events on file and subdir that should be reported to parent - * dir with name and to children without name. + * Generate IN_ATTRIB events on file and subdir that should be reported to parent + * dir with name and to children without name if they have IN_ATTRIB in their mask. */ SAFE_CHMOD(TEST_DIR, 0755); SAFE_CHMOD(TEST_FILE, 0644); - event_set[test_cnt].wd = wd_parent; - event_set[test_cnt].mask = IN_ATTRIB | IN_ISDIR; - strcpy(event_set[test_cnt].name, TEST_DIR); - test_cnt++; - event_set[test_cnt].wd = wd_dir; - event_set[test_cnt].mask = IN_ATTRIB | IN_ISDIR; - strcpy(event_set[test_cnt].name, ""); - test_cnt++; - event_set[test_cnt].wd = wd_parent; - event_set[test_cnt].mask = IN_ATTRIB; - strcpy(event_set[test_cnt].name, TEST_FILE); - test_cnt++; - event_set[test_cnt].wd = wd_file; - event_set[test_cnt].mask = IN_ATTRIB; - strcpy(event_set[test_cnt].name, ""); - test_cnt++; + if (wd_parent && (tc->parent_mask & IN_ATTRIB)) { + event_set[test_cnt].wd = wd_parent; + event_set[test_cnt].mask = tc->parent_mask | IN_ISDIR; + strcpy(event_set[test_cnt].name, TEST_DIR); + test_cnt++; + } + if (wd_subdir && (tc->subdir_mask & IN_ATTRIB)) { + event_set[test_cnt].wd = wd_subdir; + event_set[test_cnt].mask = tc->subdir_mask | IN_ISDIR; + strcpy(event_set[test_cnt].name, ""); + test_cnt++; + } + if (wd_parent && (tc->parent_mask & IN_ATTRIB)) { + event_set[test_cnt].wd = wd_parent; + event_set[test_cnt].mask = tc->parent_mask; + strcpy(event_set[test_cnt].name, TEST_FILE); + test_cnt++; + } + if (wd_child && (tc->child_mask & IN_ATTRIB)) { + event_set[test_cnt].wd = wd_child; + event_set[test_cnt].mask = tc->child_mask; + strcpy(event_set[test_cnt].name, ""); + test_cnt++; + } len = read(fd_notify, event_buf, EVENT_BUF_LEN); if (len == -1) @@ -141,7 +169,8 @@ static struct tst_test test = { .needs_tmpdir = 1, .setup = setup, .cleanup = cleanup, - .test_all = verify_inotify, + .test = verify_inotify, + .tcnt = ARRAY_SIZE(tcases), }; #else From patchwork Fri Dec 18 07:06:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 1418116 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=fbidFJju; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cy0KW5W5tz9sWK for ; Fri, 18 Dec 2020 18:06:55 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 398BF3C57AC for ; Fri, 18 Dec 2020 08:06:53 +0100 (CET) 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 76A213C57A6 for ; Fri, 18 Dec 2020 08:06:38 +0100 (CET) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id D25EE14013A5 for ; Fri, 18 Dec 2020 08:06:37 +0100 (CET) Received: by mail-ed1-x535.google.com with SMTP id cw27so1278886edb.5 for ; Thu, 17 Dec 2020 23:06:37 -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 :mime-version:content-transfer-encoding; bh=haxeh3xOqc5wSCRbJ8DDbvZHMlJyW0a+kvxyE3r4l1o=; b=fbidFJjuPh3k8jQWZWDU3ZPfGkBZEu6P0H3qfcAJOHE/tc7aa661XRQQi0JcCvt4Nd PU6xfmOQHRZIG3oXofbemDUvz7lYzTDhwlwu4f9cd/A1BEzQ3WYtKxyYAuz5xiiZGk/5 nBBK+HvFI8xHqcPHK3Sh7Uhi9watBw2EG2OdsKFsmcZYeT7mjcZD6x45snv0yFTUBv/b +8T1ikDtLaWC/0qvuSwqGcA7Y66x3W84g6zC/cIYakq0D7jBLgqdt7fXj7rFOgfQuR7T etEOORpy1f6wNj808jGSOFwtMcp7CVGqO/pN4870JBDmjmEy7MISRDBYMYB7RjUrwbV7 Jq0Q== 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:mime-version:content-transfer-encoding; bh=haxeh3xOqc5wSCRbJ8DDbvZHMlJyW0a+kvxyE3r4l1o=; b=ommHj5V6X3qAkT0ur3YTb8lPa0csN78j4kVIqeWW/EdiYrrW0mHMXT0pevPhNEqJ8U s9DsUVaK5ArGnTO3HWgmsrzzsUm7O/JPBIdRwn07jRbFW+oYVJLR+0Tv0hhN0Q9uvEip Sq+Gz3c3uWAZ0YUYCAUfB7ns8KX+RwE4jZEeYwEgsvE87VTGfSpynwZxqM3v45CjPBH0 64xKz1abtHYaxGc3CWGO7SiN86KqikBLHhaQ12Av6QgyKHCBueMke21Z9U19BycD01Jc hb+sTQZLwJhzJzxppeDBrkcnDB6dXDPCBb8sA57SuS3jh93J9kcKwaKosiCqDQtn5/21 ZVbw== X-Gm-Message-State: AOAM530F/lL7UNMgHkDaMLDymvjNkIdlz7tyq1ZoCpFoDCUOSeAUnnWv rb8AcVYYbB93+s/etmWkzMw4yeLJMzU= X-Google-Smtp-Source: ABdhPJzCzcgTozMC7ghwHmF9ryuS3VI7ocHTw9uIu95llVgRYH0gBwyY+7RhG5Y2qZFG1+SlJbq6eQ== X-Received: by 2002:a05:6402:1765:: with SMTP id da5mr3023214edb.27.1608275197493; Thu, 17 Dec 2020 23:06:37 -0800 (PST) Received: from localhost.localdomain ([31.210.181.203]) by smtp.gmail.com with ESMTPSA id d13sm10852263edx.27.2020.12.17.23.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 23:06:36 -0800 (PST) From: Amir Goldstein To: Petr Vorel Date: Fri, 18 Dec 2020 09:06:30 +0200 Message-Id: <20201218070631.1182292-3-amir73il@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201218070631.1182292-1-amir73il@gmail.com> References: <20201218070631.1182292-1-amir73il@gmail.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 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,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 2/3] syscalls/inotify10: Add test cases with two groups X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hugh Dickins , Jan Kara , ltp@lists.linux.it Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Amir Goldstein Reviewed-by: Petr Vorel --- testcases/kernel/syscalls/inotify/inotify10.c | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/inotify/inotify10.c b/testcases/kernel/syscalls/inotify/inotify10.c index baa955a0a..17aafc773 100644 --- a/testcases/kernel/syscalls/inotify/inotify10.c +++ b/testcases/kernel/syscalls/inotify/inotify10.c @@ -44,10 +44,24 @@ static struct tcase { unsigned int parent_mask; unsigned int subdir_mask; unsigned int child_mask; + unsigned int parent_mask_other; + unsigned int subdir_mask_other; + unsigned int child_mask_other; } tcases[] = { { "Group with parent and child watches", IN_ATTRIB, IN_ATTRIB, IN_ATTRIB, + 0, 0, 0, + }, + { + "Group with child watches and other group with parent watch", + 0, IN_ATTRIB, IN_ATTRIB, + IN_ATTRIB, 0, 0, + }, + { + "Group with parent watch and other group with child watches", + IN_ATTRIB, 0, 0, + 0, IN_ATTRIB, IN_ATTRIB, }, }; @@ -55,7 +69,7 @@ struct event_t event_set[EVENT_MAX]; char event_buf[EVENT_BUF_LEN]; -int fd_notify; +int fd_notify, fd_notify_other; static void verify_inotify(unsigned int n) { @@ -67,6 +81,7 @@ static void verify_inotify(unsigned int n) tst_res(TINFO, "Test #%d: %s", n, tc->tname); fd_notify = SAFE_MYINOTIFY_INIT(); + fd_notify_other = SAFE_MYINOTIFY_INIT(); /* Setup watches on parent dir and children */ if (tc->parent_mask) @@ -75,6 +90,16 @@ static void verify_inotify(unsigned int n) wd_subdir = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_DIR, tc->subdir_mask); if (tc->child_mask) wd_child = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_FILE, tc->child_mask); + /* + * Setup watches on "other" group to verify no intereferecne with our group. + * We do not check events reported to the "other" group. + */ + if (tc->parent_mask_other) + SAFE_MYINOTIFY_ADD_WATCH(fd_notify_other, ".", tc->parent_mask_other); + if (tc->subdir_mask_other) + SAFE_MYINOTIFY_ADD_WATCH(fd_notify_other, TEST_DIR, tc->subdir_mask_other); + if (tc->child_mask_other) + SAFE_MYINOTIFY_ADD_WATCH(fd_notify_other, TEST_FILE, tc->child_mask_other); /* * Generate IN_ATTRIB events on file and subdir that should be reported to parent @@ -151,6 +176,7 @@ static void verify_inotify(unsigned int n) } SAFE_CLOSE(fd_notify); + SAFE_CLOSE(fd_notify_other); } static void setup(void) @@ -163,6 +189,8 @@ static void cleanup(void) { if (fd_notify > 0) SAFE_CLOSE(fd_notify); + if (fd_notify_other > 0) + SAFE_CLOSE(fd_notify_other); } static struct tst_test test = { From patchwork Fri Dec 18 07:06:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 1418117 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=RylsMFlP; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cy0Kg3v4nz9sWK for ; Fri, 18 Dec 2020 18:07:03 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id D662C3C57A6 for ; Fri, 18 Dec 2020 08:07:00 +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 0A23D3C2A46 for ; Fri, 18 Dec 2020 08:06:39 +0100 (CET) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 2D7AD600CFA for ; Fri, 18 Dec 2020 08:06:39 +0100 (CET) Received: by mail-ej1-x631.google.com with SMTP id 6so1704475ejz.5 for ; Thu, 17 Dec 2020 23:06:39 -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 :mime-version:content-transfer-encoding; bh=SwaNCMilkmzhmkYonneEMsAUJQamaMIN6TA4YoYrKY0=; b=RylsMFlPQNhshinUX5y3n0dupon7cskVSGepY0iqEI8caagCLZTcLlldKkzkU4IjKz 8fMrpr1xWXEKPZx07k28cexIodPziAH51tjQc6xYeMyXNuo31xleHbfD6eJB4Y/HF/Jm Vm/HVlSWIOul3GhxY033arxbzPNITlU3z2aOInUyHq+tJ3QAhWAdFTyRrF+2SSTgE/LO V4iooIPE5Xtev6n8Cid1DKEumMdUI8HBuG67wQ3Y5Vzxv+RXD6wtD1d0Ab3PY4qByFsb ztO6D5lwwBrPaLy8aZ0yPXV1nmH50QIqIkJ5pwH0TsD8p1OsDk+4WcIY3QDn8+SXy5CJ E9IA== 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:mime-version:content-transfer-encoding; bh=SwaNCMilkmzhmkYonneEMsAUJQamaMIN6TA4YoYrKY0=; b=D+5Tc5mrSKrFU4odvfYW69brDzXdrIucyqfLOgew5X1+RB8wzpK8sMYubk+6gKf32J Ee+HznL+FhhLkRSVfkS9/lhZj6PWBG05gAPcuiM3qVwLivniALzVvPsOP2BRHiG03trk bre6nk/0z0JdjVvYMDWoNvwXXWRO86eGpEirgr2l2zyV7AWpiRgFYhqWgQxRuligBpjS seifB3UfGemuXyUDzdDtN6u+aFdqtWZLe5BuRLe/mvb++u1tyA/YYJjqYYRyIOdD17Ck Az8xDt2iV3vhFTktZso54SyKQ7jpSpwktDjqcoZ9P/GageUomgsTGUykODSs8p2C90dn XlxQ== X-Gm-Message-State: AOAM531BoMzXEZd5Gi/m8lat25A/V6DVquWjuUp4dcwge2TDSmv3qlfC GXvXqVP//tJXait6zXVnFIE= X-Google-Smtp-Source: ABdhPJyedIeeWYMTN5FPef8oaXIwS86Sx3tNuYFJNr61JHKToFb8faQ4xuVvTGkScWaoAmdwqyoffw== X-Received: by 2002:a17:906:314f:: with SMTP id e15mr2586041eje.496.1608275198793; Thu, 17 Dec 2020 23:06:38 -0800 (PST) Received: from localhost.localdomain ([31.210.181.203]) by smtp.gmail.com with ESMTPSA id d13sm10852263edx.27.2020.12.17.23.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 23:06:38 -0800 (PST) From: Amir Goldstein To: Petr Vorel Date: Fri, 18 Dec 2020 09:06:31 +0200 Message-Id: <20201218070631.1182292-4-amir73il@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201218070631.1182292-1-amir73il@gmail.com> References: <20201218070631.1182292-1-amir73il@gmail.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-2.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,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 3/3] syscalls/inotify10: Test two inotify groups with parent and child watches X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hugh Dickins , Jan Kara , ltp@lists.linux.it Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Add a test case for commit fecc4559780d that fixes a bug introduced in kernel v5.9: fsnotify: fix events reported to watching parent and child Signed-off-by: Amir Goldstein Reviewed-by: Petr Vorel --- testcases/kernel/syscalls/inotify/inotify10.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testcases/kernel/syscalls/inotify/inotify10.c b/testcases/kernel/syscalls/inotify/inotify10.c index 17aafc773..eb2322090 100644 --- a/testcases/kernel/syscalls/inotify/inotify10.c +++ b/testcases/kernel/syscalls/inotify/inotify10.c @@ -8,6 +8,10 @@ * Check that event is reported to watching parent and watching child * based on their interest * + * Test case #3 is a regression test for commit fecc4559780d that fixes + * a bug introduced in kernel v5.9: + * + * fsnotify: fix events reported to watching parent and child */ #include "config.h" @@ -63,6 +67,11 @@ static struct tcase { IN_ATTRIB, 0, 0, 0, IN_ATTRIB, IN_ATTRIB, }, + { + "Two Groups with parent and child watches for different events", + IN_ATTRIB, IN_OPEN, IN_OPEN, + IN_OPEN, IN_ATTRIB, IN_ATTRIB, + }, }; struct event_t event_set[EVENT_MAX]; @@ -199,6 +208,10 @@ static struct tst_test test = { .cleanup = cleanup, .test = verify_inotify, .tcnt = ARRAY_SIZE(tcases), + .tags = (const struct tst_tag[]) { + {"linux-git", "fecc4559780d"}, + {} + } }; #else