fix
authorMiklos Szeredi <miklos@szeredi.hu>
Thu, 11 Nov 2004 14:46:03 +0000 (14:46 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Thu, 11 Nov 2004 14:46:03 +0000 (14:46 +0000)
ChangeLog
kernel/dev.c
kernel/inode.c

index 055c6f8d47eda6fbdda8d31a111adc52f8b7808e..0dc4bad749a0e2ce3a4fec06018208d1f69ff1b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
 
        * Check superblock of proc file in addition to inode number
 
+       * Fix reace between request_send_noreply() and fuse_dev_release()
+
 2004-11-10  Miklos Szeredi <miklos@szeredi.hu>
 
        * Released 2.1-pre0
index fca6c20e88511170b282b06007a2b547c9be3265..e3ead6746c2f96073ba9565b2072fce4d405ab52 100644 (file)
@@ -211,13 +211,15 @@ 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
+       } else {
+               spin_unlock(&fuse_lock);
                fuse_put_request(fc, req);
+       }
 }
 
 void request_send_nonblock(struct fuse_conn *fc, struct fuse_req *req, 
index b11a8c28b0600159e8037a732716fb731ca7c88f..1b7e037a60f2709804d5dfd3fc404dd5adb4076b 100644 (file)
@@ -313,7 +313,8 @@ static struct fuse_conn *get_conn(struct file *file, struct super_block *sb)
        struct inode *ino;
 
        ino = file->f_dentry->d_inode;
-       if (!ino || !proc_fuse_dev || proc_mnt->mnt_sb != ino->i_sb ||
+       if (!ino || !proc_fuse_dev ||
+           strcmp(ino->i_sb->s_type->name, "proc") != 0 ||
            proc_fuse_dev->low_ino != ino->i_ino) {
                printk("FUSE: bad communication file descriptor\n");
                return NULL;