* [patch -next] lockd: double unlock in next_host_state()
@ 2011-01-02 20:20 Dan Carpenter
2011-01-03 15:59 ` Chuck Lever
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2011-01-02 20:20 UTC (permalink / raw)
To: Trond Myklebust; +Cc: J. Bruce Fields, Neil Brown, linux-nfs, kernel-janitors
We unlock again after we goto out.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index c106d6a..5f1bcb2 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -532,7 +532,6 @@ static struct nlm_host *next_host_state(struct hlist_head *cache,
host->h_state++;
nlm_get_host(host);
- mutex_unlock(&nlm_host_mutex);
goto out;
}
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch -next] lockd: double unlock in next_host_state()
2011-01-02 20:20 [patch -next] lockd: double unlock in next_host_state() Dan Carpenter
@ 2011-01-03 15:59 ` Chuck Lever
2011-01-03 16:34 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever @ 2011-01-03 15:59 UTC (permalink / raw)
To: Dan Carpenter
Cc: Trond Myklebust, J. Bruce Fields, Neil Brown, linux-nfs,
kernel-janitors
On Jan 2, 2011, at 3:20 PM, Dan Carpenter wrote:
> We unlock again after we goto out.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/fs/lockd/host.c b/fs/lockd/host.c
> index c106d6a..5f1bcb2 100644
> --- a/fs/lockd/host.c
> +++ b/fs/lockd/host.c
> @@ -532,7 +532,6 @@ static struct nlm_host *next_host_state(struct hlist_head *cache,
> host->h_state++;
>
> nlm_get_host(host);
> - mutex_unlock(&nlm_host_mutex);
> goto out;
> }
> }
Would it also make sense to replace the "goto out;" with a "break;" ?
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch -next] lockd: double unlock in next_host_state()
2011-01-03 15:59 ` Chuck Lever
@ 2011-01-03 16:34 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2011-01-03 16:34 UTC (permalink / raw)
To: Chuck Lever
Cc: Trond Myklebust, J. Bruce Fields, Neil Brown, linux-nfs,
kernel-janitors
On Mon, Jan 03, 2011 at 10:59:36AM -0500, Chuck Lever wrote:
> > - mutex_unlock(&nlm_host_mutex);
> > goto out;
> > }
> > }
>
> Would it also make sense to replace the "goto out;" with a "break;" ?
No. for_each_host() is a nested for loop, so a break would only take
you out of the inner most loop.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-03 16:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-02 20:20 [patch -next] lockd: double unlock in next_host_state() Dan Carpenter
2011-01-03 15:59 ` Chuck Lever
2011-01-03 16:34 ` Dan Carpenter
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).