From: J. Bruce Fields Date: Tue, 6 Nov 2007 18:05:36 +0000 (-0500) Subject: sunrpc: rpc_pipe_poll may miss available data in some cases X-Git-Tag: v2.6.24-rc4~92^2~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eda4f9b7996e5520934ca2a7310b363463a4e3b0;p=linux-2.6 sunrpc: rpc_pipe_poll may miss available data in some cases Pipe messages start out life on a queue on the inode, but when first read they're moved to the filp's private pointer. So it's possible for a poll here to return null even though there's a partially read message available. Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 18f0a8dcc0..c59f3ca2b4 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -280,7 +280,7 @@ rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait) mask = POLLOUT | POLLWRNORM; if (rpci->ops == NULL) mask |= POLLERR | POLLHUP; - if (!list_empty(&rpci->pipe)) + if (filp->private_data || !list_empty(&rpci->pipe)) mask |= POLLIN | POLLRDNORM; return mask; }