sunrpc: fixed rollback in rpc_gssd_dummy_populate()
authorVasily Averin <vvs@virtuozzo.com>
Mon, 1 Jun 2020 08:54:57 +0000 (11:54 +0300)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 26 Jun 2020 12:43:14 +0000 (08:43 -0400)
__rpc_depopulate(gssd_dentry) was lost on error path

cc: stable@vger.kernel.org
Fixes: commit 4b9a445e3eeb ("sunrpc: create a new dummy pipe for gssd to hold open")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/rpc_pipe.c

index 39e14d5..e9d0953 100644 (file)
@@ -1317,6 +1317,7 @@ rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data)
        q.len = strlen(gssd_dummy_clnt_dir[0].name);
        clnt_dentry = d_hash_and_lookup(gssd_dentry, &q);
        if (!clnt_dentry) {
+               __rpc_depopulate(gssd_dentry, gssd_dummy_clnt_dir, 0, 1);
                pipe_dentry = ERR_PTR(-ENOENT);
                goto out;
        }