From patchwork Sun Jun 5 13:02:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 849752 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p55D2B7B029136 for ; Sun, 5 Jun 2011 13:02:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756056Ab1FENCI (ORCPT ); Sun, 5 Jun 2011 09:02:08 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:42604 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756017Ab1FENCI (ORCPT ); Sun, 5 Jun 2011 09:02:08 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.76 #1 (Red Hat Linux)) id 1QTCxz-0004Wd-80; Sun, 05 Jun 2011 13:02:07 +0000 Date: Sun, 5 Jun 2011 14:02:07 +0100 From: Al Viro To: linux-nfs@vger.kernel.org Cc: Chuck Lever , linux-kernel@vger.kernel.org Subject: [PATCH] fix return values of rpcb_create_local() Message-ID: <20110605130207.GE11521@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 05 Jun 2011 13:02:11 +0000 (UTC) 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... Signed-off-by: Al Viro --- -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 9a80a92..5efaf5f 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -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; }