linux/fs/f2fs
Chao Yu 1601839e9e f2fs: fix to release count of meta page in ->invalidatepage
We will encounter deadloop in below scenario:

1. increase page count for F2FS_DIRTY_META type in following path:
->recover_fsync_data
  ->recover_data
    ->do_recover_data
      ->recover_data_page
        ->change_curseg
          ->write_sum_page
            ->set_page_dirty
2. fail in recover_data()
3. invalidate meta pages in truncate_inode_pages_final without decreasing page
   count.
4. deadloop when sync_meta_pages as page count will always be non-zero.

message:
NMI watchdog: BUG: soft lockup - CPU#0 stuck for 22s!

 [<c1129a37>] pagevec_lookup_tag+0x27/0x30
 [<f0e774c7>] sync_meta_pages+0x87/0x160 [f2fs]
 [<f0e86dd9>] recover_fsync_data+0xeb9/0xf10 [f2fs]
 [<f0e75398>] f2fs_fill_super+0x888/0x980 [f2fs]
 [<c11733ca>] mount_bdev+0x16a/0x1a0
 [<f0e7180f>] f2fs_mount+0x1f/0x30 [f2fs]
 [<c1173da6>] mount_fs+0x36/0x170
 [<c118b6f5>] vfs_kern_mount+0x55/0xe0
 [<c118d63f>] do_mount+0x1df/0x9f0
 [<c118e110>] SyS_mount+0x70/0xb0
 [<c15a0c48>] sysenter_do_call+0x12/0x12

To avoid page count leak, let's add ->invalidatepage and ->releasepage in
f2fs_meta_aops as f2fs_node_aops to release meta page count correctly.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2015-02-11 17:04:33 -08:00
..
acl.c f2fs: avoid double lock for cp_rwsem 2015-01-09 17:02:25 -08:00
acl.h f2fs: avoid deadlock on init_inode_metadata 2014-11-03 16:07:33 -08:00
checkpoint.c f2fs: fix to release count of meta page in ->invalidatepage 2015-02-11 17:04:33 -08:00
data.c f2fs: fix wrong unlock_page call 2015-01-09 17:02:27 -08:00
debug.c f2fs: update memory footprint information 2015-02-11 17:04:31 -08:00
dir.c f2fs: use missing the use of f2fs_kunmap_page 2015-01-09 17:02:22 -08:00
f2fs.h f2fs: trigger correct checkpoint during umount 2015-02-11 17:04:32 -08:00
file.c f2fs: avoid infinite loop on cp_error 2015-02-11 17:04:30 -08:00
gc.c f2fs: reuse inode_entry_slab in gc procedure for using slab more effectively 2015-01-09 17:02:26 -08:00
gc.h f2fs: reuse inode_entry_slab in gc procedure for using slab more effectively 2015-01-09 17:02:26 -08:00
hash.c f2fs: fix wrong casting for dentry name 2014-08-29 00:26:50 -07:00
inline.c f2fs: clean up to remove parameter 2015-01-09 17:02:26 -08:00
inode.c f2fs: get rid of kzalloc in __recover_inline_status 2015-01-09 17:02:27 -08:00
Kconfig f2fs: add f2fs_io_tracer support 2015-01-09 17:02:24 -08:00
Makefile f2fs: add f2fs_io_tracer support 2015-01-09 17:02:24 -08:00
namei.c f2fs: introduce f2fs_dentry_kunmap to clean up 2014-11-23 21:51:53 -08:00
node.c f2fs: free radix_tree_nodes used by nat_set entries 2015-01-09 17:02:28 -08:00
node.h f2fs: free radix_tree_nodes used by nat_set entries 2015-01-09 17:02:28 -08:00
recovery.c f2fs: clean up to remove parameter 2015-01-09 17:02:26 -08:00
segment.c f2fs: align direct_io'ed data to section 2015-01-09 17:02:27 -08:00
segment.h f2fs: do not skip any writes under memory pressure 2014-11-10 06:51:38 -08:00
super.c f2fs: do checkpoint when umount flag is not set 2015-02-11 17:04:33 -08:00
trace.c f2fs: pids_lock can be static 2015-01-09 17:02:29 -08:00
trace.h f2fs: add f2fs_destroy_trace_ios to free radix tree 2015-01-09 17:02:28 -08:00
xattr.c f2fs: avoid deadlock on init_inode_metadata 2014-11-03 16:07:33 -08:00
xattr.h f2fs: avoid deadlock on init_inode_metadata 2014-11-03 16:07:33 -08:00