Linux NFS development
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Alexandros Batsakis <batsakis@netapp.com>
Cc: linux-nfs@vger.kernel.org, trond@netapp.com
Subject: Re: [PATCH 1/1] nfs: fix race between renewd, umount, and the state manager in V4.1
Date: Fri, 22 Jan 2010 13:47:19 -0500	[thread overview]
Message-ID: <1264186039.30757.7.camel@localhost> (raw)
In-Reply-To: <1264135871-13083-1-git-send-email-batsakis@netapp.com>

On Thu, 2010-01-21 at 20:51 -0800, Alexandros Batsakis wrote:

> struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp)
> @@ -878,7 +888,11 @@ void nfs4_schedule_state_manager(struct nfs_client *clp)
>  	if (test_and_set_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0)
>  		return;
>  	__module_get(THIS_MODULE);
> -	atomic_inc(&clp->cl_count);
> +	if (!atomic_inc_not_zero(&clp->cl_count)) {
> +		nfs4_clear_state_manager_bit(clp);
> +		module_put(THIS_MODULE);
> +		return;
> +	}

The use of atomic_inc_not_zero() should not be necessary here. Anybody
who is calling this function without holding a reference to clp is doing
something fundamentally wrong.

Trond

  reply	other threads:[~2010-01-22 18:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22  4:51 [PATCH 1/1] nfs: fix race between renewd, umount, and the state manager in V4.1 Alexandros Batsakis
2010-01-22 18:47 ` Trond Myklebust [this message]
2010-01-22 19:30   ` Batsakis, Alexandros
     [not found]     ` <B9364369CA66BF45806C2CD86EAB8BA604F35537-hX7t0kiaRRqx3DEm5hsDiAK/GNPrWCqfQQ4Iyu8u01E@public.gmane.org>
2010-01-22 19:41       ` Trond Myklebust
2010-01-22 20:01         ` Batsakis, Alexandros
     [not found]           ` <B9364369CA66BF45806C2CD86EAB8BA604F35581-hX7t0kiaRRqx3DEm5hsDiAK/GNPrWCqfQQ4Iyu8u01E@public.gmane.org>
2010-01-22 20:11             ` Trond Myklebust
2010-01-22 20:21               ` Trond Myklebust
2010-01-22 20:24                 ` Batsakis, Alexandros
  -- strict thread matches above, loose matches on Subject: below --
2010-01-14  0:15 Alexandros Batsakis

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=1264186039.30757.7.camel@localhost \
    --to=trond.myklebust@netapp.com \
    --cc=batsakis@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond@netapp.com \
    /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