Re: [syzbot] [mtd?] divide error in block2mtd_setup2

Pei Xiao <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.drivers.mtd
Message-ID <[email protected]>

在 2026/8/11 00:27, Jörn Engel 写道:
> On Sun, Aug 09, 2026 at 07:03:22PM -0700, Jörn Engel wrote:
>>
>> Best guess would be this:
>>
>> 	if ((long)size % erase_size) {
> 
> While at it, what purpose does the cast to (long) serve?
> 
> As far as I can see, it is useless and should be removed.  Fabian, do
> you remember why it was necessary?
The type of size is loff_t (i.e., long long, which is always 64-bit).
Casting it to (long)size on a 32-bit system would truncate it to a
32-bit long, so it seems this long cast needs to be removed.
It's been 12 years.. I wonder if the author still remembers.

Pei.
> 
> Jörn
> 
> --
> The real voyage of discovery consists not in seeking new landscapes,
> but in having new eyes.
> -- Marcel Proust
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.