From: Masayoshi MIZUMA Subject: [BUG] ext3: cannot unfreeze a filesystem due to a deadlock Date: Wed, 07 Sep 2011 12:29:30 +0900 Message-ID: <20110907122929.3715.61FB500B@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org To: Jan Kara , Andrew Morton , Andreas Dilger , linux-ext4@vger.kernel.org Return-path: Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:49063 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755133Ab1IGD2j (ORCPT ); Tue, 6 Sep 2011 23:28:39 -0400 Sender: linux-ext4-owner@vger.kernel.org List-ID: Hi, When I checked the freeze feature for ext3 filesystem using fsfreeze command at 3.1.0-rc4, I think the following deadlock problem happened. How to reproduce: # mkfs -t ext3 /dev/sdd1 # mount /dev/sdd1 /MNT # ./fsstress -d /MNT/tmp -n 10 -p 1000 > /dev/null 2>&1 & # fsfreeze -f /MNT # fsfreeze -u /MNT If this deadlock is reproduced, "fsfreeze -u /MNT" does not return. The detail of deadlock: o [flush-8:16:1523] wb_do_writeback wb_writeback ... ext3_journalled_writepage journal_start start_this_handle # waiting until journal->j_barrier_count turns 0... # j_barrier_count was incremented by journal_lock_updates() # via ext3_freeze(). o [fsstress:2673] sys_sync sync_filesystems iterate_supers down_read(sb->s_umount) sync_one_sb __sync_filesystem writeback_inodes_sb writeback_inodes_sb_nr wait_for_completion wait_for_common # waiting for completion of [flush-8:16:1523]... o [fsfreeze:2749] sys_ioctl do_vfs_ioctl thaw_super # waiting for down_write(sb->s_umount)... # [fsfreeze:2673] did down_read(sb->s_umount). I got the following messages. --------------------------------------------------------------------- INFO: task flush-8:16:1523 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. flush-8:16 D e9ab3d14 0 1523 2 0x00000000 f0b2b030 00000046 00000002 e9ab3d14 00000001 00000000 f2c8f530 f3287600 c0ae8600 00000000 00000000 c0ae8600 c0ae8600 c0ae8600 c0ae8600 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Call Trace: [] ? kmem_cache_alloc_trace+0x10a/0x110 [] ? prepare_to_wait+0x6b/0x70 [] ? start_this_handle+0x21d/0x340 [jbd] [] ? dequeue_task_fair+0x36/0xc0 [] ? wake_up_bit+0x30/0x30 [] ? journal_start+0x9a/0xd0 [jbd] [] ? ext3_journalled_writepage+0x8e/0x210 [ext3] [] ? __writepage+0x8/0x30 [] ? write_cache_pages+0x1a5/0x3b0 [] ? set_page_dirty+0x60/0x60 [] ? generic_writepages+0x3e/0x60 [] ? writeback_single_inode+0xff/0x300 [] ? writeback_sb_inodes+0x171/0x200 [] ? wb_writeback+0xa8/0x280 [] ? lock_timer_base+0x27/0x50 [] ? del_timer_sync+0x21/0x40 [] ? wb_do_writeback+0x7b/0x200 [] ? lock_timer_base+0x50/0x50 [] ? bdi_writeback_thread+0x8a/0x1f0 [] ? wb_do_writeback+0x200/0x200 [] ? kthread+0x74/0x80 [] ? kthread_worker_fn+0x150/0x150 [] ? kernel_thread_helper+0x6/0x10 INFO: task fsstress:2673 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. fsstress D 00000000 0 2673 2645 0x00000000 e240d030 00000082 00000000 00000000 00000000 00000000 f7353a30 f32c7600 c0ae8600 bb9fa3df 00000168 c0ae8600 c0ae8600 c0ae8600 c0ae8600 00000001 00000000 00000001 c0ae8600 e240d2bc e240ff3c f2cc8e80 c044db1f 00000002 Call Trace: [] ? load_balance+0x7f/0x3e0 [] ? schedule_timeout+0x19d/0x270 [] ? schedule+0x37e/0x820 [] ? wait_for_common+0xdd/0x140 [] ? try_to_wake_up+0x220/0x220 [] ? writeback_inodes_sb_nr+0x6f/0x90 [] ? drop_dquot_ref+0x110/0x110 [] ? __sync_filesystem+0x42/0xa0 [] ? iterate_supers+0x58/0xa0 [] ? __sync_filesystem+0xa0/0xa0 [] ? sys_sync+0x1e/0x50 [] ? sysenter_do_call+0x12/0x28 INFO: task fsfreeze:2749 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. fsfreeze D e952ff14 0 2749 2640 0x00000000 e9aa3a30 00000086 00000002 e952ff14 ffffff9c 00000000 f2c7f030 f3247600 c0ae8600 fff90830 000000c0 c0ae8600 c0ae8600 c0ae8600 c0ae8600 ee226218 00000000 c05ddfd3 e952ff60 bfab77c0 00000008 c05219ee 0000081b 00000000 Call Trace: [] ? copy_to_user+0x33/0x110 [] ? cp_new_stat64+0xee/0x100 [] ? rwsem_down_failed_common+0x85/0xe0 [] ? call_rwsem_down_write_failed+0x6/0x8 [] ? down_write+0x1c/0x20 [] ? thaw_super+0x1b/0xb0 [] ? ns_capable+0x1d/0x50 [] ? do_vfs_ioctl+0x257/0x2b0 [] ? sys_ioctl+0x8e/0xa0 [] ? sysenter_do_call+0x12/0x28 --------------------------------------------------------------------- Thanks, Masayoshi Mizuma