Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de5e3dec421c44c999071b8f7e0580ad2ade92ae
Commit:     de5e3dec421c44c999071b8f7e0580ad2ade92ae
Parent:     f92b99b9dccb61760b345baf40ed37f59b91f8af
Author:     Miklos Szeredi <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:31:00 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:43:03 2007 -0700

    fuse: fix reserved request wake up
    
    Use wake_up_all instead of wake_up in put_reserved_req(), otherwise it is
    possible that the right task is not woken up.
    
    Also create a separate reserved_req_waitq in addition to the blocked_waitq,
    since they fulfill totally separate functions.
    
    Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/fuse/dev.c    |    4 ++--
 fs/fuse/fuse_i.h |    3 +++
 fs/fuse/inode.c  |    2 ++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index ebc36f5..9c9e35e 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -129,7 +129,7 @@ static struct fuse_req *get_reserved_req(struct fuse_conn 
*fc,
        struct fuse_file *ff = file->private_data;
 
        do {
-               wait_event(fc->blocked_waitq, ff->reserved_req);
+               wait_event(fc->reserved_req_waitq, ff->reserved_req);
                spin_lock(&fc->lock);
                if (ff->reserved_req) {
                        req = ff->reserved_req;
@@ -155,7 +155,7 @@ static void put_reserved_req(struct fuse_conn *fc, struct 
fuse_req *req)
        fuse_request_init(req);
        BUG_ON(ff->reserved_req);
        ff->reserved_req = req;
-       wake_up(&fc->blocked_waitq);
+       wake_up_all(&fc->reserved_req_waitq);
        spin_unlock(&fc->lock);
        fput(file);
 }
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 9f4603b..95bcb43 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -289,6 +289,9 @@ struct fuse_conn {
        /** waitq for blocked connection */
        wait_queue_head_t blocked_waitq;
 
+       /** waitq for reserved requests */
+       wait_queue_head_t reserved_req_waitq;
+
        /** The next unique request id */
        u64 reqctr;
 
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 8079884..95c8a97 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -232,6 +232,7 @@ static void fuse_put_super(struct super_block *sb)
        kill_fasync(&fc->fasync, SIGIO, POLL_IN);
        wake_up_all(&fc->waitq);
        wake_up_all(&fc->blocked_waitq);
+       wake_up_all(&fc->reserved_req_waitq);
        mutex_lock(&fuse_mutex);
        list_del(&fc->entry);
        fuse_ctl_remove_conn(fc);
@@ -410,6 +411,7 @@ static struct fuse_conn *new_conn(void)
                atomic_set(&fc->count, 1);
                init_waitqueue_head(&fc->waitq);
                init_waitqueue_head(&fc->blocked_waitq);
+               init_waitqueue_head(&fc->reserved_req_waitq);
                INIT_LIST_HEAD(&fc->pending);
                INIT_LIST_HEAD(&fc->processing);
                INIT_LIST_HEAD(&fc->io);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to