Thread (23 messages) 23 messages, 2 authors, 2021-10-29
STALE1678d
Revisions (3)
  1. v2 current
  2. v3 [diff vs current]
  3. v4 [diff vs current]

[PATCH v2 08/10] syscalls/fanotify20: Test event after filesystem abort

From: Gabriel Krisman Bertazi <hidden>
Date: 2021-10-26 18:44:19
Also in: ltp
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help