Re: ffs_fhtovp: inode overflow?

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Wed, 11 Dec 2019 23:55:01 +0200
On Wed, Dec 11, 2019 at 10:26:41AM -0600, Eric van Gyzen wrote:
> Since ino64 went in, Coverity complains that the two "ino >= foo" 
> comparisons in ffs_fhtovp() compare a 64-bit value to a 32-bit.  Is this 
> a problem in practice?

I do not think that this a problem, and Coverity could be a bit smarter
there.

The ino variable is 64bit, but why is it worrysome to compare it with a
32 bit value ?   We want to limit the value to the max possible inode
number but still keep it type-correct.

In fact, the ino value is initialized from 32bit struct ufid ufid_ino,
so Coverity could understand that and shut down the warning for formal
reasons.
Received on Wed Dec 11 2019 - 20:55:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:22 UTC