-# $OpenBSD: Makefile,v 1.2 2017/11/16 13:23:13 helg Exp $
+# $OpenBSD: Makefile,v 1.3 2018/07/17 13:12:08 helg Exp $
REGRESS_TARGETS= run-fuse-opt-add-opt
REGRESS_TARGETS+= run-fuse-opt-add-opt-escaped
REGRESS_TARGETS+= run-fuse-opt-match
REGRESS_TARGETS+= run-fuse-opt-parse
REGRESS_TARGETS+= run-fuse-parse-cmdline
+REGRESS_TARGETS+= run-fuse-null-check
+REGRESS_TARGETS+= run-fuse-mount
LDFLAGS+= -lfuse
CLEANFILES= fuse-opt-add-opt
CLEANFILES+=fuse-opt-match
CLEANFILES+=fuse-opt-parse
CLEANFILES+=fuse-parse-cmdline
+CLEANFILES+=fuse-null-check
+CLEANFILES+=fuse-mount
.PHONY: ${REGRESS_TARGETS}
./fuse-opt-parse
run-fuse-parse-cmdline: fuse-parse-cmdline
./fuse-parse-cmdline
+run-fuse-null-check: fuse-null-check
+ ./fuse-null-check
+run-fuse-mount: fuse-mount
+ ./fuse-mount
.include <bsd.regress.mk>
--- /dev/null
+/*
+ * 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>
+
+int
+main(int argc, char **argv)
+{
+ struct fuse_chan *fc;
+ const char *dir = "/mnt";
+
+ fc = fuse_mount(dir, NULL);
+ if (fc == NULL)
+ return (1);
+
+ fuse_unmount(dir, fc);
+
+ return (0);
+}
--- /dev/null
+/*
+ * 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);
+}
-/* $OpenBSD: fuse_vfsops.c,v 1.41 2018/07/16 16:44:09 helg Exp $ */
+/* $OpenBSD: fuse_vfsops.c,v 1.42 2018/07/17 13:12:08 helg Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
if ((error = vflush(mp, NULLVP, flags)))
return (error);
- if (fmp->sess_init) {
- fmp->sess_init = 0;
+ if (fmp->sess_init && fmp->sess_init != PENDING) {
fbuf = fb_setup(0, 0, FBT_DESTROY, p);
error = fb_queue(fmp->dev, fbuf);
fb_delete(fbuf);
}
+ fmp->sess_init = 0;
fuse_device_cleanup(fmp->dev);
fuse_device_set_fmp(fmp, 0);
if (ino == FUSE_ROOTINO)
nvp->v_flag |= VROOT;
-
- /*
- * Initialise the file size so that file size changes can be
- * detected during file operations.
- */
- error = VOP_GETATTR(nvp, &vattr, curproc->p_ucred, curproc);
- if (error) {
- vrele(nvp);
- return (error);
+ else {
+ /*
+ * Initialise the file size so that file size changes can be
+ * detected during file operations.
+ */
+ error = VOP_GETATTR(nvp, &vattr, curproc->p_ucred, curproc);
+ if (error) {
+ vrele(nvp);
+ return (error);
+ }
+ ip->filesize = vattr.va_size;
}
- ip->filesize = vattr.va_size;
*vpp = nvp;