public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org, pnfs@linux-nfs.org,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC v2 16/21] nfs: nfs4xdr: introduce decode_verifier helper
Date: Sat, 15 Aug 2009 13:27:04 +0300	[thread overview]
Message-ID: <4A868D78.3070400@panasas.com> (raw)
In-Reply-To: <1250272482.5476.14.camel@heimdal.trondhjem.org>

On Aug. 14, 2009, 20:54 +0300, Trond Myklebust <Trond.Myklebust@netapp.com> wrote:
> On Fri, 2009-08-14 at 17:19 +0300, Benny Halevy wrote:
>> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
>> ---
>>  fs/nfs/nfs4xdr.c |   20 +++++++++++---------
>>  1 files changed, 11 insertions(+), 9 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
>> index 86e6983..b835dcc 100644
>> --- a/fs/nfs/nfs4xdr.c
>> +++ b/fs/nfs/nfs4xdr.c
>> @@ -3320,17 +3320,19 @@ static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res)
>>  	return status;
>>  }
>>  
>> +static int decode_verifier(struct xdr_stream *xdr, void *verifier)
>> +{
>> +	return decode_opaque_fixed(xdr, verifier, 8);
>> +}
>> +
>>  static int decode_commit(struct xdr_stream *xdr, struct nfs_writeres *res)
>>  {
>> -	__be32 *p;
>>  	int status;
>>  
>>  	status = decode_op_hdr(xdr, OP_COMMIT);
>> -	if (status)
>> -		return status;
>> -	READ_BUF(8);
>> -	COPYMEM(res->verf->verifier, 8);
>> -	return 0;
>> +	if (!status)
>> +		status = decode_verifier(xdr, res->verf->verifier);
>> +	return status;
>>  }
>>  
>>  static int decode_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
>> @@ -3852,10 +3854,10 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n
>>  	int		status;
>>  
>>  	status = decode_op_hdr(xdr, OP_READDIR);
>> -	if (status)
>> +	if (!status)
>> +		status = decode_verifier(xdr, readdir->verifier.data);
>> +	if (unlikely(status))
>>  		return status;
>> -	READ_BUF(8);
>> -	COPYMEM(readdir->verifier.data, 8);
>>  	dprintk("%s: verifier = %08x:%08x\n",
>>  			__func__,
>>  			((u32 *)readdir->verifier.data)[0],
> 
> This introduces an uninitialised variable warning into decode_readdir.
> The fix would be to use xdr->p in the calculation of hdrlen.
> 
> I'll add that, no need to resend.

Thanks!

Sadly, I didn't see this warning with gcc 4.4.0 on Fedora 11.
I'm not sure why, but without the -Os (optimize for size) option
it does print the warning. I tried this by manually running the gcc
command "make KBUILD_VERBOSE=1" prints - with and without the -Os option.

Benny

           reply	other threads:[~2009-08-15 10:27 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1250272482.5476.14.camel@heimdal.trondhjem.org>]

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=4A868D78.3070400@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pnfs@linux-nfs.org \
    /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