Bug 215357 - ubifs: ubifs_assert_failed [ubifs]: UBIFS assert failed: 0, in fs/ubifs/file.c:1499
Summary: ubifs: ubifs_assert_failed [ubifs]: UBIFS assert failed: 0, in fs/ubifs/file....
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: fs_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-18 09:37 UTC by Zhihao Cheng
Modified: 2021-12-18 09:39 UTC (History)
0 users

See Also:
Kernel Version: 5.16-rc5
Subsystem:
Regression: No
Bisected commit-id:


Attachments
delay.patch (1.03 KB, patch)
2021-12-18 09:38 UTC, Zhihao Cheng
Details | Diff
a.c (1007 bytes, text/plain)
2021-12-18 09:39 UTC, Zhihao Cheng
Details
setup.sh (893 bytes, application/x-shellscript)
2021-12-18 09:39 UTC, Zhihao Cheng
Details

Description Zhihao Cheng 2021-12-18 09:37:31 UTC
[   78.065456] UBIFS error (ubi0:0 pid 1492): ubifs_assert_failed [ubifs]: UBIFS assert failed: 0, in fs/ubifs/file.c:1499
[   78.068836] UBIFS warning (ubi0:0 pid 1492): ubifs_ro_mode [ubifs]: switched to read-only mode, error -22
[   78.071833] CPU: 2 PID: 1492 Comm: aa Not tainted 5.16.0-rc5-00012-g7bb767dee0ba-dirty #293
[   78.074386] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-buildvm-ppc64le-16.ppc.fedoraproject.org-3.fc31 04/01/2014
[   78.077104] Call Trace:
[   78.077433]  <TASK>
[   78.077718]  ? dump_stack_lvl+0x73/0x9f
[   78.078255]  ? dump_stack+0x13/0x1b
[   78.078724]  ? ubifs_ro_mode+0x54/0x60 [ubifs]
[   78.079337]  ? ubifs_assert_failed+0x4b/0x80 [ubifs]
[   78.080015]  ? ubifs_releasepage+0x7e/0x1e0 [ubifs]
[   78.080676]  ? try_to_release_page+0x57/0xe0
[   78.081252]  ? invalidate_inode_page+0xfb/0x130
[   78.081852]  ? __invalidate_mapping_pages+0xb9/0x280
[   78.082513]  ? blk_finish_plug+0x31/0x50
[   78.083046]  ? generic_writepages+0x6f/0xb0
[   78.083610]  ? do_writepages+0xcc/0x200
[   78.084129]  ? hung_up_tty_compat_ioctl+0x1/0x30
[   78.084745]  ? filemap_fdatawrite_wbc+0xb1/0x100
[   78.085366]  ? __filemap_fdatawrite_range+0x5c/0x80
[   78.086020]  ? invalidate_mapping_pagevec+0x12/0x20
[   78.086670]  ? generic_fadvise+0x303/0x3c0
[   78.087225]  ? vfs_fadvise+0x35/0x40
[   78.087703]  ? ksys_fadvise64_64+0x4c/0xb0
[   78.088254]  ? __x64_sys_fadvise64+0x22/0x30
[   78.088827]  ? do_syscall_64+0x35/0x80
[   78.089335]  ? entry_SYSCALL_64_after_hwframe+0x44/0xae
[   78.090022]  </TASK>




static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
{
	struct inode *inode = page->mapping->host;
	struct ubifs_info *c = inode->i_sb->s_fs_info;

	/*
	 * An attempt to release a dirty page without budgeting for it - should
	 * not happen.
	 */
	if (PageWriteback(page))
		return 0;
	ubifs_assert(c, PagePrivate(page));
	ubifs_assert(c, 0);                   <--- assert failed
	ClearPagePrivate(page);
	ClearPageChecked(page);
	return 1;
}
Comment 1 Zhihao Cheng 2021-12-18 09:38:20 UTC
reproducer:
1. Apply diff.patch
2. ./setup.sh 1
3. compile a.c && run ./aa

[   36.067603] UBIFS error (ubi0:0 pid 7320): ubifs_write_inode [ubifs]: can't write inode 65, error -12
[   36.177111] UBIFS error (ubi0:0 pid 7320): ubifs_releasepage [ubifs]: cannot walk here

[   36.180252] UBIFS error (ubi0:0 pid 7320): ubifs_assert_failed [ubifs]: UBIFS assert failed: 0, in fs/ubifs/file.c:1499
[   36.183350] UBIFS warning (ubi0:0 pid 7320): ubifs_ro_mode [ubifs]: switched to read-only mode, error -22
[   36.185694] CPU: 1 PID: 7320 Comm: aa Not tainted 5.16.0-rc5-00183-g610079b72f07-dirty #299
[   36.187718] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-buildvm-ppc64le-16.ppc.fedoraproject.org-3.fc31 04/01/2014
[   36.190904] Call Trace:
[   36.191512]  <TASK>
[   36.192045]  ? dump_stack_lvl+0x73/0x9f
[   36.192989]  ? dump_stack+0x13/0x1b
[   36.193844]  ? ubifs_ro_mode+0x54/0x60 [ubifs]
[   36.194910]  ? ubifs_assert_failed+0x4b/0x80 [ubifs]
[   36.195606]  ? ubifs_releasepage+0x7e/0x1e0 [ubifs]
[   36.196291]  ? try_to_release_page+0x57/0xe0
[   36.196877]  ? invalidate_inode_page+0xfb/0x130
[   36.197494]  ? __invalidate_mapping_pages+0xb9/0x280
[   36.198184]  ? blk_finish_plug+0x31/0x50
[   36.198720]  ? generic_writepages+0x6f/0xb0
[   36.199297]  ? do_writepages+0xcc/0x200
[   36.199828]  ? virtballoon_restore+0x171/0x1a0
[   36.200443]  ? filemap_fdatawrite_wbc+0xb1/0x100
[   36.201075]  ? __filemap_fdatawrite_range+0x5c/0x80
[   36.201744]  ? invalidate_mapping_pagevec+0x12/0x20
[   36.202409]  ? generic_fadvise+0x303/0x3c0
[   36.202979]  ? vfs_fadvise+0x35/0x40
[   36.203469]  ? ksys_fadvise64_64+0x4c/0xb0
[   36.204034]  ? __x64_sys_fadvise64+0x22/0x30
[   36.204640]  ? do_syscall_64+0x35/0x80
[   36.205167]  ? entry_SYSCALL_64_after_hwframe+0x44/0xae
[   36.205889]  </TASK>
Comment 2 Zhihao Cheng 2021-12-18 09:38:51 UTC
Created attachment 300063 [details]
delay.patch
Comment 3 Zhihao Cheng 2021-12-18 09:39:04 UTC
Created attachment 300065 [details]
a.c
Comment 4 Zhihao Cheng 2021-12-18 09:39:14 UTC
Created attachment 300067 [details]
setup.sh

Note You need to log in before you can comment on or make changes to this bug.