diff --git a/fs/ext4/extents_status.h b/fs/ext4/extents_status.h index d8e2d4d..70233a6 100644 --- a/fs/ext4/extents_status.h +++ b/fs/ext4/extents_status.h @@ -24,7 +24,7 @@ * With ES_AGGRESSIVE_TEST defined, the result of es caching will be * checked with old map_block's result. */ -#define ES_AGGRESSIVE_TEST__ +#define ES_AGGRESSIVE_TEST /* * These flags live in the high bits of extent_status.es_pblk diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index b3a5213..676c3e1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1588,7 +1588,8 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd, } if (buffer_unwritten(bh) || buffer_mapped(bh)) - BUG_ON(bh->b_blocknr != pblock); + if (bh->b_blocknr != pblock) + goto map_corruption; if (map->m_flags & EXT4_MAP_UNINIT) set_buffer_uninit(bh); clear_buffer_unwritten(bh); @@ -1627,6 +1628,17 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd, } ext4_io_submit(&io_submit); return ret; + +map_corruption: + printk(KERN_ERR "mpage_da_submit_io failed block=%llu != b_blocknr=%llu\n", + (unsigned long long)pblock, (unsigned long long)bh->b_blocknr); + printk(KERN_ERR "ino:%ld lbkl:%lu, b_state=0x%08lx, b_size=%zu\n", + inode->i_ino, cur_logical, bh->b_state, bh->b_size); + /* We have triggered emergency situation. Do not waste our time on + * useless cleanup in order to pretend what situation is under controll. + * Just panic. */ + BUG(); + return -EIO; } static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd)