From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 738AFC433F5 for ; Tue, 26 Oct 2021 18:44:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BE35F61090 for ; Tue, 26 Oct 2021 18:44:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BE35F61090 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux.it Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 59B543C69E0 for ; Tue, 26 Oct 2021 20:44:52 +0200 (CEST) Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 6BFAF3C6A90 for ; Tue, 26 Oct 2021 20:44:11 +0200 (CEST) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id F2F561A0195C for ; Tue, 26 Oct 2021 20:44:10 +0200 (CEST) Received: from localhost (unknown [IPv6:2804:14c:124:8a08::1002]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: krisman) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 965631F40D7C; Tue, 26 Oct 2021 19:44:09 +0100 (BST) From: Gabriel Krisman Bertazi To: ltp@lists.linux.it, jack@suse.com, amir73il@gmail.com Date: Tue, 26 Oct 2021 15:42:37 -0300 Message-Id: <20211026184239.151156-9-krisman@collabora.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211026184239.151156-1-krisman@collabora.com> References: <20211026184239.151156-1-krisman@collabora.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-3.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v2 08/10] syscalls/fanotify20: Test event after filesystem abort 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: linux-ext4@vger.kernel.org, kernel@collabora.com, Gabriel Krisman Bertazi , khazhy@google.com, repnop@google.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" This test monitors the error triggered after a file system abort. It works by forcing a remount with the option "abort". This is an error not related to a file so it is reported against the superblock with a zero size fh. Signed-off-by: Gabriel Krisman Bertazi --- testcases/kernel/syscalls/fanotify/fanotify20.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testcases/kernel/syscalls/fanotify/fanotify20.c b/testcases/kernel/syscalls/fanotify/fanotify20.c index 298bb303a810..5c5ee3c6fb74 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify20.c +++ b/testcases/kernel/syscalls/fanotify/fanotify20.c @@ -57,6 +57,12 @@ static void do_debugfs_request(const char *dev, char *request) SAFE_CMD(cmd, NULL, NULL); } +static void trigger_fs_abort(void) +{ + SAFE_MOUNT(tst_device->dev, MOUNT_PATH, tst_device->fs_type, + MS_REMOUNT|MS_RDONLY, "abort"); +} + static struct test_case { char *name; int error; @@ -64,6 +70,13 @@ static struct test_case { struct fanotify_fid_t *fid; void (*trigger_error)(void); } testcases[] = { + { + .name = "Trigger abort", + .trigger_error = &trigger_fs_abort, + .error_count = 1, + .error = ESHUTDOWN, + .fid = &null_fid, + }, }; int check_error_event_info_fid(struct fanotify_event_info_fid *fid, -- 2.33.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp