linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Tucker <tom@opengridcomputing.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>, Tom Tucker <tom@ogc.us>,
	trond.myklebust@netapp.com, dan.carpenter@oracle.com,
	linux-nfs@vger.kernel.org, steved@redhat.com
Subject: Re: [PATCH] svcrdma: Cleanup sparse warnings in the svcrdma module
Date: Wed, 15 Feb 2012 11:09:04 -0600	[thread overview]
Message-ID: <4F3BE6B0.2090200@opengridcomputing.com> (raw)
In-Reply-To: <20120215161625.GC12490@fieldses.org>

On 2/15/12 10:16 AM, J. Bruce Fields wrote:
> OK, Tom could you fix up these small things and repost?

Sure, but just to be certain I understand fully,

> --b.
>
> On Tue, Feb 14, 2012 at 11:23:42PM +0000, Al Viro wrote:
>> On Tue, Feb 14, 2012 at 05:01:25PM -0600, Tom Tucker wrote:
>>
>>> -	if (ch->rc_discrim == 0)
>>> +	if (ch->rc_discrim == xdr_zero)

You don't want this? It is true that sparse didn't complain, I was simply 
making it obvious that this value is NBO and be consistent across the 
code. Other places were using xdr_zero.

>> Mostly, ACK, modulo this and similar sillyness.  sparse is just fine with
>> use of constant 0 in bitwise contexts; it's also just fine with use of
>> bitwise in logical ones.
>>
>>> +	nchunks = ntohl(ary->wc_nchunks);
>>>   	if (((unsigned long)&ary->wc_array[0] +
>>> -	     (sizeof(struct rpcrdma_write_chunk) * ary->wc_nchunks))>
>>> +	     (sizeof(struct rpcrdma_write_chunk) * nchunks))>
>> BTW, this still can overflow.  With less painful consequences than before that
>> patch, but...
>>
>>> -			BUG_ON(0 == virt_to_page(vec[i].iov_base));
>>> +			BUG_ON(NULL == virt_to_page(vec[i].iov_base));
>> Egads...  What, "!virt_to_page(...)" would have been too pedestrian?


  reply	other threads:[~2012-02-15 17:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 23:01 [PATCH] svcrdma: Cleanup sparse warnings in the svcrdma module Tom Tucker
2012-02-14 23:23 ` Al Viro
2012-02-15 16:16   ` J. Bruce Fields
2012-02-15 17:09     ` Tom Tucker [this message]
2012-02-15 19:03       ` J. Bruce Fields
2012-02-15 17:25     ` [PATCHv2] " Tom Tucker
2012-02-15 17:31       ` Tom Tucker
2012-02-15 17:30     ` [PATCHv3] " Tom Tucker
2012-02-17 22:01       ` J. Bruce Fields

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=4F3BE6B0.2090200@opengridcomputing.com \
    --to=tom@opengridcomputing.com \
    --cc=bfields@fieldses.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    --cc=tom@ogc.us \
    --cc=trond.myklebust@netapp.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).