From patchwork Tue Oct 29 09:39:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 3107041 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 C51289F2B7 for ; Tue, 29 Oct 2013 09:39:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3AE7202B8 for ; Tue, 29 Oct 2013 09:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A652020253 for ; Tue, 29 Oct 2013 09:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753795Ab3J2Jjg (ORCPT ); Tue, 29 Oct 2013 05:39:36 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:41285 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753786Ab3J2Jjg (ORCPT ); Tue, 29 Oct 2013 05:39:36 -0400 Received: by mail-wi0-f178.google.com with SMTP id hn9so5029336wib.17 for ; Tue, 29 Oct 2013 02:39:35 -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=mA6pBtDOviO1b866nNFvWa3zdWujyltOcVjOxECxIQc=; b=TEReg9iRx8B8JzHSlhh7DL+Ehk5WHApaNPuxCbeCBERQ9yIFS6Ei2Lgwu49p40/Eub GnHl8Iq0CNA1JZasLPDjlLn+qbq9dPg4z2DK5dX+innzOlBcssi8VHx3wUvqytV7K4y2 mkR+DbTNnlGeAt+zu82dAU4o7EFUYJZ+9MajZw0kgOcDwGBcDQtdVnBSeZDBXKMCtB4n aSCcVik5GipsjdyKcU2rj67RyJmG4140+8Ckr45kuCQoOLuAaSIw8i12rsntXG6uLR8j 7U1SP8CmT4ZTAAtHHT+DpWcR6m4Denhh6CArMLeHdOszOtbwfM3Wx2cH5jOwjEcVoeJo C8SA== X-Received: by 10.194.83.6 with SMTP id m6mr419952wjy.83.1383039575212; Tue, 29 Oct 2013 02:39:35 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com (bzq-80-49-130.static.bezeqint.net. [82.80.49.130]) by mx.google.com with ESMTPSA id d11sm3014821wic.4.2013.10.29.02.39.33 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2013 02:39:34 -0700 (PDT) From: Benny Halevy To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org, Benny Halevy Subject: [PATCH 6/7] nfsd4: move nfs4_put_file from unhash to put delegation Date: Tue, 29 Oct 2013 11:39:32 +0200 Message-Id: <1383039572-27405-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <526F81DE.6060704@primarydata.com> References: <526F81DE.6060704@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=-7.3 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 revoked delegations are unhashed but are kept around in nfsv4.1 and we better hang on to dp_file in this case. Signed-off-by: Benny Halevy --- fs/nfsd/nfs4state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 8840206..7f78ff5 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -411,6 +411,8 @@ static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s) { remove_stid(&dp->dl_stid); if (atomic_dec_and_test(&dp->dl_count)) { + if (dp->dl_file) + put_nfs4_file(dp->dl_file); nfs4_free_stid(deleg_slab, &dp->dl_stid); num_delegations--; } @@ -450,8 +452,6 @@ static void unhash_stid(struct nfs4_stid *s) dp->dl_stid.sc_type = 0; nfs4_put_deleg_lease(dp->dl_file); spin_unlock(&recall_lock); - put_nfs4_file(dp->dl_file); - dp->dl_file = NULL; }