Commit 23e66ba9 authored by Jeff Layton's avatar Jeff Layton Committed by Trond Myklebust

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: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent e2f0c83a
...@@ -1369,6 +1369,18 @@ rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data) ...@@ -1369,6 +1369,18 @@ rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data)
return pipe_dentry; return pipe_dentry;
} }
static void
rpc_gssd_dummy_depopulate(struct dentry *pipe_dentry)
{
struct dentry *clnt_dir = pipe_dentry->d_parent;
struct dentry *gssd_dir = clnt_dir->d_parent;
__rpc_rmpipe(clnt_dir->d_inode, pipe_dentry);
__rpc_depopulate(clnt_dir, gssd_dummy_info_file, 0, 1);
__rpc_depopulate(gssd_dir, gssd_dummy_clnt_dir, 0, 1);
dput(pipe_dentry);
}
static int static int
rpc_fill_super(struct super_block *sb, void *data, int silent) rpc_fill_super(struct super_block *sb, void *data, int silent)
{ {
...@@ -1412,7 +1424,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) ...@@ -1412,7 +1424,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
return 0; return 0;
err_depopulate: err_depopulate:
dput(gssd_dentry); rpc_gssd_dummy_depopulate(gssd_dentry);
blocking_notifier_call_chain(&rpc_pipefs_notifier_list, blocking_notifier_call_chain(&rpc_pipefs_notifier_list,
RPC_PIPEFS_UMOUNT, RPC_PIPEFS_UMOUNT,
sb); sb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment