Skip to contentSkip to conversation

fix return values of rpcb_create_local()

PATCH In review Al Viro 2 participants 2 messages Jun 5, 2011

Subsystems (3)
lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 fix return values of rpcb_create_local()

	commit 7402ab19cdd5943c7dd4f3399afe3abda8077ef5 (SUNRPC: Use AF_LOCAL

for rpcbind upcalls) broke rpcb_create_local() error reporting in several cases. Callers expect negative return value on error and until that commit they used to get it in all failure exits. Now if rpc_create() fails we get -PTR_ERR(clnt), i.e. *positive* value. Restore original behaviour...

---

net/sunrpc/rpcb_clnt.c +2 -2
index 9a80a92..5efaf5f 100644
@@ -193,7 +193,7 @@ static int rpcb_create_local_unix(void)
 	if (IS_ERR(clnt)) {
 		dprintk("RPC:       failed to create AF_LOCAL rpcbind "
 				"client (errno %ld).\n", PTR_ERR(clnt));
-		result = -PTR_ERR(clnt);
+		result = PTR_ERR(clnt);
 		goto out;
 	}
 
@@ -242,7 +242,7 @@ static int rpcb_create_local_net(void)
 	if (IS_ERR(clnt)) {
 		dprintk("RPC:       failed to create local rpcbind "
 				"client (errno %ld).\n", PTR_ERR(clnt));
-		result = -PTR_ERR(clnt);
+		result = PTR_ERR(clnt);
 		goto out;
 	}
 
#1 lore raw
Quoted 14 lines · Al Viro
net/sunrpc/rpcb_clnt.c +1 -1
index 9a80a92..5efaf5f 100644
@@ -193,7 +193,7 @@ static int rpcb_create_local_unix(void)
 	if (IS_ERR(clnt)) {
 		dprintk("RPC:       failed to create AF_LOCAL rpcbind "
 				"client (errno %ld).\n", PTR_ERR(clnt));
-		result = -PTR_ERR(clnt);
+		result = PTR_ERR(clnt);
 		goto out;
 	}
 

net/sunrpc/rpcb_clnt.c static int rpcb_create_local_net(void) · line 245

Quoted 5 lines
net/sunrpc/rpcb_clnt.c +1 -1
@@ -242,7 +242,7 @@ static int rpcb_create_local_net(void)
 	if (IS_ERR(clnt)) {
 		dprintk("RPC:       failed to create local rpcbind "
 				"client (errno %ld).\n", PTR_ERR(clnt));
-		result = -PTR_ERR(clnt);
+		result = PTR_ERR(clnt);

Proabably the dprintk argument should be negated as well.

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."