]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ocfs2: fix umount hang while shutting down truncate log
authorXue jiufei <xuejiufei@huawei.com>
Thu, 22 May 2014 00:42:32 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:42:32 +0000 (10:42 +1000)
commit212aef46ba4dc831eba9c16603b02ace4f8dd909
tree906c86f6dee9bb3345ad7f0bd8c5bd77ef9771a0
parent6bb3beba75a0af2296ddf8e43a83d8fa8d056481
ocfs2: fix umount hang while shutting down truncate log

Revert XXXX because it may cause umount hang while shutting down truncate
log.

fix NULL pointer dereference when dismount and ocfs2rec simultaneously

The situation is as followes:
ocfs2_dismout_volume
-> ocfs2_recovery_exit
  -> free osb->recovery_map
-> ocfs2_truncate_shutdown
  -> lock global bitmap inode
    -> ocfs2_wait_for_recovery
  -> check whether osb->recovery_map->rm_used is zero
Because osb->recovery_map is already freed, rm_used can be any other
values, so it may yield umount hang.

To prevent NULL pointer dereference while getting sys_root_inode, we
use a osb_tl_disable flag to disable schedule osb_truncate_log_wq after
truncate log shutdown.

Signed-off-by: joyce.xue <xuejiufei@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/alloc.c
fs/ocfs2/ocfs2.h