2006-07-25 15:20:28

by Josh Triplett

[permalink] [raw]
Subject: [PATCH] [nfsd] Add lock annotations to e_start and e_stop

e_start acquires svc_export_cache.hash_lock, and e_stop releases it. Add lock
annotations to these two functions so that sparse can check callers for lock
pairing, and so that sparse will not complain about these functions since they
intentionally use locks in this manner.

Signed-off-by: Josh Triplett <[email protected]>
---
fs/nfsd/export.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 01bc68c..6fe54eb 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1078,6 +1078,7 @@ exp_pseudoroot(struct auth_domain *clp,
/* Iterator */

static void *e_start(struct seq_file *m, loff_t *pos)
+ __acquires(svc_export_cache.hash_lock)
{
loff_t n = *pos;
unsigned hash, export;
@@ -1131,6 +1132,7 @@ static void *e_next(struct seq_file *m,
}

static void e_stop(struct seq_file *m, void *p)
+ __releases(svc_export_cache.hash_lock)
{
read_unlock(&svc_export_cache.hash_lock);
exp_readunlock();



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2006-07-26 08:06:56

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [NFS] [PATCH] [nfsd] Add lock annotations to e_start and e_stop

On Tue, Jul 25, 2006 at 08:20:24AM -0700, Josh Triplett wrote:
> e_start acquires svc_export_cache.hash_lock, and e_stop releases it. Add lock
> annotations to these two functions so that sparse can check callers for lock
> pairing, and so that sparse will not complain about these functions since they
> intentionally use locks in this manner.
>
> Signed-off-by: Josh Triplett <[email protected]>

The Signed-off-by: line doesn't match the from line of this mail. Is that
any problem or fine in general?

2006-07-26 08:19:35

by Arjan van de Ven

[permalink] [raw]
Subject: Re: [NFS] [PATCH] [nfsd] Add lock annotations to e_start and e_stop

On Wed, 2006-07-26 at 09:06 +0100, Christoph Hellwig wrote:
> On Tue, Jul 25, 2006 at 08:20:24AM -0700, Josh Triplett wrote:
> > e_start acquires svc_export_cache.hash_lock, and e_stop releases it. Add lock
> > annotations to these two functions so that sparse can check callers for lock
> > pairing, and so that sparse will not complain about these functions since they
> > intentionally use locks in this manner.
> >
> > Signed-off-by: Josh Triplett <[email protected]>
>
> The Signed-off-by: line doesn't match the from line of this mail. Is that
> any problem or fine in general?

As far as I can see it's customary for the SOB line to state the
affiliation of the person, eg the company that wants to own the
copyright on the code. So I'd expect Josh to use his ibm.com account...

Greetings,
Arjan van de Ven


--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com

2006-07-26 15:42:17

by Josh Triplett

[permalink] [raw]
Subject: Re: [NFS] [PATCH] [nfsd] Add lock annotations to e_start and e_stop

On Wed, 2006-07-26 at 10:19 +0200, Arjan van de Ven wrote:
> On Wed, 2006-07-26 at 09:06 +0100, Christoph Hellwig wrote:
> > On Tue, Jul 25, 2006 at 08:20:24AM -0700, Josh Triplett wrote:
> > > e_start acquires svc_export_cache.hash_lock, and e_stop releases it. Add lock
> > > annotations to these two functions so that sparse can check callers for lock
> > > pairing, and so that sparse will not complain about these functions since they
> > > intentionally use locks in this manner.
> > >
> > > Signed-off-by: Josh Triplett <[email protected]>
> >
> > The Signed-off-by: line doesn't match the from line of this mail. Is that
> > any problem or fine in general?
>
> As far as I can see it's customary for the SOB line to state the
> affiliation of the person, eg the company that wants to own the
> copyright on the code. So I'd expect Josh to use his ibm.com account...

When my internship with IBM ends, the address in the From line stops
working. I've already run into a number of bounces when sending in
these patches; I don't want to contribute to that problem. The address
I gave in the Signed-off-by line should always work, as I can change
where it forwards.

- Josh Triplett