751f52f
Bugzilla: 1037793
751f52f
Upstream-status: submitted for 3.14
751f52f
751f52f
Currently, it could leak dentry references in some cases. Make sure
751f52f
we clean up properly.
751f52f
751f52f
Signed-off-by: Jeff Layton <jlayton@redhat.com>
751f52f
---
751f52f
 net/sunrpc/rpc_pipe.c | 14 +++++++++++++-
751f52f
 1 file changed, 13 insertions(+), 1 deletion(-)
751f52f
751f52f
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
751f52f
index 5d973b2..b185548 100644
751f52f
--- a/net/sunrpc/rpc_pipe.c
751f52f
+++ b/net/sunrpc/rpc_pipe.c
751f52f
@@ -1369,6 +1369,18 @@ out:
751f52f
 	return pipe_dentry;
751f52f
 }
751f52f
 
751f52f
+static void
751f52f
+rpc_gssd_dummy_depopulate(struct dentry *pipe_dentry)
751f52f
+{
751f52f
+	struct dentry *clnt_dir = pipe_dentry->d_parent;
751f52f
+	struct dentry *gssd_dir = clnt_dir->d_parent;
751f52f
+
751f52f
+	__rpc_rmpipe(clnt_dir->d_inode, pipe_dentry);
751f52f
+	__rpc_depopulate(clnt_dir, gssd_dummy_info_file, 0, 1);
751f52f
+	__rpc_depopulate(gssd_dir, gssd_dummy_clnt_dir, 0, 1);
751f52f
+	dput(pipe_dentry);
751f52f
+}
751f52f
+
751f52f
 static int
751f52f
 rpc_fill_super(struct super_block *sb, void *data, int silent)
751f52f
 {
751f52f
@@ -1412,7 +1424,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
751f52f
 	return 0;
751f52f
 
751f52f
 err_depopulate:
751f52f
-	dput(gssd_dentry);
751f52f
+	rpc_gssd_dummy_depopulate(gssd_dentry);
751f52f
 	blocking_notifier_call_chain(&rpc_pipefs_notifier_list,
751f52f
 					   RPC_PIPEFS_UMOUNT,
751f52f
 					   sb);
751f52f
-- 
751f52f
1.8.4.2
751f52f
751f52f
--
751f52f
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
751f52f
the body of a message to majordomo@vger.kernel.org
751f52f
More majordomo info at  http://vger.kernel.org/majordomo-info.html