From patchwork Fri Aug 12 14:32:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Fields X-Patchwork-Id: 1061272 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7CEWdOo029886 for ; Fri, 12 Aug 2011 14:32:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752944Ab1HLOci (ORCPT ); Fri, 12 Aug 2011 10:32:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22938 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752902Ab1HLOch (ORCPT ); Fri, 12 Aug 2011 10:32:37 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7CEWUNt017291 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Aug 2011 10:32:30 -0400 Received: from pad.fieldses.org (vpn-8-131.rdu.redhat.com [10.11.8.131]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7CEWTfL023915; Fri, 12 Aug 2011 10:32:30 -0400 Received: by pad.fieldses.org (Postfix, from userid 2815) id 4CF9B185770; Fri, 12 Aug 2011 10:32:29 -0400 (EDT) Date: Fri, 12 Aug 2011 10:32:29 -0400 From: "J. Bruce Fields" To: Casey Bodley Cc: Boaz Harrosh , NFS list , Mi Jinlong , Malcolm Locke Subject: Re: Grace period NEVER ends Message-ID: <20110812143228.GD16960@pad.fieldses.org> References: <4E44790A.8000106@panasas.com> <4E447EEB.501@panasas.com> <4E4481F0.2050806@panasas.com> <20110812021556.GD9761@pad.fieldses.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 (demeter1.kernel.org [140.211.167.41]); Fri, 12 Aug 2011 14:32:40 +0000 (UTC) On Fri, Aug 12, 2011 at 10:08:03AM -0400, Casey Bodley wrote: > On Thu, Aug 11, 2011 at 10:15 PM, J. Bruce Fields wrote: > > On Thu, Aug 11, 2011 at 06:29:20PM -0700, Boaz Harrosh wrote: > >> With this patch I'm back to the previous behavior. That is > >> wait your grace period then continue. > > > > Is it true for some reason that the client never sends RECLAIM_COMPLETE? > > I tested this yesterday with the windows client and saw the same > never-ending grace period on OPEN. We do send RECLAIM_COMPLETE, and > it completes successfully. Other operations like CREATE and REMOVE > succeed as well. Argh. Does this help? Unfortunately, this doesn't explain Malcolm Locke's problem, as it's 4.1 specific. --b. commit d43b4d070a24edcbe5f5e9ffcf7a33bbeccdd47d Author: J. Bruce Fields Date: Fri Aug 12 10:27:18 2011 -0400 nfsd4: fix failure to end nfsd4 grace period Even if we fail to write a recovery record to stable storage, we should still mark the client as having acquired its first state. Otherwise we leave 4.1 clients with indefinite ERR_GRACE returns. Signed-off-by: J. Bruce Fields --- 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/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 29d77f6..4c7537d 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -156,10 +156,9 @@ out_put: dput(dentry); out_unlock: mutex_unlock(&dir->d_inode->i_mutex); - if (status == 0) { - clp->cl_firststate = 1; + if (status == 0) vfs_fsync(rec_file, 0); - } + clp->cl_firststate = 1; nfs4_reset_creds(original_cred); dprintk("NFSD: nfsd4_create_clid_dir returns %d\n", status); return status;