Re: [syzbot] [hfsplus?] [udf?] [fat?] [jfs?] [vfs?] [hfs?] [exfat?] [ntfs3?] WARNING in __mpage_writepage

From: Jan Kara
Date: Tue Jan 31 2023 - 07:14:29 EST


On Tue 31-01-23 02:05:58, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: e2f86c02fdc9 Add linux-next specific files for 20230127
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=156b2101480000
> kernel config: https://syzkaller.appspot.com/x/.config?x=920c61956db733da
> dashboard link: https://syzkaller.appspot.com/bug?extid=707bba7f823c7b02fa43
> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=118429cd480000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12ccb1c1480000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/ff04f1611fad/disk-e2f86c02.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/67928a8622d3/vmlinux-e2f86c02.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/b444a3d78556/bzImage-e2f86c02.xz
> mounted in repro: https://storage.googleapis.com/syzbot-assets/99c5e7532847/mount_0.gz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+707bba7f823c7b02fa43@xxxxxxxxxxxxxxxxxxxxxxxxx
>
> ------------[ cut here ]------------
> WARNING: CPU: 1 PID: 5085 at fs/mpage.c:570 __mpage_writepage+0x138b/0x16f0 fs/mpage.c:570

This is the warning Willy has added as part of "mpage: convert
__mpage_writepage() to use a folio more fully" and that warning can indeed
easily trigger. There's nothing that serializes writeback against racing
truncate setting new i_size so it is perfectly normal to see pages beyond
EOF in this place. And the traditional response to such pages is "silently
do nothing" since they will be soon discarded by truncate_inode_pages().

Honza

--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR