Skip to contentSkip to conversation

sunrpc: fixed rollback in rpc_gssd_dummy_populate()

PATCH In review Vasily Averin 2 participants 2 messages Jun 1, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunrpc: fixed rollback in rpc_gssd_dummy_populate()

__rpc_depopulate(gssd_dentry) was lost on error path

Fixes commit 4b9a445e3eeb ("sunrpc: create a new dummy pipe for gssd to hold open")
---
 net/sunrpc/rpc_pipe.c | 1 +
 1 file changed, 1 insertion(+)
net/sunrpc/rpc_pipe.c +1 -0
index 39e14d5..e9d0953 100644
@@ -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;
 	}
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Vasily Averin

__rpc_depopulate(gssd_dentry) was lost on error path

Fixes commit 4b9a445e3eeb ("sunrpc: create a new dummy pipe for gssd to hold open")
---
 net/sunrpc/rpc_pipe.c | 1 +
 1 file changed, 1 insertion(+)
net/sunrpc/rpc_pipe.c +0 -0
index 39e14d5..e9d0953 100644

net/sunrpc/rpc_pipe.c void rpc_put_sb_net(const struct net *net) · line 1323

Quoted 7 lines
net/sunrpc/rpc_pipe.c +1 -0
@@ -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!