From patchwork Sun Aug 3 14:50:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4665821 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BC9039F375 for ; Sun, 3 Aug 2014 14:50:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C4F620149 for ; Sun, 3 Aug 2014 14:50:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3879A20131 for ; Sun, 3 Aug 2014 14:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752029AbaHCOu5 (ORCPT ); Sun, 3 Aug 2014 10:50:57 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:44424 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783AbaHCOu4 (ORCPT ); Sun, 3 Aug 2014 10:50:56 -0400 Received: by mail-pd0-f170.google.com with SMTP id g10so8160602pdj.15 for ; Sun, 03 Aug 2014 07:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=URyX/xZlz1u2Cj8mjdqI7z60w9s7XyypPvkKcNuwPzk=; b=mPSfgTiN5qxKt2o3/k2SHJ6r8rP1fpc1aQ3jdJqRshj537bsmEQwHNIYhZwkroXy+z M3wXesCLinopO5/uHrFYGUBk0vbx7eyA2J4i7WtjlPoxTJXrwvSXUDIUPDSUI4mdo+Pg XIdT3PJzxMG34HFgGXBZ9iertBERg1zqTubZu9VSOx0VYc+xG27kLtmnByNpwjQCG9Yq ElY5jt/LIgqBTwGbubHljtA5or2oE3gX4Rka92ItU53QxPULcCj4dElneIOYZB0YDwIU gnnWUGpcl1FwGq0WTwAGgX6B7e8BooB0qINXHGs4znM/0Q+sb7+OLNJ55GfVpqPZFAaz m50Q== X-Received: by 10.68.222.136 with SMTP id qm8mr2946670pbc.92.1407077456323; Sun, 03 Aug 2014 07:50:56 -0700 (PDT) Received: from [192.168.0.100] ([110.190.119.29]) by mx.google.com with ESMTPSA id oz7sm12989179pdb.77.2014.08.03.07.50.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Aug 2014 07:50:55 -0700 (PDT) Message-ID: <53DE4C33.1040509@gmail.com> Date: Sun, 03 Aug 2014 22:50:27 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Trond Myklebust CC: Chuck Lever , Linux NFS Mailing List , kinglongmee@gmail.com Subject: NFS: Don't restart release lockowner RPC if getting expired error Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix Commit 60ea681299 (NFS: Migration support for RELEASE_LOCKOWNER) If getting expired error, client will enter a infinite loop as, client server RELEASE_LOCKOWNER(old clid) -----> <--- expired error RENEW(old clid) -----> <--- expired error SETCLIENTID -----> <--- a new clid SETCLIENTID_CONFIRM (new clid) --> <--- ok RELEASE_LOCKOWNER(old clid) -----> <--- expired error RENEW(new clid) -----> <-- ok RELEASE_LOCKOWNER(old clid) -----> <--- expired error RENEW(new clid) -----> <-- ok ... ... This patch just handle the expired error to register clientid, but not restart a release lockowner RPC. Signed-off-by: Kinglong Mee --- fs/nfs/nfs4proc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 285ad53..902aadf 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5852,6 +5852,8 @@ static void nfs4_release_lockowner_done(struct rpc_task *task, void *calldata) break; case -NFS4ERR_STALE_CLIENTID: case -NFS4ERR_EXPIRED: + nfs4_async_handle_error(task, server, NULL); + break; case -NFS4ERR_LEASE_MOVED: case -NFS4ERR_DELAY: if (nfs4_async_handle_error(task, server, NULL) == -EAGAIN)