aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-02-27 13:05:54 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-02-27 13:37:48 -0500
commit591ad7feaec5417681b4112f8df52fc43bb7c92e (patch)
tree0555df9d98236f6a63ca109632a277c4458842e3 /include
parent2c9030eef9dbd0d737a7f55646da70d217fd6255 (diff)
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')
-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 {
28 int pipelen; 28 int pipelen;
29 int nreaders; 29 int nreaders;
30 int nwriters; 30 int nwriters;
31 wait_queue_head_t waitq;
32#define RPC_PIPE_WAIT_FOR_OPEN 1 31#define RPC_PIPE_WAIT_FOR_OPEN 1
33 int flags; 32 int flags;
34 struct delayed_work queue_timeout; 33 struct delayed_work queue_timeout;
@@ -41,6 +40,7 @@ struct rpc_inode {
41 struct inode vfs_inode; 40 struct inode vfs_inode;
42 void *private; 41 void *private;
43 struct rpc_pipe *pipe; 42 struct rpc_pipe *pipe;
43 wait_queue_head_t waitq;
44}; 44};
45 45
46static inline struct rpc_inode * 46static inline struct rpc_inode *