diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | kernel/dev.c | 9 |
2 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,7 @@ +2004-06-23 Miklos Szeredi <mszeredi@inf.bme.hu> + + * Fix locking bugs + 2004-06-22 Miklos Szeredi <mszeredi@inf.bme.hu> * 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); + } } } |