From a36721781ed9a7f5722db3468e027e7f742dfb19 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 16 Jan 2006 22:14:34 -0800 Subject: [PATCH] --- yaml --- r: 18653 b: refs/heads/master c: 9ba7cbba100bdaca7316d71d6c6298e61191f8b2 h: refs/heads/master i: 18651: b1fce270ef7acfd259613b0adddab1407e26d245 v: v3 --- [refs] | 2 +- trunk/fs/fuse/dev.c | 6 +++--- trunk/fs/fuse/fuse_i.h | 3 ++- trunk/fs/fuse/inode.c | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 94418538c2a5..893e28c064eb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d77a1d5b611742c538364f041ff4610d27b14fe7 +refs/heads/master: 9ba7cbba100bdaca7316d71d6c6298e61191f8b2 diff --git a/trunk/fs/fuse/dev.c b/trunk/fs/fuse/dev.c index 609875dbd212..5cd43bf917a4 100644 --- a/trunk/fs/fuse/dev.c +++ b/trunk/fs/fuse/dev.c @@ -26,7 +26,7 @@ static struct fuse_conn *fuse_get_conn(struct file *file) struct fuse_conn *fc; spin_lock(&fuse_lock); fc = file->private_data; - if (fc && !fc->mounted) + if (fc && !fc->connected) fc = NULL; spin_unlock(&fuse_lock); return fc; @@ -594,7 +594,7 @@ static void request_wait(struct fuse_conn *fc) DECLARE_WAITQUEUE(wait, current); add_wait_queue_exclusive(&fc->waitq, &wait); - while (fc->mounted && list_empty(&fc->pending)) { + while (fc->connected && list_empty(&fc->pending)) { set_current_state(TASK_INTERRUPTIBLE); if (signal_pending(current)) break; @@ -634,7 +634,7 @@ static ssize_t fuse_dev_readv(struct file *file, const struct iovec *iov, goto err_unlock; request_wait(fc); err = -ENODEV; - if (!fc->mounted) + if (!fc->connected) goto err_unlock; err = -ERESTARTSYS; if (list_empty(&fc->pending)) diff --git a/trunk/fs/fuse/fuse_i.h b/trunk/fs/fuse/fuse_i.h index 5742253164d9..e824a09d3151 100644 --- a/trunk/fs/fuse/fuse_i.h +++ b/trunk/fs/fuse/fuse_i.h @@ -249,7 +249,8 @@ struct fuse_conn { /** Mount is active */ unsigned mounted : 1; - /** Connection established */ + /** Connection established, cleared on umount and device + release */ unsigned connected : 1; /** Connection failed (version mismatch) */ diff --git a/trunk/fs/fuse/inode.c b/trunk/fs/fuse/inode.c index d7aaffe979dd..d6a09fdaa941 100644 --- a/trunk/fs/fuse/inode.c +++ b/trunk/fs/fuse/inode.c @@ -200,6 +200,7 @@ static void fuse_put_super(struct super_block *sb) spin_lock(&fuse_lock); fc->mounted = 0; + fc->connected = 0; /* Flush all readers on this fs */ wake_up_all(&fc->waitq); up_write(&fc->sbput_sem);