From patchwork Fri Nov 19 21:19:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 340911 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAJLKtDU011866 for ; Fri, 19 Nov 2010 21:20:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753791Ab0KSVUy (ORCPT ); Fri, 19 Nov 2010 16:20:54 -0500 Received: from mx2.netapp.com ([216.240.18.37]:49687 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755648Ab0KSVUy convert rfc822-to-8bit (ORCPT ); Fri, 19 Nov 2010 16:20:54 -0500 X-IronPort-AV: E=Sophos;i="4.59,226,1288594800"; d="scan'208";a="484675156" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 19 Nov 2010 13:20:38 -0800 Received: from sacrsexc2-prd.hq.netapp.com (sacrsexc2-prd.hq.netapp.com [10.99.115.28]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id oAJLKbXj029594 for ; Fri, 19 Nov 2010 13:20:38 -0800 (PST) Received: from SACMVEXC2-PRD.hq.netapp.com ([10.99.115.18]) by sacrsexc2-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 19 Nov 2010 13:20:38 -0800 Received: from 10.58.61.31 ([10.58.61.31]) by SACMVEXC2-PRD.hq.netapp.com ([10.99.115.16]) with Microsoft Exchange Server HTTP-DAV ; Fri, 19 Nov 2010 21:19:57 +0000 Received: from heimdal.trondhjem.org by SACMVEXC2-PRD.hq.netapp.com; 19 Nov 2010 16:19:57 -0500 Subject: SUNRPC: Fix an infinite loop in call_refresh/call_refreshresult From: Trond Myklebust To: bjschuma@netapp.com Cc: linux-nfs@vger.kernel.org Organization: NetApp Inc Date: Fri, 19 Nov 2010 16:19:57 -0500 Message-ID: <1290201597.3135.57.camel@heimdal.trondhjem.org> Mime-Version: 1.0 X-Mailer: Evolution 2.32.0 (2.32.0-2.fc14) X-OriginalArrivalTime: 19 Nov 2010 21:20:38.0053 (UTC) FILETIME=[9C7DED50:01CB882F] 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.3 (demeter1.kernel.org [140.211.167.41]); Fri, 19 Nov 2010 21:20:55 +0000 (UTC) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 9dab957..7b7dc4e 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -989,20 +989,18 @@ call_refreshresult(struct rpc_task *task) dprint_status(task); task->tk_status = 0; - task->tk_action = call_allocate; - if (status >= 0 && rpcauth_uptodatecred(task)) - return; + task->tk_action = call_refresh; switch (status) { - case -EACCES: - rpc_exit(task, -EACCES); - return; - case -ENOMEM: - rpc_exit(task, -ENOMEM); + case 0: + if (rpcauth_uptodatecred(task)) + task->tk_action = call_allocate; return; case -ETIMEDOUT: rpc_delay(task, 3*HZ); + case -EAGAIN: + return; } - task->tk_action = call_refresh; + rpc_exit(task, status); } /*