summaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-02-27 22:05:54 +0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-02-27 13:37:48 -0500
commit591ad7feaec5417681b4112f8df52fc43bb7c92e (patch)
tree0555df9d98236f6a63ca109632a277c4458842e3 /include/linux/sunrpc
parent2c9030eef9dbd0d737a7f55646da70d217fd6255 (diff)
downloadlinux-stable-591ad7feaec5417681b4112f8df52fc43bb7c92e.tar.gz
linux-stable-591ad7feaec5417681b4112f8df52fc43bb7c92e.tar.bz2
linux-stable-591ad7feaec5417681b4112f8df52fc43bb7c92e.zip
SUNRPC: move waitq from RPC pipe to RPC inode
Currently, wait queue, used for polling of RPC pipe changes from user-space, is a part of RPC pipe. But the pipe data itself can be released on NFS umount prior to dentry-inode pair, connected to it (is case of this pair is open by some process). This is not a problem for almost all pipe users, because all PipeFS file operations checks pipe reference prior to using it. Except evenfd. This thing registers itself with "poll" file operation and thus has a reference to pipe wait queue. This leads to oopses on destroying eventfd after NFS umount (like rpc_idmapd do) since not pipe data left to the point already. The solution is to wait queue from pipe data to internal RPC inode data. This looks more logical, because this wiat queue used only for user-space processes, which already holds inode reference. Note: upcalls have to get pipe->dentry prior to dereferecing wait queue to make sure, that mount point won't disappear from underneath us. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index 426ce6eeee66..a7b422b33eda 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -28,7 +28,6 @@ struct rpc_pipe {
int pipelen;
int nreaders;
int nwriters;
- wait_queue_head_t waitq;
#define RPC_PIPE_WAIT_FOR_OPEN 1
int flags;
struct delayed_work queue_timeout;
@@ -41,6 +40,7 @@ struct rpc_inode {
struct inode vfs_inode;
void *private;
struct rpc_pipe *pipe;
+ wait_queue_head_t waitq;
};
static inline struct rpc_inode *