public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lockd and nfsd endianness annotation fixes
@ 2007-07-26 16:33 Al Viro
  2007-07-26 22:08 ` J. Bruce Fields
  0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2007-07-26 16:33 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, neilb


Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/lockd/svclock.c |    6 +++---
 fs/nfsd/nfs4xdr.c  |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index b3efa45..a21e4bc 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -335,10 +335,10 @@ static void nlmsvc_freegrantargs(struct nlm_rqst *call)
 /*
  * Deferred lock request handling for non-blocking lock
  */
-static u32
+static __be32
 nlmsvc_defer_lock_rqst(struct svc_rqst *rqstp, struct nlm_block *block)
 {
-	u32 status = nlm_lck_denied_nolocks;
+	__be32 status = nlm_lck_denied_nolocks;
 
 	block->b_flags |= B_QUEUED;
 
@@ -352,7 +352,7 @@ nlmsvc_defer_lock_rqst(struct svc_rqst *rqstp, struct nlm_block *block)
 			status = nlm_drop_reply;
 	}
 	dprintk("lockd: nlmsvc_defer_lock_rqst block %p flags %d status %d\n",
-		block, block->b_flags, status);
+		block, block->b_flags, ntohl(status));
 
 	return status;
 }
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index b3d55c6..8ef0964 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2450,7 +2450,7 @@ nfsd4_encode_rename(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_
 }
 
 static void
-nfsd4_encode_secinfo(struct nfsd4_compoundres *resp, int nfserr,
+nfsd4_encode_secinfo(struct nfsd4_compoundres *resp, __be32 nfserr,
 		     struct nfsd4_secinfo *secinfo)
 {
 	int i = 0;
-- 
1.5.3.GIT


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] lockd and nfsd endianness annotation fixes
  2007-07-26 16:33 [PATCH] lockd and nfsd endianness annotation fixes Al Viro
@ 2007-07-26 22:08 ` J. Bruce Fields
  2007-07-27  0:11   ` Neil Brown
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2007-07-26 22:08 UTC (permalink / raw)
  To: Al Viro; +Cc: torvalds, linux-kernel, neilb

On Thu, Jul 26, 2007 at 05:33:49PM +0100, Al Viro wrote:
> 

Oops, thanks; these are my fault.

(How are you finding these?  I was assuming sparse, but running a make
-C2 just now I didn't see anything that would have suggested these
fixes.  I'm using whatever's current in Fedora--it says 0.3-1.fc7.  Do I
need something more recent?)

--b.

> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
>  fs/lockd/svclock.c |    6 +++---
>  fs/nfsd/nfs4xdr.c  |    2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
> index b3efa45..a21e4bc 100644
> --- a/fs/lockd/svclock.c
> +++ b/fs/lockd/svclock.c
> @@ -335,10 +335,10 @@ static void nlmsvc_freegrantargs(struct nlm_rqst *call)
>  /*
>   * Deferred lock request handling for non-blocking lock
>   */
> -static u32
> +static __be32
>  nlmsvc_defer_lock_rqst(struct svc_rqst *rqstp, struct nlm_block *block)
>  {
> -	u32 status = nlm_lck_denied_nolocks;
> +	__be32 status = nlm_lck_denied_nolocks;
>  
>  	block->b_flags |= B_QUEUED;
>  
> @@ -352,7 +352,7 @@ nlmsvc_defer_lock_rqst(struct svc_rqst *rqstp, struct nlm_block *block)
>  			status = nlm_drop_reply;
>  	}
>  	dprintk("lockd: nlmsvc_defer_lock_rqst block %p flags %d status %d\n",
> -		block, block->b_flags, status);
> +		block, block->b_flags, ntohl(status));
>  
>  	return status;
>  }
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index b3d55c6..8ef0964 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -2450,7 +2450,7 @@ nfsd4_encode_rename(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_
>  }
>  
>  static void
> -nfsd4_encode_secinfo(struct nfsd4_compoundres *resp, int nfserr,
> +nfsd4_encode_secinfo(struct nfsd4_compoundres *resp, __be32 nfserr,
>  		     struct nfsd4_secinfo *secinfo)
>  {
>  	int i = 0;
> -- 
> 1.5.3.GIT
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lockd and nfsd endianness annotation fixes
  2007-07-26 22:08 ` J. Bruce Fields
