Re: unused 'size' assignment in filemap_nopage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>	size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
>	if (pgoff >= size)
>		goto outside_data_content;
>	...
>	if (size > endoff)
>		size = endoff;
>
>After this, size is not referenced.  So, either this potential reassignment
>of size is superfluous, or we are missing some other code later on in the
>function.  If it is the former, I've attached a patch which will remove the
>code.

Only if you can make sure the SIZE will never be bigger than ENDOFF.
What you see here is basically:
  size = min(endoff, (i_size_read...))
With a pgoff>=size somewhere ;)


Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux