Bug 151511 - BUGON at fs/ext4/inode.c line :2245
Summary: BUGON at fs/ext4/inode.c line :2245
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: ext4 (show other bugs)
Hardware: All Linux
: P1 high
Assignee: fs_ext4@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-05 03:42 UTC by wangguang
Modified: 2016-08-05 05:45 UTC (History)
3 users (show)

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


Attachments

Description wangguang 2016-08-05 03:42:33 UTC
I hit the BUG_ON after munmap a file.

BUGON at fs/ext4/inode.c line :2245
mpage_prepare_extent_to_map
...
head = page_buffers(page); //bug on at here


when io err happened at ext4_writepages->mpage_map_and_submit_extent,ext4 return err from mpage_map_and_submit_extent->mpage_map_one_extent.
Then ext4 set give_up_on_write  be true to discard  dirty pages to avoid infinite loops.
But in mpage_release_unused_pages(&mpd, give_up_on_write), ext4 didn't clean the pte->dirty.
when page munmaped,unmap_page_range->zap_pud_range->zap_pte_range set_page_dirty again will cause the bugon at fs/ext4/inode.c line :2245.
		
	root/mm/memory.c
	zap_pte_range
	1145:		if (pte_dirty(ptent))
	1146:			set_page_dirty(page); //set again cause bugon
	
	
I  clear_page_dirty_for_io  in mpage_release_unused_pages can solve the bugon. 

                      if (invalidate) {
+                                       if (page_mapped(page)) 
+                                       {
+                                       clear_page_dirty_for_io(page);
+                                       )
                                block_invalidatepage_range(page, 0,
                                                           PAGE_CACHE_SIZE);
                                ClearPageUptodate(page);
but i am not sure the patch is ok.

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