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-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.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
WARNING: multiple messages have this Message-ID (diff)
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
next prev parent reply other threads:[~2009-08-15 10:27 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-14 14:17 [PATCH RFC v2 0/21] nfs4xdr cleanup v2 Benny Halevy
2009-08-14 14:18 ` [PATCH RFC v2 01/21] sunrpc: hton -> cpu_to_be* Benny Halevy
2009-08-14 14:18 ` [PATCH RFC v2 02/21] sunrpc: ntoh -> be*_to_cpu Benny Halevy
2009-08-14 14:18 ` [PATCH RFC v2 03/21] nfs: nfs4xdr: get rid of WRITE32 Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 04/21] nfs: nfs4xdr: get rid of WRITE64 Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 05/21] nfs: nfs4xdr: get rid of WRITEMEM Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 06/21] nfs: nfs4xdr: optimize RESERVE_SPACE in encode_create_session and encode_sequence Benny Halevy
2009-08-14 16:32 ` Chuck Lever
2009-08-14 16:57 ` Trond Myklebust
[not found] ` <1250269055.5476.11.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-14 18:49 ` Chuck Lever
2009-08-14 19:28 ` Trond Myklebust
[not found] ` <1250278083.5476.51.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-14 19:48 ` Trond Myklebust
2009-08-14 14:19 ` [PATCH RFC v2 07/21] nfs: nfs4xdr: encode_compound_hdr does not have to round up reserved bytes Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 08/21] nfs: nfs4xdr: change RESERVE_SPACE macro into a static helper Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 09/21] nfs: nfs4xdr: optimize low level encoding Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 10/21] nfs: nfs4xdr: merge xdr_encode_int+xdr_encode_opaque_fixed into xdr_encode_opaque Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 11/21] nfs: nfs4xdr: get rid of READ32 Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 12/21] nfs: nfs4xdr: get rid of READ64 Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 13/21] nfs: nfs4xdr: get rid of READTIME Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 14/21] nfs: nfs4xdr: introduce print_overflow_msg Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 15/21] nfs: nfs4xdr: introduce decode_opaque_fixed and decode_stateid helpers Benny Halevy
2009-08-14 14:19 ` [PATCH RFC v2 16/21] nfs: nfs4xdr: introduce decode_verifier helper Benny Halevy
2009-08-14 17:54 ` Trond Myklebust
[not found] ` <1250272482.5476.14.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-15 10:27 ` Benny Halevy [this message]
2009-08-15 10:27 ` Benny Halevy
2009-08-14 14:20 ` [PATCH RFC v2 17/21] nfs: nfs4xdr: introduce decode_sessionid helper Benny Halevy
2009-08-14 14:20 ` [PATCH RFC v2 18/21] nfs: nfs4xdr: get rid of COPYMEM Benny Halevy
2009-08-14 14:20 ` [PATCH RFC v2 19/21] nfs: nfs4xdr: simplify decode_exchange_id by reusing decode_opaque_inline Benny Halevy
2009-08-14 14:20 ` [PATCH RFC v2 20/21] nfs: nfs4xdr: get rid of READ_BUF Benny Halevy
2009-08-14 14:20 ` [PATCH RFC v2 21/21] nfs: nfs4xdr: optimize low level decoding Benny Halevy
2009-08-17 10:40 ` [pnfs] [PATCH RFC v2 0/21] nfs4xdr cleanup v2 Boaz Harrosh
2009-08-17 12:47 ` Trond Myklebust
[not found] ` <1250513254.8475.20.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-17 13:54 ` Boaz Harrosh
2009-08-17 16:48 ` Trond Myklebust
[not found] ` <1250527692.20012.26.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-17 16:53 ` J. Bruce Fields
[not found] ` <4A9240C7.5090307@panasas.com>
2009-08-24 11:56 ` Trond Myklebust
[not found] ` <1251115007.6325.9.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-24 12:50 ` Boaz Harrosh
2009-08-24 12:59 ` Trond Myklebust
[not found] ` <1251118754.6325.47.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-24 13:26 ` Boaz Harrosh
2009-08-24 13:50 ` Trond Myklebust
[not found] ` <1251121822.6325.68.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-24 14:42 ` Boaz Harrosh
2009-08-24 13:45 ` Chuck Lever
2009-08-24 17:04 ` Trond Myklebust
[not found] ` <1251133443.6325.260.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-24 18:45 ` Chuck Lever
2009-08-24 19:54 ` Trond Myklebust
2009-08-17 18:22 ` Peter Staubach
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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.