Re: [v4.9 Regression] vfs,mm: fix a dead loop in truncate_inode_pages_range()

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

 



On Wed, Dec 14, 2016 at 1:15 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>>
>>       if (unlikely(*ppos >= inode->i_sb->s_maxbytes))
>> -             return -EINVAL;
>> +             return 0;
>>       iov_iter_truncate(iter, inode->i_sb->s_maxbytes);
>
> BTW, shouldn't we truncate to *ppos - inode->i_sb->s_maxbytes here as well?

You're right, that looks iffy, and I think we should.

That said, I wonder if we instead should get rid of that truncation
entirely, and just do the s_maxbytes test inside the loop? Or perhaps
just modify the last_index calculations - screw the "s_maxbytes" part,
it's really the last index that matters.

           Linus
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]