aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-12-09 09:38:00 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-12-10 12:39:53 -0500
commit23e66ba97127ff3b064d4c6c5138aa34eafc492f (patch)
tree770dfc922af6b4c2872dfab97c3a67eef3effd27 /net/sunrpc
parente2f0c83a9de331d9352185ca3642616c13127539 (diff)
rpc_pipe: fix cleanup of dummy gssd directory when notification fails
Currently, it could leak dentry references in some cases. Make sure we clean up properly. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/rpc_pipe.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 5d973b25b5b0..b18554898562 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -1369,6 +1369,18 @@ out:
1369 return pipe_dentry; 1369 return pipe_dentry;
1370} 1370}
1371 1371
1372static void
1373rpc_gssd_dummy_depopulate(struct dentry *pipe_dentry)
1374{
1375 struct dentry *clnt_dir = pipe_dentry->d_parent;
1376 struct dentry *gssd_dir = clnt_dir->d_parent;
1377
1378 __rpc_rmpipe(clnt_dir->d_inode, pipe_dentry);
1379 __rpc_depopulate(clnt_dir, gssd_dummy_info_file, 0, 1);
1380 __rpc_depopulate(gssd_dir, gssd_dummy_clnt_dir, 0, 1);
1381 dput(pipe_dentry);
1382}
1383
1372static int 1384static int
1373rpc_fill_super(struct super_block *sb, void *data, int silent) 1385rpc_fill_super(struct super_block *sb, void *data, int silent)
1374{ 1386{
@@ -1412,7 +1424,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
1412 return 0; 1424 return 0;
1413 1425
1414err_depopulate: 1426err_depopulate:
1415 dput(gssd_dentry); 1427 rpc_gssd_dummy_depopulate(gssd_dentry);
1416 blocking_notifier_call_chain(&rpc_pipefs_notifier_list, 1428 blocking_notifier_call_chain(&rpc_pipefs_notifier_list,
1417 RPC_PIPEFS_UMOUNT, 1429 RPC_PIPEFS_UMOUNT,
1418 sb); 1430 sb);