diff mbox series

sunrpc: fixed rollback in rpc_gssd_dummy_populate()

Message ID dc913496-1c07-fa86-9019-52fd5dcc878a@virtuozzo.com (mailing list archive)
State New, archived
Headers show
Series sunrpc: fixed rollback in rpc_gssd_dummy_populate() | expand

Commit Message

Vasily Averin June 1, 2020, 8:54 a.m. UTC
__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>
---
 net/sunrpc/rpc_pipe.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jeff Layton June 1, 2020, 11:04 a.m. UTC | #1
On Mon, 2020-06-01 at 11:54 +0300, Vasily Averin wrote:
> __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>
> ---
>  net/sunrpc/rpc_pipe.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
> index 39e14d5..e9d0953 100644
> --- a/net/sunrpc/rpc_pipe.c
> +++ b/net/sunrpc/rpc_pipe.c
> @@ -1317,6 +1317,7 @@ void rpc_put_sb_net(const struct net *net)
>  	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;
>  	}

Good catch!

Reviewed-by: Jeff Layton <jlayton@redhat.com>
diff mbox series

Patch

diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 39e14d5..e9d0953 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -1317,6 +1317,7 @@  void rpc_put_sb_net(const struct net *net)
 	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;
 	}