提交 eda4f9b7 编写于 作者: J J. Bruce Fields 提交者: Trond Myklebust

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: NJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 ef338bee
...@@ -280,7 +280,7 @@ rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait) ...@@ -280,7 +280,7 @@ rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
mask = POLLOUT | POLLWRNORM; mask = POLLOUT | POLLWRNORM;
if (rpci->ops == NULL) if (rpci->ops == NULL)
mask |= POLLERR | POLLHUP; mask |= POLLERR | POLLHUP;
if (!list_empty(&rpci->pipe)) if (filp->private_data || !list_empty(&rpci->pipe))
mask |= POLLIN | POLLRDNORM; mask |= POLLIN | POLLRDNORM;
return mask; return mask;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册