From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753968Ab1IENbl (ORCPT ); Mon, 5 Sep 2011 09:31:41 -0400 Received: from mga14.intel.com ([143.182.124.37]:48189 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112Ab1IENbi (ORCPT ); Mon, 5 Sep 2011 09:31:38 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.68,333,1312182000"; d="scan'208";a="45695159" Date: Mon, 5 Sep 2011 21:31:36 +0800 From: Wu Fengguang To: Dave Young Cc: Linux Kernel Mailing List , Andrew Morton Subject: Re: [BUG] D state process after unplug and umount usb disk Message-ID: <20110905133135.GA6124@localhost> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 03, 2011 at 06:31:11PM +0800, Dave Young wrote: > Hi, > > Known issue? > > Reproduce by: > mount /dev/sdb2 /mnt/sdb2 -t ext3 > cat /mnt/sdb2/* >/dev/null > unplug usb disk > umount -f /mnt/sdb2 When I do the above sequence on a normal disk, umount will rightfully fail. So the error is specific to unplugging a mounted USB disk. root@fat /home/wfg# mount /dev/sda7 /fs/sda7 root@fat /home/wfg# ls /fs/sda7 root@fat /home/wfg# cp /dev/zero /fs/sda7& [1] 7900 root@fat /home/wfg# cat /fs/sda7/* > /dev/null&; umount -f /fs/sda7 [2] 7909 umount2: Device or resource busy umount: /fs/sda7: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) umount2: Device or resource busy > dmesg as below: > > [ 1440.567271] SysRq : Show Blocked State > [ 1440.567278] task PC stack pid father > [ 1440.567312] cat D ffff880037a1e378 4296 2381 2310 0x00000004 > [ 1440.567320] ffff88003cca5838 0000000000000046 ffff88003cca57e8 > ffffffff00000000 > [ 1440.567332] 00000000000134c0 00000000000134c0 00000000000134c0 > ffff880037a1e000 > [ 1440.567339] 00000000000134c0 ffff88003cca5fd8 00000000000134c0 > 00000000000134c0 > [ 1440.567347] Call Trace: > [ 1440.567357] [] ? lock_page+0x2a/0x2a > [ 1440.567363] [] io_schedule+0x5e/0x79 > [ 1440.567368] [] sleep_on_page+0x9/0xd > [ 1440.567373] [] __wait_on_bit_lock+0x41/0x8a > [ 1440.567378] [] __lock_page+0x61/0x68 > [ 1440.567384] [] ? autoremove_wake_function+0x34/0x34 > [ 1440.567390] [] ? should_resched+0x9/0x29 > [ 1440.567395] [] lock_page+0x25/0x29 > [ 1440.567400] [] truncate_inode_pages_range+0x2a6/0x32d > [ 1440.567406] [] truncate_inode_pages+0xd/0xf Maybe the page is locked for read IO somewhere else, which never managed to complete due to the unplugged USB disk? This can be (not strictly) confirmed by running this and check if there are locked and !uptodate pages: page-types -lr -b locked If so the root cause should be, the IO requests are stuck rather than being failed after some timeout value. Thanks, Fengguang > [ 1440.567411] [] ext3_evict_inode+0xc9/0x1d7 > [ 1440.567417] [] evict+0xa3/0x15e > [ 1440.567422] [] dispose_list+0x3d/0x49 > [ 1440.567426] [] evict_inodes+0xf1/0x100 > [ 1440.567431] [] generic_shutdown_super+0x47/0xc7 > [ 1440.567436] [] kill_block_super+0x22/0x65 > [ 1440.567441] [] deactivate_locked_super+0x21/0x52 > [ 1440.567445] [] deactivate_super+0x35/0x39 > [ 1440.567452] [] mntput_no_expire+0xcb/0xd0 > [ 1440.567457] [] mntput+0x21/0x23 > [ 1440.567461] [] fput+0x196/0x1a5 > [ 1440.567467] [] filp_close+0x6b/0x76 > [ 1440.567472] [] put_files_struct+0x73/0xd1 > [ 1440.567477] [] exit_files+0x46/0x4f > [ 1440.567481] [] do_exit+0x27d/0x7b3 > [ 1440.567487] [] ? get_signal_to_deliver+0x81/0x4ac > [ 1440.567493] [] ? do_raw_spin_lock+0x6b/0x122 > [ 1440.567497] [] do_group_exit+0x7d/0xa8 > [ 1440.567502] [] get_signal_to_deliver+0x48d/0x4ac > [ 1440.567509] [] do_signal+0x39/0x600 > [ 1440.567514] [] ? fsnotify_access+0x5d/0x65 > [ 1440.567519] [] do_notify_resume+0x27/0x69 > [ 1440.567524] [] ? trace_hardirqs_on_thunk+0x3a/0x3f > [ 1440.567529] [] int_signal+0x12/0x17 > [ 1440.710163] INFO: task cat:2381 blocked for more than 120 seconds. > [ 1440.710170] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" > disables this message. > [ 1440.710175] cat D ffff880037a1e378 4296 2381 2310 0x00000004 > [ 1440.710188] ffff88003cca5838 0000000000000046 ffff88003cca57e8 > ffffffff00000000 > [ 1440.710201] 00000000000134c0 00000000000134c0 00000000000134c0 > ffff880037a1e000 > [ 1440.710218] 00000000000134c0 ffff88003cca5fd8 00000000000134c0 > 00000000000134c0 > [ 1440.710225] Call Trace: > [ 1440.710233] [] ? lock_page+0x2a/0x2a > [ 1440.710239] [] io_schedule+0x5e/0x79 > [ 1440.710244] [] sleep_on_page+0x9/0xd > [ 1440.710249] [] __wait_on_bit_lock+0x41/0x8a > [ 1440.710253] [] __lock_page+0x61/0x68 > [ 1440.710259] [] ? autoremove_wake_function+0x34/0x34 > [ 1440.710264] [] ? should_resched+0x9/0x29 > [ 1440.710269] [] lock_page+0x25/0x29 > [ 1440.710274] [] truncate_inode_pages_range+0x2a6/0x32d > [ 1440.710279] [] truncate_inode_pages+0xd/0xf > [ 1440.710284] [] ext3_evict_inode+0xc9/0x1d7 > [ 1440.710289] [] evict+0xa3/0x15e > [ 1440.710294] [] dispose_list+0x3d/0x49 > [ 1440.710299] [] evict_inodes+0xf1/0x100 > [ 1440.710303] [] generic_shutdown_super+0x47/0xc7 > [ 1440.710308] [] kill_block_super+0x22/0x65 > [ 1440.710312] [] deactivate_locked_super+0x21/0x52 > [ 1440.710316] [] deactivate_super+0x35/0x39 > [ 1440.710322] [] mntput_no_expire+0xcb/0xd0 > [ 1440.710326] [] mntput+0x21/0x23 > [ 1440.710330] [] fput+0x196/0x1a5 > [ 1440.710335] [] filp_close+0x6b/0x76 > [ 1440.710342] [] put_files_struct+0x73/0xd1 > [ 1440.710346] [] exit_files+0x46/0x4f > [ 1440.710350] [] do_exit+0x27d/0x7b3 > [ 1440.710356] [] ? get_signal_to_deliver+0x81/0x4ac > [ 1440.710361] [] ? do_raw_spin_lock+0x6b/0x122 > [ 1440.710366] [] do_group_exit+0x7d/0xa8 > [ 1440.710371] [] get_signal_to_deliver+0x48d/0x4ac > [ 1440.710376] [] do_signal+0x39/0x600 > [ 1440.710381] [] ? fsnotify_access+0x5d/0x65 > [ 1440.710386] [] do_notify_resume+0x27/0x69 > [ 1440.710391] [] ? trace_hardirqs_on_thunk+0x3a/0x3f > [ 1440.710396] [] int_signal+0x12/0x17 > [ 1440.710399] INFO: lockdep is turned off. > > -- > Regards > Yang RuiRui