From: Miklos Szeredi Date: Wed, 23 Jun 2004 05:57:30 +0000 (+0000) Subject: fix locking bugs X-Git-Tag: fuse_1_9~48 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e79dc7eea007ff1040939293294b59fff9df3179;p=qemu-gpiodev%2Flibfuse.git fix locking bugs --- diff --git a/ChangeLog b/ChangeLog index 6a60661..5e09c3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-06-23 Miklos Szeredi + + * Fix locking bugs + 2004-06-22 Miklos Szeredi * No request allocation needed on inode and file release diff --git a/kernel/dev.c b/kernel/dev.c index 72fdba4..6d082dc 100644 --- a/kernel/dev.c +++ b/kernel/dev.c @@ -187,13 +187,13 @@ void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req) { req->issync = 0; - spin_lock(&fuse_lock); if (fc->file) { + spin_lock(&fuse_lock); list_add_tail(&req->list, &fc->pending); wake_up(&fc->waitq); + spin_unlock(&fuse_lock); } else fuse_put_request(fc, req); - spin_unlock(&fuse_lock); } void request_send_nonblock(struct fuse_conn *fc, struct fuse_req *req, @@ -610,8 +610,11 @@ static void end_requests(struct fuse_conn *fc, struct list_head *head) /* Unlocks fuse_lock: */ request_end(fc, req); spin_lock(&fuse_lock); - } else + } else { + spin_unlock(&fuse_lock); fuse_put_request(fc, req); + spin_lock(&fuse_lock); + } } }