From: Miklos Szeredi Date: Thu, 11 Nov 2004 14:46:03 +0000 (+0000) Subject: fix X-Git-Tag: fuse_2_1_pre1~4 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1ee1932223ce126aa81144016a1eae09175176ff;p=qemu-gpiodev%2Flibfuse.git fix --- diff --git a/ChangeLog b/ChangeLog index 055c6f8..0dc4bad 100644 --- 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 * Released 2.1-pre0 diff --git a/kernel/dev.c b/kernel/dev.c index fca6c20..e3ead67 100644 --- a/kernel/dev.c +++ b/kernel/dev.c @@ -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, diff --git a/kernel/inode.c b/kernel/inode.c index b11a8c2..1b7e037 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -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;