Quantcast
Channel: lkml.org : Shesha Sreenivasamurthy
Viewing all articles
Browse latest Browse all 1267

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for ...

$
0
0
Linus Torvalds writes: (Summary) On Thu, Oct 5, 2017 at 1:57 PM, Al Viro <viro@zeniv.linux.org.uk> Except you shouldn't do
     if (kbuf->bsize != (u32)kbuf->bsize)

you should do something like

    #define FITS_IN(x,y)  ({ typeof x __x = (x); typeof y __y = __x;
__x == __y; })

and then do

    if (!FITS_IN(kbuf->bsize, ubuf->bsize)) ...

because there is nothing that specifies that the ubuf size of all
fields has to be 32 bits.

But yes,m either you need to then special-case that crazy all-ones
value, or just fix hugetlbfs to not use crazy crap.

Viewing all articles
Browse latest Browse all 1267

Trending Articles