diff options
author | 2004-06-23 05:57:30 +0000 | |
---|---|---|
committer | 2004-06-23 05:57:30 +0000 | |
commit | e79dc7eea007ff1040939293294b59fff9df3179 (patch) | |
tree | 48d6edd3d5ad335ada394223e73285856c193671 /kernel/dev.c | |
parent | d3dd2d5466a520f7ca866b478faecd1afd3de1f5 (diff) |
fix locking bugs
Diffstat (limited to 'kernel/dev.c')
-rw-r--r-- | kernel/dev.c | 9 |
1 files changed, 6 insertions, 3 deletions
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); + } } } |