Re: [PATCH 01/13] NFS: Make nfs_cache_array.size a signed integer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2012-02-16 at 15:09 -0500, Chuck Lever wrote:
> On Feb 16, 2012, at 2:52 PM, Myklebust, Trond wrote:
> 
> > On Wed, 2012-02-15 at 16:34 -0500, Chuck Lever wrote:
> >> Eliminate a number of implicit type casts in comparisons, and these
> >> compiler warnings:
> >> 
> >> fs/nfs/dir.c: In function ‘nfs_readdir_clear_array’:
> >> fs/nfs/dir.c:264:16: warning: comparison between signed and unsigned
> >> 		integer expressions [-Wsign-compare]
> >> fs/nfs/dir.c: In function ‘nfs_readdir_search_for_cookie’:
> >> fs/nfs/dir.c:352:16: warning: comparison between signed and unsigned
> >> 		integer expressions [-Wsign-compare]
> >> fs/nfs/dir.c: In function ‘nfs_do_filldir’:
> >> fs/nfs/dir.c:769:38: warning: comparison between signed and unsigned
> >> 		integer expressions [-Wsign-compare]
> >> fs/nfs/dir.c:780:9: warning: comparison between signed and unsigned
> >> 		integer expressions [-Wsign-compare]
> >> 
> >> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> >> ---
> >> 
> >> fs/nfs/dir.c |    2 +-
> >> 1 files changed, 1 insertions(+), 1 deletions(-)
> >> 
> >> diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
> >> index ac28990..8661e13 100644
> >> --- a/fs/nfs/dir.c
> >> +++ b/fs/nfs/dir.c
> >> @@ -207,7 +207,7 @@ struct nfs_cache_array_entry {
> >> };
> >> 
> >> struct nfs_cache_array {
> >> -	unsigned int size;
> >> +	int size;
> >> 	int eof_index;
> >> 	u64 last_cookie;
> >> 	struct nfs_cache_array_entry array[0];
> >> 
> > 
> > Nope. That's a cop-out: array sizes cannot be negative.
> 
> That's typically true, but IIRC the array size here can hold a "-1" as a special value.


Where do you see that? I'm not finding that in the upstream kernel.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux