From patchwork Wed Sep 26 17:12:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Schumaker X-Patchwork-Id: 1510231 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 40CCFDF238 for ; Wed, 26 Sep 2012 17:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756781Ab2IZRNJ (ORCPT ); Wed, 26 Sep 2012 13:13:09 -0400 Received: from mx2.netapp.com ([216.240.18.37]:16446 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288Ab2IZRNI (ORCPT ); Wed, 26 Sep 2012 13:13:08 -0400 X-IronPort-AV: E=Sophos;i="4.80,491,1344236400"; d="scan'208";a="694411913" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 26 Sep 2012 10:13:01 -0700 Received: from davros.hq.netapp.com (vpn2ntap-112199.hq.netapp.com [10.63.224.179] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id q8QHD0MT000909; Wed, 26 Sep 2012 10:13:01 -0700 (PDT) From: bjschuma@netapp.com To: Trond.Myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 1/2] NFS: Remove bad delegations during open recovery Date: Wed, 26 Sep 2012 13:12:58 -0400 Message-Id: <1348679579-7888-1-git-send-email-bjschuma@netapp.com> X-Mailer: git-send-email 1.7.12.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Bryan Schumaker I put the client into an open recovery loop by: Client: Open file read half Server: Expire client (echo 0 > /sys/kernel/debug/nfsd/forget_clients) Client: Drop vm cache (echo 3 > /proc/sys/vm/drop_caches) finish reading file This causes a loop because the client never updates the nfs4_state after discovering that the delegation is invalid. This means it will keep trying to read using the bad delegation rather than attempting to re-open the file. Signed-off-by: Bryan Schumaker --- fs/nfs/nfs4proc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 1e50326..e47ec55 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1774,7 +1774,9 @@ static void nfs41_clear_delegation_stateid(struct nfs4_state *state) * informs us the stateid is unrecognized. */ if (status != -NFS4ERR_BAD_STATEID) nfs41_free_stateid(server, stateid); + nfs_remove_bad_delegation(state->inode); + nfs4_stateid_copy(&state->stateid, &state->open_stateid); clear_bit(NFS_DELEGATED_STATE, &state->flags); } }