All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anna Schumaker <schumaker.anna@gmail.com>
To: Weston Andros Adamson <dros@netapp.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 3/4] NFSv4.1: sp4_mach_cred: no need to ref count creds
Date: Wed, 11 Sep 2013 09:01:48 -0400	[thread overview]
Message-ID: <CAFX2Jf=0v0=uKyWPM+fU3W_FQGvP6xAVJMQn9xQdPtaeDhbYwA@mail.gmail.com> (raw)
In-Reply-To: <1378853073-13256-4-git-send-email-dros@netapp.com>

Do we need to do a get_rpccred() after looking up the machine cred in
nfs_alloc_client()?  Where does our guaranteed reference come from?

On Tue, Sep 10, 2013 at 6:44 PM, Weston Andros Adamson <dros@netapp.com> wrote:
> The cl_machine_cred doesn't need to be reference counted here -
> a reference is held is for the lifetime of the struct nfs_client.
> Also, no need to put_rpccred the rpc_message.rpc_cred.
>
> Signed-off-by: Weston Andros Adamson <dros@netapp.com>
> ---
>  fs/nfs/nfs4_fs.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
> index f520a11..07a8aa9 100644
> --- a/fs/nfs/nfs4_fs.h
> +++ b/fs/nfs/nfs4_fs.h
> @@ -279,10 +279,10 @@ _nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_mode,
>         if (test_bit(sp4_mode, &clp->cl_sp4_flags)) {
>                 spin_lock(&clp->cl_lock);
>                 if (clp->cl_machine_cred != NULL)
> -                       newcred = get_rpccred(clp->cl_machine_cred);
> +                       /* don't call get_rpccred on the machine cred -
> +                        * a reference will be held for life of clp */
> +                       newcred = clp->cl_machine_cred;
>                 spin_unlock(&clp->cl_lock);
> -               if (msg->rpc_cred)
> -                       put_rpccred(msg->rpc_cred);
>                 msg->rpc_cred = newcred;
>
>                 flavor = clp->cl_rpcclient->cl_auth->au_flavor;
> --
> 1.7.12.4 (Apple Git-37)
>
> --
> 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

  reply	other threads:[~2013-09-11 13:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 22:44 [PATCH 0/4] NFSv4.1: sp4_mach_cred cleanup (v2) Weston Andros Adamson
2013-09-10 22:44 ` [PATCH 1/4] NFSv4.1: sp4_mach_cred: ask for WRITE and COMMIT Weston Andros Adamson
2013-09-10 22:44 ` [PATCH 2/4] NFSv4.1: fix SECINFO* use of put_rpccred Weston Andros Adamson
2013-09-10 22:44 ` [PATCH 3/4] NFSv4.1: sp4_mach_cred: no need to ref count creds Weston Andros Adamson
2013-09-11 13:01   ` Anna Schumaker [this message]
     [not found]   ` <CAFX2Jf=kbrS6byZBFOoZ64-rb9tCvUHDPZqkip3cy5K12FzaqQ@mail.gmail.com>
2013-09-11 13:13     ` Myklebust, Trond
2013-09-11 13:27       ` Anna Schumaker
2013-09-10 22:44 ` [PATCH 4/4] NFSv4.1: sp4_mach_cred: WARN_ON -> WARN_ON_ONCE Weston Andros Adamson

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='CAFX2Jf=0v0=uKyWPM+fU3W_FQGvP6xAVJMQn9xQdPtaeDhbYwA@mail.gmail.com' \
    --to=schumaker.anna@gmail.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=dros@netapp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.