From patchwork Tue Oct 29 09:39:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 3107001 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 69AF09F2B7 for ; Tue, 29 Oct 2013 09:39:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 555C52030D for ; Tue, 29 Oct 2013 09:39:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC1D720304 for ; Tue, 29 Oct 2013 09:39:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753737Ab3J2JjR (ORCPT ); Tue, 29 Oct 2013 05:39:17 -0400 Received: from mail-we0-f176.google.com ([74.125.82.176]:65523 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753718Ab3J2JjQ (ORCPT ); Tue, 29 Oct 2013 05:39:16 -0400 Received: by mail-we0-f176.google.com with SMTP id w62so7835382wes.35 for ; Tue, 29 Oct 2013 02:39:15 -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=PfBqixRPsMOciXKtF2Iue9jbwsI+mJVqauzTKIl6WdM=; b=mLgmy/cARFU04Tbf/BIqOC1+Duao22Wo4m5CXR6l3XuQ9uNZe7/xdK0lD8VE+mUKCr JOZIIHzq4TqQrmyA5OdTIme8Hn3NgKgfc3SBToejgp/q8lphXCDn03PxEQBJqJ5PoLaO A7enipt+5ar1JoXpiQAvGLCedzfxS2VBoEdtgYZO4SBmMOlcvY0MQV3AMmkktaD/a855 o72sUfeSaB/HTAr2F1N8Gjx6fQNQkN46/9dKKpqSyQ3boNUlTEQMJDpWCaV9pkEC2d0A EOb8P2ytPHN2m92ewGqEYrhmZMwX+VlQENBXvxEG+9MBTKeXbQRawZRDvCixzIfkQb1/ lYFw== X-Received: by 10.181.12.75 with SMTP id eo11mr12619670wid.24.1383039555338; Tue, 29 Oct 2013 02:39:15 -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 q3sm3009235wib.5.2013.10.29.02.39.13 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2013 02:39:14 -0700 (PDT) From: Benny Halevy To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org, Benny Halevy Subject: [PATCH 2/7] nfsd4: need to destroy revoked delegations in destroy_client Date: Tue, 29 Oct 2013 11:39:12 +0200 Message-Id: <1383039552-27209-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 [use list_splice_init] Signed-off-by: Benny Halevy --- fs/nfsd/nfs4state.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a403502..a66b0ad 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1129,6 +1129,13 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name) dp = list_entry(reaplist.next, struct nfs4_delegation, dl_recall_lru); destroy_delegation(dp); } + spin_lock(&recall_lock); + list_splice_init(&clp->cl_revoked, &reaplist); + spin_unlock(&recall_lock); + while (!list_empty(&reaplist)) { + dp = list_entry(reaplist.next, struct nfs4_delegation, dl_recall_lru); + destroy_revoked_delegation(dp); + } while (!list_empty(&clp->cl_openowners)) { oo = list_entry(clp->cl_openowners.next, struct nfs4_openowner, oo_perclient); release_openowner(oo);