summaryrefslogtreecommitdiff
path: root/regress/lib/libfuse/fuse-null-check.c
diff options
context:
space:
mode:
authorhelg <helg@cvs.openbsd.org>2018-07-17 13:12:09 +0000
committerhelg <helg@cvs.openbsd.org>2018-07-17 13:12:09 +0000
commit7986f0bd1c619376c0caa35f2fa51062ddafc837 (patch)
tree8feb13fc495fdeff1c03b3bd59b18e28c938167b /regress/lib/libfuse/fuse-null-check.c
parent4b5a56239456eadaacc1088c392a0a0179f2c375 (diff)
Don't send FBT_DESTROY if the FUSE connection is still PENDING. Also
don't attempt to determine the size of the root inode. This is because we don't need to know the size of directories and FBT_GETATTR will also cause a deadlock if fuse_unmount(3) is called before the file system has a chance to process fbufs. Add corresponding regression test. ok mpi@
Diffstat (limited to 'regress/lib/libfuse/fuse-null-check.c')
-rw-r--r--regress/lib/libfuse/fuse-null-check.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/regress/lib/libfuse/fuse-null-check.c b/regress/lib/libfuse/fuse-null-check.c
new file mode 100644
index 00000000000..3d37001bd3f
--- /dev/null
+++ b/regress/lib/libfuse/fuse-null-check.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018 Helg Bredow <helg@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <fuse.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ fuse_main(0, NULL, NULL, NULL);
+ fuse_new(NULL, NULL, NULL, 0, NULL);
+ fuse_setup(0, NULL, NULL, 0, NULL, NULL, NULL);
+ fuse_mount(NULL, NULL);
+ fuse_remove_signal_handlers(NULL);
+ fuse_set_signal_handlers(NULL);
+ fuse_get_session(NULL);
+ fuse_is_lib_option(NULL);
+ fuse_loop(NULL);
+ fuse_chan_fd(NULL);
+ fuse_unmount(NULL, NULL);
+ fuse_destroy(NULL);
+ fuse_teardown(NULL, NULL);
+ fuse_invalidate(NULL, NULL);
+
+ return (0);
+}