Re: POHMELFS is back

From: Evgeniy Polyakov
Date: Tue Sep 20 2011 - 13:48:31 EST


On Tue, Sep 20, 2011 at 11:05:17AM -0600, Rick Morgan (rikmorgan@xxxxxxxxx) wrote:
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Please do not use inline html

> <pre wrap="">+static inline int dnet_id_cmp_str(const unsigned char *id1, const unsigned char *id2)
> +{
> + unsigned int <b>i = 0</b>;
> +
> + for (<b>i*=sizeof</b>(unsigned long); i&lt;DNET_ID_SIZE; ++i) {
> + if (id1[i] &lt; id2[i])
> + return -1;
> + if (id1[i] &gt; id2[i])
> + return 1;
> + }
> +
> + return 0;
> +}
> </pre>
> </blockquote>
> if i is initialized to 0, wouldn't i*=sizeof(unsigned long) be zero?<br>

Yes, it counts from zero. This chunk previously checked another
parameter first, but since then it was removed, but checking loop
remained.

--
Evgeniy Polyakov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/