From patchwork Mon Oct 14 06:01:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 3034501 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 935B09F243 for ; Mon, 14 Oct 2013 06:02:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ADE8B20221 for ; Mon, 14 Oct 2013 06:02:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F59E201E4 for ; Mon, 14 Oct 2013 06:02:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750853Ab3JNGCD (ORCPT ); Mon, 14 Oct 2013 02:02:03 -0400 Received: from mail-ea0-f169.google.com ([209.85.215.169]:40082 "EHLO mail-ea0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750731Ab3JNGCB (ORCPT ); Mon, 14 Oct 2013 02:02:01 -0400 Received: by mail-ea0-f169.google.com with SMTP id k11so3139996eaj.14 for ; Sun, 13 Oct 2013 23:02:00 -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; bh=jPG1Y7UhUvQTCaRTaJO7Wx9WddnObKBj898soEOfbAk=; b=LZWdobo43/xD9/g2lq1WISXlFX7cThngoN9/MF38VJan/xZ7AHkOwv00ZRxmf01RUJ WQikDVUFekiO2pDeagKDYx/rmwMYcxOSDiRNragDFYGIRSpvP9+HZr1xEox8TAVFJZoT E80LuM2dfDAlbJ43IaLz0Ot9mAhajLWEzFJ8BAsveXx1AWwwHpQh6LtPRHYPaGB+S/16 2jmR3OJiSTOsXyNi3ZN/oZKPhrCO+YDv58cjtry5Jn7ax4DkY1LTZZVhX+fQe7gD+TxO aA5A06egJqEQqmmeajRmezzB98Rl7HUHjBlE0+c62SaXsqZMsETseijXOvXdjqCs467o WWQg== X-Received: by 10.14.210.8 with SMTP id t8mr53179672eeo.39.1381730519220; Sun, 13 Oct 2013 23:01:59 -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 a43sm149165912eep.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 13 Oct 2013 23:01:58 -0700 (PDT) From: Benny Halevy To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org, Benny Halevy Subject: [PATCH] nfsd: no need to unhash_stid before free Date: Mon, 14 Oct 2013 09:01:55 +0300 Message-Id: <1381730515-18045-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 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 idr_remove is about to be called before kmem_cache_free so unhashing it is redundant Signed-off-by: Benny Halevy --- fs/nfsd/nfs4state.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 0874998..06984e3 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -668,7 +668,6 @@ static void unhash_open_stateid(struct nfs4_ol_stateid *stp) static void release_open_stateid(struct nfs4_ol_stateid *stp) { unhash_open_stateid(stp); - unhash_stid(&stp->st_stid); free_generic_stateid(stp); } @@ -690,7 +689,6 @@ static void release_last_closed_stateid(struct nfs4_openowner *oo) struct nfs4_ol_stateid *s = oo->oo_last_closed_stid; if (s) { - unhash_stid(&s->st_stid); free_generic_stateid(s); oo->oo_last_closed_stid = NULL; } @@ -3998,10 +3996,9 @@ static void nfsd4_close_open_stateid(struct nfs4_ol_stateid *s) nfsd4_close_open_stateid(stp); - if (cstate->minorversion) { - unhash_stid(&stp->st_stid); + if (cstate->minorversion) free_generic_stateid(stp); - } else + else oo->oo_last_closed_stid = stp; if (list_empty(&oo->oo_owner.so_stateids)) {