aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2006-11-11 09:55:55 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2006-11-11 09:55:55 +0000
commitfc5309cfd2b84b13279f5c512bd575b0a2322ae8 (patch)
tree8859e5a9160eb4708422f93ba66910146c574c1f /lib
parent10d03ed9c381436d06252ab440bc2e910e7e755b (diff)
fixes
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse.c3
-rw-r--r--lib/fuse_lowlevel.c7
-rw-r--r--lib/helper.c8
3 files changed, 13 insertions, 5 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index 6de98fa..4446245 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -1442,12 +1442,13 @@ static void fuse_create(fuse_req_t req, fuse_ino_t parent, const char *name,
/* The open syscall was interrupted, so it must be cancelled */
if(f->op.release)
fuse_do_release(f, req, path, fi);
+ pthread_mutex_unlock(&f->lock);
forget_node(f, e.ino, 1);
} else {
struct node *node = get_node(f, e.ino);
node->open_count ++;
+ pthread_mutex_unlock(&f->lock);
}
- pthread_mutex_unlock(&f->lock);
} else
reply_err(req, err);
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 05d99e1..98738e4 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -952,6 +952,13 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
f->conn.proto_major = arg->major;
f->conn.proto_minor = arg->minor;
+ if (arg->major < 7) {
+ fprintf(stderr, "fuse: unsupported protocol version: %u.%u\n",
+ arg->major, arg->minor);
+ fuse_reply_err(req, EPROTO);
+ return;
+ }
+
if (arg->major > 7 || (arg->major == 7 && arg->minor >= 6)) {
if (f->conn.async_read)
f->conn.async_read = arg->flags & FUSE_ASYNC_READ;
diff --git a/lib/helper.c b/lib/helper.c
index b6925d4..63aefd5 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -255,21 +255,21 @@ static struct fuse *fuse_setup_common(int argc, char *argv[],
res = fuse_daemonize(foreground);
if (res == -1)
- goto err_destroy;
+ goto err_unmount;
res = fuse_set_signal_handlers(fuse_get_session(fuse));
if (res == -1)
- goto err_destroy;
+ goto err_unmount;
if (fd)
*fd = fuse_chan_fd(ch);
return fuse;
- err_destroy:
- fuse_destroy(fuse);
err_unmount:
fuse_unmount_common(*mountpoint, ch);
+ if (fuse)
+ fuse_destroy(fuse);
err_free:
free(*mountpoint);
return NULL;