Skip to content

Commit 92123e0

Browse files
jtlaytonTrond Myklebust
authored andcommitted
rpc_pipefs: allow rpc_purge_list to take a NULL waitq pointer
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. Cc: stable@kernel.org 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>
1 parent 2669940 commit 92123e0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎net/sunrpc/rpc_pipe.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ static void rpc_purge_list(wait_queue_head_t *waitq, struct list_head *head,
7171
msg->errno = err;
7272
destroy_msg(msg);
7373
} while (!list_empty(head));
74-
wake_up(waitq);
74+
75+
if (waitq)
76+
wake_up(waitq);
7577
}
7678

7779
static void
@@ -91,11 +93,9 @@ rpc_timeout_upcall_queue(struct work_struct *work)
9193
}
9294
dentry = dget(pipe->dentry);
9395
spin_unlock(&pipe->lock);
94-
if (dentry) {
95-
rpc_purge_list(&RPC_I(dentry->d_inode)->waitq,
96-
&free_list, destroy_msg, -ETIMEDOUT);
97-
dput(dentry);
98-
}
96+
rpc_purge_list(dentry ? &RPC_I(dentry->d_inode)->waitq : NULL,
97+
&free_list, destroy_msg, -ETIMEDOUT);
98+
dput(dentry);
9999
}
100100

101101
ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg,

0 commit comments

Comments
 (0)