From: "J. Bruce Fields" <bfields@fieldses.org>
To: Benny Halevy <bhalevy@primarydata.com>
Cc: bfields@redhat.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 6/7] nfsd4: move nfs4_put_file from unhash to put delegation
Date: Tue, 29 Oct 2013 11:59:07 -0400 [thread overview]
Message-ID: <20131029155906.GV31322@fieldses.org> (raw)
In-Reply-To: <1383039572-27405-1-git-send-email-bhalevy@primarydata.com>
On Tue, Oct 29, 2013 at 11:39:32AM +0200, Benny Halevy wrote:
> revoked delegations are unhashed but are kept around in nfsv4.1 and we better
> hang on to dp_file in this case.
I don't agree: we shouldn't need dl_file any more once the delegation is
revoked. It exists only to process delegreturns and set
SEQ4_STATUS_RECALLABLE_STATE_REVOKED.
If some other code (like delegreturn) *is* attempting to use dl_file on
revoked delegation, then that sounds like a delegreturn bug.
Among other things I think we'd like to be able to free up the reference
and deallocate the file on disk if necessary once the delegation has
been revoked.
--b.
>
> Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
> ---
> 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;
> }
>
>
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-10-29 15:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 9:37 [PATCH 0/7] delegation state fixes and cleanups for 3.13 Benny Halevy
2013-10-29 9:39 ` [PATCH 1/7] nfsd4: fix recall_lock use in unhash_delegation Benny Halevy
2013-10-29 14:46 ` J. Bruce Fields
2013-10-30 14:02 ` Benny Halevy
2013-10-30 14:35 ` J. Bruce Fields
2013-10-30 14:43 ` Benny Halevy
2013-10-30 22:19 ` J. Bruce Fields
2013-10-29 9:39 ` [PATCH 2/7] nfsd4: need to destroy revoked delegations in destroy_client Benny Halevy
2013-10-29 15:04 ` J. Bruce Fields
2013-10-29 16:02 ` J. Bruce Fields
2013-10-30 14:07 ` Benny Halevy
2013-10-29 9:39 ` [PATCH 3/7] nfsd4: properly hash delegation in nfs4_setlease Benny Halevy
2013-10-29 9:39 ` [PATCH 4/7] nfsd4: hash deleg stateid only on successful nfs4_set_delegation Benny Halevy
2013-10-29 15:54 ` J. Bruce Fields
2013-10-30 14:10 ` Benny Halevy
2013-10-29 9:39 ` [PATCH 5/7] nfsd4: cleanup hash and unhash delegation Benny Halevy
2013-10-29 9:39 ` [PATCH 6/7] nfsd4: move nfs4_put_file from unhash to put delegation Benny Halevy
2013-10-29 15:59 ` J. Bruce Fields [this message]
2013-10-30 14:16 ` Benny Halevy
2013-10-29 9:39 ` [PATCH 7/7] nfsd4: hold recall_lock while accessing nfs4_delegation.dl_recall_lru Benny Halevy
2013-10-29 16:06 ` [PATCH 0/7] delegation state fixes and cleanups for 3.13 J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131029155906.GV31322@fieldses.org \
--to=bfields@fieldses.org \
--cc=bfields@redhat.com \
--cc=bhalevy@primarydata.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).