diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-06-11 10:03:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-22 11:36:55 -0700 |
commit | b7013d0a16b881481dc25ba4d42c5203bebe5ff1 (patch) | |
tree | 914b66c3d7f5ea27f29919fdb0204641773407df | |
parent | 3993b24649773080897fde524ea2d9f311eba2aa (diff) | |
download | linux-stable-b7013d0a16b881481dc25ba4d42c5203bebe5ff1.tar.gz linux-stable-b7013d0a16b881481dc25ba4d42c5203bebe5ff1.tar.bz2 linux-stable-b7013d0a16b881481dc25ba4d42c5203bebe5ff1.zip |
rpc_pipefs: allow rpc_purge_list to take a NULL waitq pointer
commit 92123e068efa310b09e9943ac1cfd10ff6b6d2e4 upstream.
In the event that we don't have a dentry for a rpc_pipefs pipe, we still
need to allow the queue_timeout job to clean out the queue. There's just
no waitq to wake up in that event.
Reported-by: Hans de Bruin <jmdebruin@xmsnet.nl>
Reported-by: Joerg Platte <jplatte@naasa.net>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 3b62cf288031..faa078f74b27 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -71,7 +71,9 @@ static void rpc_purge_list(wait_queue_head_t *waitq, struct list_head *head, msg->errno = err; destroy_msg(msg); } while (!list_empty(head)); - wake_up(waitq); + + if (waitq) + wake_up(waitq); } static void @@ -91,11 +93,9 @@ rpc_timeout_upcall_queue(struct work_struct *work) } dentry = dget(pipe->dentry); spin_unlock(&pipe->lock); - if (dentry) { - rpc_purge_list(&RPC_I(dentry->d_inode)->waitq, - &free_list, destroy_msg, -ETIMEDOUT); - dput(dentry); - } + rpc_purge_list(dentry ? &RPC_I(dentry->d_inode)->waitq : NULL, + &free_list, destroy_msg, -ETIMEDOUT); + dput(dentry); } ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg, |