fix locking bugs
authorMiklos Szeredi <miklos@szeredi.hu>
Wed, 23 Jun 2004 05:57:30 +0000 (05:57 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Wed, 23 Jun 2004 05:57:30 +0000 (05:57 +0000)
ChangeLog
kernel/dev.c

index 6a60661cc101c9bda8f90b08f2e2375a329e7910..5e09c3f3b44cdb1dcdbe986a1572cddf98dad539 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 72fdba4dfd5bbabf1e9f473117135c7f32df5dbb..6d082dc41d72b76f50cd899b872d71b33a60ffa0 100644 (file)
@@ -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);
+               }
        }
 }