From patchwork Wed Jul 30 01:34:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4644211 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 0A9779F440 for ; Wed, 30 Jul 2014 01:35:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4DCDB20145 for ; Wed, 30 Jul 2014 01:35:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7AD372012D for ; Wed, 30 Jul 2014 01:35:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754661AbaG3Bfc (ORCPT ); Tue, 29 Jul 2014 21:35:32 -0400 Received: from mail-qa0-f42.google.com ([209.85.216.42]:62212 "EHLO mail-qa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754725AbaG3Bf2 (ORCPT ); Tue, 29 Jul 2014 21:35:28 -0400 Received: by mail-qa0-f42.google.com with SMTP id j15so579363qaq.29 for ; Tue, 29 Jul 2014 18:35:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ncrMcQyRxupdDyFB90qJIWqym8qtPU+oZfzcHt7yjLA=; b=Dq29gqdJvz6tbzUTyoX6xXXmsCQP//cICZwfnTC1klM+PvjF3JQp8u5xt14IV3FP0G fwIhSpCAe+uyO6Nj9WPXTL8yI1q/MlbLX2NnFPqZoVEqdhj30BJc839JSkI4pGdN6BXi GWdJ/64ISnM7Qz8kwlNM6XFFodccVC16VvZ8AtAIrRmOIouFj0mLqErYt3WEi3OnG5hl cRrjiQy6j7SfbaeQD0pVtqDpFy/AlO+e8SQh4P4zQb3fGk4ogoUPvorIXjHZRnHp/TtW pkwC9p0jZCsc4ldzPewz/hUUPpTiz236xT1NIh4The8Fp+KwF434Z6iLcVO0hSqK1DUu MnEA== X-Gm-Message-State: ALoCoQneaPNiPVf2Le0EvoPW5rcyqGmeH81VFaWXs3jCJNBDXQMnmlPvJm+fW/aN0Vi/ja07bzcp X-Received: by 10.224.65.196 with SMTP id k4mr1360058qai.56.1406684127601; Tue, 29 Jul 2014 18:35:27 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id 81sm860946qgw.21.2014.07.29.18.35.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jul 2014 18:35:26 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, hch@infradead.org, Trond Myklebust Subject: [PATCH v3 25/38] nfsd: Make lock stateid take a reference to the lockowner Date: Tue, 29 Jul 2014 21:34:30 -0400 Message-Id: <1406684083-19736-26-git-send-email-jlayton@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1406684083-19736-1-git-send-email-jlayton@primarydata.com> References: <1406684083-19736-1-git-send-email-jlayton@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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 From: Trond Myklebust A necessary step toward client_mutex removal. Signed-off-by: Trond Myklebust --- fs/nfsd/nfs4state.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 906c8604de30..88225f0bbc12 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -928,6 +928,8 @@ static void nfs4_free_lock_stateid(struct nfs4_stid *stid) file = find_any_file(stp->st_stid.sc_file); if (file) filp_close(file, (fl_owner_t)lo); + if (stp->st_stateowner) + nfs4_put_stateowner(stp->st_stateowner); nfs4_free_ol_stateid(stid); } @@ -4831,6 +4833,7 @@ init_lock_stateid(struct nfs4_ol_stateid *stp, struct nfs4_lockowner *lo, atomic_inc(&stp->st_stid.sc_count); stp->st_stid.sc_type = NFS4_LOCK_STID; stp->st_stateowner = &lo->lo_owner; + atomic_inc(&lo->lo_owner.so_count); get_nfs4_file(fp); stp->st_stid.sc_file = fp; stp->st_stid.sc_free = nfs4_free_lock_stateid;