From patchwork Thu Sep 26 18:43:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950561 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 838209F288 for ; Thu, 26 Sep 2013 18:43:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA89B202E6 for ; Thu, 26 Sep 2013 18:43:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A306520164 for ; Thu, 26 Sep 2013 18:43:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753005Ab3IZSnS (ORCPT ); Thu, 26 Sep 2013 14:43:18 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:53573 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752967Ab3IZSnS (ORCPT ); Thu, 26 Sep 2013 14:43:18 -0400 Received: by mail-qa0-f46.google.com with SMTP id j7so4585403qaq.5 for ; Thu, 26 Sep 2013 11:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=gYSfRCscdWtpYyQjlfWUCcejK54qw2drA2yvyIoaxMw=; b=vGsbId4nhDUK8Fkt4rW2pYATkFizILi4pyxSn4/jCpQ//HOxRa90pNKJ08DiDXY3WT GRt4j3WF9EyAZHkziXA/dmTQqnmCWWPL9oxy+iJy5qVYeDiLuebNHiKZvewNCxRDlS3D arwtRS//UzZguE77yuoBl+X1zlH1YzywjzxVVo3JMEWkeJZnG2xEvVGLOl55VsU3E80T tKIVm88ARc2bZ4hW6gMMyxzl3ZIXX0bqM7+UHVsuVddN1WOBRG+AS67xsYBVD+ZbYC5G iAyVpE9EJ2r8G4bnzlziL2iVqRyHi8SHRihbnO7awbc0rCIG1xzaDSR47BFbeu9Spjpn h+6g== X-Received: by 10.49.96.225 with SMTP id dv1mr3466930qeb.89.1380220997845; Thu, 26 Sep 2013 11:43:17 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com.com (nat-pool-bos-u.redhat.com. [66.187.233.207]) by mx.google.com with ESMTPSA id g2sm10246160qaf.12.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:43:17 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 49/49] pnfsd: dlm set return_on_close to true Date: Thu, 26 Sep 2013 14:43:15 -0400 Message-Id: <1380220995-14943-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <52447EA0.7070004@primarydata.com> References: <52447EA0.7070004@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 The client may hold a layout post CLOSE essentially forever, requiring the server to remember that. However, since we keep track of the layout state by hanging it on the respective file and client structures, when the file goes away we lose track of the layout therefore we need to set return_on_close to true. Signed-off-by: Benny Halevy --- fs/nfsd/nfs4pnfsdlm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfsd/nfs4pnfsdlm.c b/fs/nfsd/nfs4pnfsdlm.c index de1af22..093d836 100644 --- a/fs/nfsd/nfs4pnfsdlm.c +++ b/fs/nfsd/nfs4pnfsdlm.c @@ -406,6 +406,8 @@ static enum nfsstat4 nfsd4_pnfs_dlm_layoutget(struct inode *inode, res->lg_seg.length = NFS4_MAX_UINT64; /* Always give out READ ONLY layouts */ res->lg_seg.iomode = IOMODE_READ; + /* Set return_on_close to true until we track layout state post CLOSE */ + res->lg_return_on_close = 1; layout = kzalloc(sizeof(*layout), GFP_KERNEL); if (layout == NULL) {