@ 2007-07-27  0:11   ` Neil Brown
  2007-07-27  1:19     ` J. Bruce Fields
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Brown @ 2007-07-27  0:11 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Al Viro, linux-kernel

On Thursday July 26, bfields@fieldses.org wrote:
> On Thu, Jul 26, 2007 at 05:33:49PM +0100, Al Viro wrote:
> > 
> 
> Oops, thanks; these are my fault.
> 
> (How are you finding these?  I was assuming sparse, but running a make
> -C2 just now I didn't see anything that would have suggested these
> fixes.  I'm using whatever's current in Fedora--it says 0.3-1.fc7.  Do I
> need something more recent?)

I have a note about that somewhere.....

> From: Al Viro <viro@ftp.linux.org.uk>
> Subject: Re: [PATCHSET] nfs endianness annotations
> Date: Thu, 19 Oct 2006 02:26:00 +0100
> ....
> 
> Folks, seriously, please run sparse after changes; it's a simple matter of
> make C=2 CF=-D__CHECK_ENDIAN__ fs/nfs*/; nothing tricky and it saves a lot
> of potential PITA...

And with lots of good intentions, I ran this about once, and promptly
forgot.
Apologies.

NeilBrown

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lockd and nfsd endianness annotation fixes
  2007-07-27  0:11   ` Neil Brown
@ 2007-07-27  1:19     ` J. Bruce Fields
  2007-07-27  1:38       ` Al Viro
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2007-07-27  1:19 UTC (permalink / raw)
  To: Neil Brown; +Cc: Al Viro, linux-kernel

On Fri, Jul 27, 2007 at 10:11:41AM +1000, Neil Brown wrote:
> On Thursday July 26, bfields@fieldses.org wrote:
> > On Thu, Jul 26, 2007 at 05:33:49PM +0100, Al Viro wrote:
> > > 
> > 
> > Oops, thanks; these are my fault.
> > 
> > (How are you finding these?  I was assuming sparse, but running a make
> > -C2 just now I didn't see anything that would have suggested these
> > fixes.  I'm using whatever's current in Fedora--it says 0.3-1.fc7.  Do I
> > need something more recent?)
> 
> I have a note about that somewhere.....
> 
> > From: Al Viro <viro@ftp.linux.org.uk>
> > Subject: Re: [PATCHSET] nfs endianness annotations
> > Date: Thu, 19 Oct 2006 02:26:00 +0100
> > ....
> > 
> > Folks, seriously, please run sparse after changes; it's a simple matter of
> > make C=2 CF=-D__CHECK_ENDIAN__ fs/nfs*/; nothing tricky and it saves a lot
> > of potential PITA...
> 
> And with lots of good intentions, I ran this about once, and promptly
> forgot.

Thanks, uh, I probably saw that message too.

Hm, trying it just now--it catches the svclock.c mistake, but not the
one in nfsd/nfs4xdr.c--at least not as far as I can tell.

--b.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lockd and nfsd endianness annotation fixes
  2007-07-27  1:19     ` J. Bruce Fields
@ 2007-07-27  1:38       ` Al Viro
  0 siblings, 0 replies; 5+ messages in thread
From: Al Viro @ 2007-07-27  1:38 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Neil Brown, linux-kernel

On Thu, Jul 26, 2007 at 09:19:22PM -0400, J. Bruce Fields wrote:
 
> Thanks, uh, I probably saw that message too.
> 
> Hm, trying it just now--it catches the svclock.c mistake, but not the
> one in nfsd/nfs4xdr.c--at least not as far as I can tell.

fs/nfsd/nfs4xdr.c:2659:32: warning: incorrect type in argument 2 (different base types)
fs/nfsd/nfs4xdr.c:2659:32:    expected int [signed] nfserr
fs/nfsd/nfs4xdr.c:2659:32:    got restricted unsigned int [usertype] status

is what got triggered.  I.e. call in
        case OP_SECINFO:
                nfsd4_encode_secinfo(resp, op->status, &op->u.secinfo);
                break;
which pointed to the misannotated function...

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-27  1:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-26 16:33 [PATCH] lockd and nfsd endianness annotation fixes Al Viro
2007-07-26 22:08 ` J. Bruce Fields
2007-07-27  0:11   ` Neil Brown
2007-07-27  1:19     ` J. Bruce Fields
2007-07-27  1:38       ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox