Bug 43269 - write block for more than 10 seconds
Summary: write block for more than 10 seconds
Status: RESOLVED OBSOLETE
Alias: None
Product: File System
Classification: Unclassified
Component: XFS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: XFS Guru
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-20 15:53 UTC by amethyst623
Modified: 2015-02-19 17:25 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.32.16
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description amethyst623 2012-05-20 15:53:57 UTC
xfs filesystem from linux kernel 2.6.32.16.

one of our application does the recording work. 
each time, it writes 128K data to USB hard disk(xfs format) using fwrite. 
while recording, the USB HDD is unpluged suddenly.
usually, fwrite returns immediately, but sometimes, fwrite function returns
after 3-10 seconds. we don't know why?


[ 2232.815000] lost page write due to I/O error on sdb1
[ 2232.817000] Buffer I/O error on device sdb1, logical block 305866
[ 2232.821000] lost page write due to I/O error on sdb1
[ 2232.823000] Buffer I/O error on device sdb1, logical block 305867
[ 2232.828000] lost page write due to I/O error on sdb1
[ 2232.832000] Buffer I/O error on device sdb1, logical block 305868
[ 2232.834000] lost page write due to I/O error on sdb1------->blocked here

[ 2242.030000] Filesystem "sda1": xfs_log_force: error 5 returned.
[ 2249.582000] end_request: I/O error, dev sdb, sector 488596419
[ 2249.583000] I/O error in filesystem ("sdb1") meta-data dev sdb1 block
0x1d1f6384       ("xlog_iodone") error 5 buf count 4096
[ 2249.584000] xfs_force_shutdown(sdb1,0x2) called from line 1043 of file
fs/xfs/xfs_log.c.  Return address = 0xc161c228

more info:
[  340.431000] INFO: task khubd:196 blocked for more than 1 seconds.
[  340.432000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
message.
[  340.433000] Pid : 196, Comm:                khubd
[  340.434000] PC  : 82202da0 SP  : 90061fa4 SR  : 40008000 
[  340.435000] Tainted: P          
[  340.436000] R0  : 00000000 R1  : 00000000 R2  : 00000000 R3  : 00000000
[  340.437000] R4  : 9001ff08 R5  : 8222da20 R6  : 00000000 R7  : 00000000
[  340.438000] R8  : 00000000 R9  : 00000000 R10 : 00000000 R11 : 00000000
[  340.439000] R12 : 00000000 R13 : 00000000 R14 : 00000000
[  340.440000] MACH: 00000000 MACL: 00000000 GBR : 00000000 PR  : 00000000
[  340.441000] khubd         D 8252ebbc     0   196      2 0x00000000
[  340.444000] Stack: (0x90061b74 to 0x90062000)
[  340.445000] 1b60:                                              90061b98
82639908 9001c45c 
[  340.453000] 1b80: 9001c420 8263954c 9028ac60 9001c3e0 8252eae2 00000000
9001c56c 00005362 
[  340.461000] 1ba0: 00000000 8252f036 90061bc4 9001c5ec 9001c5e8 fffe9498
ffffffff 8252e920 
[  340.468000] 1bc0: 10000000 9001c568 fffe60ae ffffffff 822961f6 90061bf0
00000002 828be978 
[  340.475000] 1be0: 8222e140 00000000 fffffffb 90061c2c 8252fa74 90061bf8
00000000 822961ec 
[  340.483000] 1c00: 90061c34 8252fb26 90061c24 000000bc 8252e848 9016009c
00000000 90061c98 
[  340.491000] 1c20: 00000000 00000002 822961ec 90061c98 00000000 00000000
9001c3e0 8222dee0 
[  340.498000] 1c40: 828be978 828be978 822962b6 90061c60 9016009c 000001e8
90061c70 8fb15800 
[  340.505000] 1c60: 00000000 00000000 7fffffff 00000000 9016013c 9016013c
00000000 00000000 
[  340.513000] 1c80: 00000000 00000001 7fffffff 8fb15800 00000001 00000000
00000003 00000000 
[  340.521000] 1ca0: 00000000 00000000 00000000 8229a54a 90061ccc 000000bc
8d3f223c 8fb15800 
[  340.528000] 1cc0: 00000001 8fb1587c 8fb15800 8229a632 90061ce8 8d3f223c
8fb15800 8fc02660 
[  340.535000] 1ce0: 8229a520 8fb15800 822a50d4 90061cf8 000001e8 8252e848
823a453e 90061d10 
[  340.543000] 1d00: 823a4520 8b3ac27c 8fc02660 00000000 822c2940 90061d20
8fb15c00 8d3f2180 
[  340.551000] 1d20: 8fb15c00 8d3f2180 00000000 00000003 82400b7a 90061d50
8252f000 8fb15328 
[  340.558000] 1d40: 8b3ac208 8b3ac27c 8264dd48 8fb152ac 823ec360 90061d68
823e8fd4 8264dd0c 
[  340.565000] 1d60: 8fb152ec 8fb152ac 823ec3dc 90061d7c 822c61e0 8fb152ac
8fb152e0 823ebf68 
[  340.573000] 1d80: 90061d8c 8fb152ec 8fb152ac 823e9c4c 90061da0 823e9ae0
8d3f2394 8fb152ac 
[  340.581000] 1da0: 823fe0ca 90061dbc 000000f0 823e8fd4 823f7b00 8fb152ac
8fb15200 823fcca0 
[  340.588000] 1dc0: 90061dd4 ffffff0f 823fe040 000001bc 8b05cc00 8fc3cdcc
823f41ee 90061df8 
[  340.595000] 1de0: 8243ad60 8d3f2618 00000000 8b05cc28 823f38e0 8b05cc00
82451772 90061e10 
[  340.603000] 1e00: 82211a20 8b05cc00 8b05cee4 8b05ce28 824518f6 90061e28
000000fc 826500e8 
[  340.611000] 1e20: 8b05c400 8b05ce28 8243d2ce 90061e34 8d3f2580 823ec360
90061e48 82650118 
[  340.618000] 1e40: 8d3f25dc 8d3f259c 823ec3dc 90061e5c 822c61e0 8d3f259c
8d3f25d0 823ebf68 
[  340.625000] 1e60: 90061e6c 8d3f25dc 8d3f259c 823e9c4c 90061e80 823e9ae0
8b05c464 8d3f259c 
[  340.633000] 1e80: 8243c29a 90061e9c 823e9ba0 000000fc 8d3f2580 00000001
8b05c400 82435d7a 
[  340.641000] 1ea0: 90061ebc 8b05c648 8b05c464 8b05c498 0000001f 9018fdcc
8b05c400 82436b34 
[  340.648000] 1ec0: 90061edc 901a0f1c 901a0ee0 901a0f20 9018fc00 00000001
00000000 82639908 
[  340.655000] 1ee0: 822123c8 822105ea 823ad180 90061f4c 901a0f70 9012c0dc
9012c0dc 9018ce00 
[  340.662000] 1f00: 00000001 00000100 82232360 00000100 9018fc98 00000000
901a0ee8 901a0f18 
[  340.670000] 1f20: 9018fc00 00000009 00000000 9018fdcc fffffffd 00000000
9001c3e0 8222dea0 
[  340.677000] 1f40: 90061f40 90061f40 00000501 01000001 00000000 8222da80
90061f74 00000000 
[  340.684000] 1f60: 00000000 00000000 824367c0 00000000 9001ff08 00000000
00000000 90061f7c 
[  340.691000] 1f80: 90061f7c 82202da8 90061f9c 00000000 00000000 00000000
00000000 00000000 
[  340.699000] 1fa0: 00000000 00000000 00000000 00000000 00000000 9001ff08
8222da20 00000000 
[  340.706000] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 
[  340.713000] 1fe0: 90061fa4 82202da0 00000000 40008000 00000000 00000000
00000000 00000000 
[  340.720000] 
[  340.720000] Call trace:
[  340.721000]  [<8252eae2>] schedule+0x1c2/0x580
[  340.722000]  [<8252f036>] preempt_schedule+0x36/0x60
[  340.723000]  [<8252e920>] schedule+0x0/0x580
[  340.724000]  [<822961f6>] bdi_sched_wait+0xa/0x34
[  340.725000]  [<8222e140>] prepare_to_wait+0x0/0xc0
[  340.726000]  [<8252fa74>] __wait_on_bit+0x74/0xe0
[  340.727000]  [<822961ec>] bdi_sched_wait+0x0/0x34
[  340.728000]  [<8252fb26>] out_of_line_wait_on_bit+0x46/0x80
[  340.729000]  [<8252e848>] printk+0x0/0x30
[  340.730000]  [<822961ec>] bdi_sched_wait+0x0/0x34
[  340.731000]  [<8222dee0>] wake_bit_function+0x0/0x60
[  340.732000]  [<822962b6>] sync_inodes_sb+0x96/0x280
[  340.733000]  [<8229a54a>] __sync_filesystem+0x2a/0xc0
[  340.734000]  [<8229a632>] sync_filesystem+0x52/0x80
[  340.735000]  [<8229a520>] __sync_filesystem+0x0/0xc0
[  340.736000]  [<822a50d4>] fsync_bdev+0x74/0xc0
[  340.737000]  [<8252e848>] printk+0x0/0x30
[  340.738000]  [<823a453e>] invalidate_partition+0x1e/0x60
[  340.739000]  [<823a4520>] invalidate_partition+0x0/0x60
[  340.740000]  [<822c2940>] del_gendisk+0x40/0x140
[  340.741000]  [<82400b7a>] sd_remove+0x3a/0xa0
[  340.742000]  [<8252f000>] preempt_schedule+0x0/0x60
[  340.743000]  [<823ec360>] __device_release_driver+0x40/0xa0
[  340.744000]  [<823e8fd4>] put_device+0x0/0x1c
[  340.745000]  [<823ec3dc>] device_release_driver+0x1c/0x40
[  340.746000]  [<822c61e0>] sysfs_remove_link+0x0/0x40
[  340.747000]  [<823ebf68>] bus_remove_device+0x48/0xa0
[  340.748000]  [<823e9c4c>] device_del+0xac/0x160
[  340.749000]  [<823e9ae0>] device_remove_file+0x0/0x20
[  340.750000]  [<823fe0ca>] __scsi_remove_device+0x8a/0xc0
[  340.751000]  [<823e8fd4>] put_device+0x0/0x1c
[  340.752000]  [<823f7b00>] scsi_device_set_state+0x0/0xe0
[  340.753000]  [<823fcca0>] scsi_forget_host+0x80/0x100
[  340.754000]  [<823fe040>] __scsi_remove_device+0x0/0xc0
[  340.755000]  [<823f41ee>] scsi_remove_host+0x6e/0x1c0
[  340.757000]  [<8243ad60>] remove_intf_ep_devs+0x0/0x80
[  340.758000]  [<823f38e0>] scsi_host_set_state+0x0/0xa0
[  340.759000]  [<82451772>] quiesce_and_remove_host+0x92/0x140
[  340.760000]  [<82211a20>] __wake_up+0x0/0x80
[  340.761000]  [<824518f6>] usb_stor_disconnect+0x16/0x40
[  340.762000]  [<8243d2ce>] usb_unbind_interface+0x2e/0x100
[  340.763000]  [<823ec360>] __device_release_driver+0x40/0xa0
[  340.764000]  [<823ec3dc>] device_release_driver+0x1c/0x40
[  340.765000]  [<822c61e0>] sysfs_remove_link+0x0/0x40
[  340.766000]  [<823ebf68>] bus_remove_device+0x48/0xa0
[  340.767000]  [<823e9c4c>] device_del+0xac/0x160
[  340.768000]  [<823e9ae0>] device_remove_file+0x0/0x20
[  340.769000]  [<8243c29a>] usb_disable_device+0x9a/0x140
[  340.770000]  [<823e9ba0>] device_del+0x0/0x160
[  340.771000]  [<82435d7a>] usb_disconnect+0x9a/0x160
[  340.772000]  [<82436b34>] hub_thread+0x374/0xf00
[  340.773000]  [<822123c8>] put_prev_task_fair+0xa8/0xe0
[  340.774000]  [<822105ea>] pick_next_task_fair+0x6a/0xc0
[  340.775000]  [<823ad180>] find_next_zero_bit+0x0/0xa0
[  340.776000]  [<82232360>] up+0x0/0xa0
[  340.777000]  [<8222dea0>] autoremove_wake_function+0x0/0x40
[  340.778000]  [<8222da80>] kthread+0x60/0x80
[  340.780000]  [<824367c0>] hub_thread+0x0/0xf00
[  340.781000]  [<82202da8>] kernel_thread_helper+0x8/0x20
[  340.782000]  [<8222da20>] kthread+0x0/0x80
[  340.783000]  [<82202da0>] kernel_thread_helper+0x0/0x20
[  340.784000] 
[  340.785000] INFO: task flush-8:0:2017 blocked for more than 1 seconds.
[  340.786000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
message.
[  340.787000] Pid : 2017, Comm:            flush-8:0
[  340.788000] PC  : 82202da0 SP  : 8f315fa4 SR  : 40008000 
[  340.789000] Tainted: P          
[  340.790000] R0  : 00000000 R1  : 00000000 R2  : 00000000 R3  : 00000000
[  340.791000] R4  : 90065edc R5  : 8222da20 R6  : 00000000 R7  : 00000000
[  340.792000] R8  : 00000000 R9  : 00000000 R10 : 00000000 R11 : 00000000
[  340.793000] R12 : 00000000 R13 : 00000000 R14 : 00000000
[  340.794000] MACH: 00000000 MACL: 00000000 GBR : 00000000 PR  : 00000000
[  340.795000] flush-8:0     D 8252ebbc     0  2017      2 0x00000000
[  340.798000] Stack: (0x8f315d24 to 0x8f316000)
[  340.799000] 5d20:          8f315d48 82639908 87baec5c 87baec20 8263954c
9028ac60 87baebe0 
[  340.806000] 5d40: 8252eae2 00000000 00376331 00008d87 00000000 87baed6c
00014684 87baedec 
[  340.813000] 5d60: 87baede8 ffff4ebe ffffffff 8268baa8 00000042 87baed68
ffff356b ffffffff 
[  340.820000] 5d80: 8252f700 8f315da0 8252f5e0 00000000 00000002 8f315de0
ffffffff 8ff800c4 
[  340.828000] 5da0: 7fffffff 00000034 3320205b 312e3933 30303733 00205d30
00000000 8ff80674 
[  340.835000] 5dc0: 8252f27e 8f315dd8 00000002 8f315de0 ffffffff 8ff800c4
8224c4f2 00000000 
[  340.842000] 5de0: 00000001 87baebe0 82211c5c 8ff800c8 8ff800c8 8252f40e
8f315e14 8ff801f4 
[  340.849000] 5e00: 8ff801d4 000001e8 00000000 8252e848 8ff80040 8238ed2c
8f315e1c ffffffff 
[  340.857000] 5e20: 82295f1c 8f315e38 00000000 8f315ea8 00000000 8ff80158
00000001 82296a70 
[  340.864000] 5e40: 8f315e5c 8ff80158 8f315ea8 9016011c 8fb15800 8f315e48
901600fc 82639908 
[  340.871000] 5e60: 00000000 87baec20 8ff801d4 000098b5 00000000 8f315e84
82296740 8ff80160 
[  340.878000] 5e80: 8fd813a0 00000000 82296cee 8f315ea8 822967c0 00000000
00000400 901600fc 
[  340.886000] 5ea0: 8f315f0c 8f315ea8 9016009c 8fb15800 00000001 00000000
000003ff 00000000 
[  340.893000] 5ec0: 00000000 00000000 ffffffff 7fffffff 00000000 8f315ee8
8263aa28 8263aa20 
[  340.900000] 5ee0: 822970a4 8f315f00 00000000 9016013c 00000000 901600fc
8f315f0c 90061c70 
[  340.907000] 5f00: 00000000 90160108 90160118 7fffffff 8fb15800 00000001
00000000 822971f4 
[  340.915000] 5f20: 8f315f3c 8263aa20 82645764 82296fa0 901600fc 8222da00
00001388 000098b2 
[  340.922000] 5f40: 8225ee1a 8f315f60 00000000 00000000 901600fc 8225eda0
901600fc 9016009c 
[  340.929000] 5f60: 8222da80 8f315f74 8225eda0 00000000 90065edc 00000000
00000000 8f315f7c 
[  340.936000] 5f80: 8f315f7c 82202da8 8f315f9c 00000000 00000000 00000000
00000000 00000000 
[  340.944000] 5fa0: 00000000 00000000 00000000 00000000 00000000 90065edc
8222da20 00000000 
[  340.952000] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 
[  340.959000] 5fe0: 8f315fa4 82202da0 00000000 40008000 00000000 00000000
00000000 00000000 
[  340.966000] 
[  340.966000] Call trace:
[  340.967000]  [<8252eae2>] schedule+0x1c2/0x580
[  340.968000]  [<8252f700>] schedule_timeout+0x120/0x1c0
[  340.969000]  [<8252f5e0>] schedule_timeout+0x0/0x1c0
[  340.970000]  [<8252f27e>] wait_for_common+0x9e/0x180
[  340.971000]  [<8224c4f2>] filemap_fdatawait+0x52/0xa0
[  340.972000]  [<82211c5c>] default_wake_function+0x0/0x18
[  340.973000]  [<8252f40e>] wait_for_completion+0xe/0x20
[  340.974000]  [<8252e848>] printk+0x0/0x30
[  340.975000]  [<8238ed2c>] xfs_fs_write_inode+0x18c/0x200
[  340.977000]  [<82295f1c>] writeback_single_inode+0x23c/0x2c0
[  340.978000]  [<82296a70>] writeback_inodes_wb+0x2b0/0x460
[  340.979000]  [<82296740>] unpin_sb_for_writeback+0x0/0x40
[  340.980000]  [<82296cee>] wb_writeback+0xce/0x1a0
[  340.981000]  [<822967c0>] writeback_inodes_wb+0x0/0x460
[  340.982000]  [<822970a4>] wb_do_writeback+0x104/0x220
[  340.983000]  [<822971f4>] bdi_writeback_task+0x34/0xe0
[  340.984000]  [<82296fa0>] wb_do_writeback+0x0/0x220
[  340.985000]  [<8222da00>] kthread_should_stop+0x0/0x20
[  340.986000]  [<8225ee1a>] bdi_start_fn+0x7a/0x120
[  340.987000]  [<8225eda0>] bdi_start_fn+0x0/0x120
[  340.988000]  [<8222da80>] kthread+0x60/0x80
[  340.989000]  [<8225eda0>] bdi_start_fn+0x0/0x120
[  340.990000]  [<82202da8>] kernel_thread_helper+0x8/0x20
[  340.991000]  [<8222da20>] kthread+0x0/0x80
[  340.992000]  [<82202da0>] kernel_thread_helper+0x0/0x20
[  340.994000] 
[  342.026000] INFO: task khubd:196 blocked for more than 1 seconds.
[  342.027000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
message.
[  342.028000] Pid : 196, Comm:                khubd
[  342.029000] PC  : 82202da0 SP  : 90061fa4 SR  : 40008000 
[  342.030000] Tainted: P          
[  342.031000] R0  : 00000000 R1  : 00000000 R2  : 00000000 R3  : 00000000
[  342.032000] R4  : 9001ff08 R5  : 8222da20 R6  : 00000000 R7  : 00000000
[  342.033000] R8  : 00000000 R9  : 00000000 R10 : 00000000 R11 : 00000000
[  342.034000] R12 : 00000000 R13 : 00000000 R14 : 00000000
[  342.035000] MACH: 00000000 MACL: 00000000 GBR : 00000000 PR  : 00000000
[  342.036000] khubd         D 8252ebbc     0   196      2 0x00000000
[  342.039000] Stack: (0x90061b74 to 0x90062000)
[  342.040000] 1b60:                                              90061b98
82639908 9001c45c 
[  342.048000] 1b80: 9001c420 8263954c 9028ac60 9001c3e0 8252eae2 00000000
9001c56c 00005362 
[  342.055000] 1ba0: 00000000 8252f036 90061bc4 9001c5ec 9001c5e8 fffe9498
ffffffff 8252e920 
[  342.062000] 1bc0: 10000000 9001c568 fffe60ae ffffffff 822961f6 90061bf0
00000002 828be978 
[  342.070000] 1be0: 8222e140 00000000 fffffffb 90061c2c 8252fa74 90061bf8
00000000 822961ec 
[  342.078000] 1c00: 90061c34 8252fb26 90061c24 000000bc 8252e848 9016009c
00000000 90061c98 
[  342.085000] 1c20: 00000000 00000002 822961ec 90061c98 00000000 00000000
9001c3e0 8222dee0 
[  342.092000] 1c40: 828be978 828be978 822962b6 90061c60 9016009c 000001e8
90061c70 8fb15800 
[  342.100000] 1c60: 00000000 00000000 7fffffff 00000000 9016013c 9016013c
00000000 00000000 
[  342.108000] 1c80: 00000000 00000001 7fffffff 8fb15800 00000001 00000000
00000003 00000000 
[  342.115000] 1ca0: 00000000 00000000 00000000 8229a54a 90061ccc 000000bc
8d3f223c 8fb15800 
[  342.122000] 1cc0: 00000001 8fb1587c 8fb15800 8229a632 90061ce8 8d3f223c
8fb15800 8fc02660 
[  342.130000] 1ce0: 8229a520 8fb15800 822a50d4 90061cf8 000001e8 8252e848
823a453e 90061d10 
[  342.138000] 1d00: 823a4520 8b3ac27c 8fc02660 00000000 822c2940 90061d20
8fb15c00 8d3f2180 
[  342.145000] 1d20: 8fb15c00 8d3f2180 00000000 00000003 82400b7a 90061d50
8252f000 8fb15328 
[  342.152000] 1d40: 8b3ac208 8b3ac27c 8264dd48 8fb152ac 823ec360 90061d68
823e8fd4 8264dd0c 
[  342.160000] 1d60: 8fb152ec 8fb152ac 823ec3dc 90061d7c 822c61e0 8fb152ac
8fb152e0 823ebf68 
[  342.168000] 1d80: 90061d8c 8fb152ec 8fb152ac 823e9c4c 90061da0 823e9ae0
8d3f2394 8fb152ac 
[  342.175000] 1da0: 823fe0ca 90061dbc 000000f0 823e8fd4 823f7b00 8fb152ac
8fb15200 823fcca0 
[  342.182000] 1dc0: 90061dd4 ffffff0f 823fe040 000001bc 8b05cc00 8fc3cdcc
823f41ee 90061df8 
[  342.190000] 1de0: 8243ad60 8d3f2618 00000000 8b05cc28 823f38e0 8b05cc00
82451772 90061e10 
[  342.198000] 1e00: 82211a20 8b05cc00 8b05cee4 8b05ce28 824518f6 90061e28
000000fc 826500e8 
[  342.205000] 1e20: 8b05c400 8b05ce28 8243d2ce 90061e34 8d3f2580 823ec360
90061e48 82650118 
[  342.212000] 1e40: 8d3f25dc 8d3f259c 823ec3dc 90061e5c 822c61e0 8d3f259c
8d3f25d0 823ebf68 
[  342.220000] 1e60: 90061e6c 8d3f25dc 8d3f259c 823e9c4c 90061e80 823e9ae0
8b05c464 8d3f259c 
[  342.228000] 1e80: 8243c29a 90061e9c 823e9ba0 000000fc 8d3f2580 00000001
8b05c400 82435d7a 
[  342.235000] 1ea0: 90061ebc 8b05c648 8b05c464 8b05c498 0000001f 9018fdcc
8b05c400 82436b34 
[  342.242000] 1ec0: 90061edc 901a0f1c 901a0ee0 901a0f20 9018fc00 00000001
00000000 82639908 
[  342.250000] 1ee0: 822123c8 822105ea 823ad180 90061f4c 901a0f70 9012c0dc
9012c0dc 9018ce00 
[  342.258000] 1f00: 00000001 00000100 82232360 00000100 9018fc98 00000000
901a0ee8 901a0f18 
[  342.265000] 1f20: 9018fc00 00000009 00000000 9018fdcc fffffffd 00000000
9001c3e0 8222dea0 
[  342.272000] 1f40: 90061f40 90061f40 00000501 01000001 00000000 8222da80
90061f74 00000000 
[  342.280000] 1f60: 00000000 00000000 824367c0 00000000 9001ff08 00000000
00000000 90061f7c 
[  342.288000] 1f80: 90061f7c 82202da8 90061f9c 00000000 00000000 00000000
00000000 00000000 
[  342.295000] 1fa0: 00000000 00000000 00000000 00000000 00000000 9001ff08
8222da20 00000000 
[  342.302000] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 
[  342.310000] 1fe0: 90061fa4 82202da0 00000000 40008000 00000000 00000000
00000000 00000000 
[  342.318000] 
[  342.318000] Call trace:
[  342.319000]  [<8252eae2>] schedule+0x1c2/0x580
[  342.320000]  [<8252f036>] preempt_schedule+0x36/0x60
[  342.321000]  [<8252e920>] schedule+0x0/0x580
[  342.322000]  [<822961f6>] bdi_sched_wait+0xa/0x34
[  342.323000]  [<8222e140>] prepare_to_wait+0x0/0xc0
[  342.324000]  [<8252fa74>] __wait_on_bit+0x74/0xe0
[  342.325000]  [<822961ec>] bdi_sched_wait+0x0/0x34
[  342.326000]  [<8252fb26>] out_of_line_wait_on_bit+0x46/0x80
[  342.327000]  [<8252e848>] printk+0x0/0x30
[  342.328000]  [<822961ec>] bdi_sched_wait+0x0/0x34
[  342.329000]  [<8222dee0>] wake_bit_function+0x0/0x60
[  342.330000]  [<822962b6>] sync_inodes_sb+0x96/0x280
[  342.331000]  [<8229a54a>] __sync_filesystem+0x2a/0xc0
[  342.332000]  [<8229a632>] sync_filesystem+0x52/0x80
[  342.333000]  [<8229a520>] __sync_filesystem+0x0/0xc0
[  342.334000]  [<822a50d4>] fsync_bdev+0x74/0xc0
[  342.335000]  [<8252e848>] printk+0x0/0x30
[  342.336000]  [<823a453e>] invalidate_partition+0x1e/0x60
[  342.337000]  [<823a4520>] invalidate_partition+0x0/0x60
[  342.338000]  [<822c2940>] del_gendisk+0x40/0x140
[  342.339000]  [<82400b7a>] sd_remove+0x3a/0xa0
[  342.340000]  [<8252f000>] preempt_schedule+0x0/0x60
[  342.341000]  [<823ec360>] __device_release_driver+0x40/0xa0
[  342.342000]  [<823e8fd4>] put_device+0x0/0x1c
[  342.343000]  [<823ec3dc>] device_release_driver+0x1c/0x40
[  342.344000]  [<822c61e0>] sysfs_remove_link+0x0/0x40
[  342.345000]  [<823ebf68>] bus_remove_device+0x48/0xa0
[  342.346000]  [<823e9c4c>] device_del+0xac/0x160
[  342.347000]  [<823e9ae0>] device_remove_file+0x0/0x20
[  342.348000]  [<823fe0ca>] __scsi_remove_device+0x8a/0xc0
[  342.349000]  [<823e8fd4>] put_device+0x0/0x1c
[  342.350000]  [<823f7b00>] scsi_device_set_state+0x0/0xe0
[  342.352000]  [<823fcca0>] scsi_forget_host+0x80/0x100
[  342.353000]  [<823fe040>] __scsi_remove_device+0x0/0xc0
[  342.354000]  [<823f41ee>] scsi_remove_host+0x6e/0x1c0
[  342.355000]  [<8243ad60>] remove_intf_ep_devs+0x0/0x80
[  342.356000]  [<823f38e0>] scsi_host_set_state+0x0/0xa0
[  342.357000]  [<82451772>] quiesce_and_remove_host+0x92/0x140
[  342.358000]  [<82211a20>] __wake_up+0x0/0x80
[  342.359000]  [<824518f6>] usb_stor_disconnect+0x16/0x40
[  342.360000]  [<8243d2ce>] usb_unbind_interface+0x2e/0x100
[  342.362000]  [<823ec360>] __device_release_driver+0x40/0xa0
[  342.363000]  [<823ec3dc>] device_release_driver+0x1c/0x40
[  342.364000]  [<822c61e0>] sysfs_remove_link+0x0/0x40
[  342.365000]  [<823ebf68>] bus_remove_device+0x48/0xa0
[  342.366000]  [<823e9c4c>] device_del+0xac/0x160
[  342.367000]  [<823e9ae0>] device_remove_file+0x0/0x20
[  342.368000]  [<8243c29a>] usb_disable_device+0x9a/0x140
[  342.369000]  [<823e9ba0>] device_del+0x0/0x160
[  342.370000]  [<82435d7a>] usb_disconnect+0x9a/0x160
[  342.371000]  [<82436b34>] hub_thread+0x374/0xf00
[  342.372000]  [<822123c8>] put_prev_task_fair+0xa8/0xe0
[  342.373000]  [<822105ea>] pick_next_task_fair+0x6a/0xc0
[  342.374000]  [<823ad180>] find_next_zero_bit+0x0/0xa0
[  342.375000]  [<82232360>] up+0x0/0xa0
[  342.376000]  [<8222dea0>] autoremove_wake_function+0x0/0x40
[  342.377000]  [<8222da80>] kthread+0x60/0x80
[  342.378000]  [<824367c0>] hub_thread+0x0/0xf00
[  342.379000]  [<82202da8>] kernel_thread_helper+0x8/0x20
[  342.380000]  [<8222da20>] kthread+0x0/0x80
[  342.382000]  [<82202da0>] kernel_thread_helper+0x0/0x20
[  342.383000] 
[  342.384000] INFO: task vplayer:1367 blocked for more than 1 seconds.
[  342.385000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
message.
[  342.386000] Pid : 1367, Comm:              vplayer
[  342.387000] PC  : 299ce136 SP  : 7bc158cc SR  : 00008001 
[  342.388000] Tainted: P          
[  342.389000] R0  : 00000000 R1  : 2956df6c R2  : 00000000 R3  : 00000004
[  342.390000] R4  : 00000020 R5  : 01019bf0 R6  : 00000010 R7  : 00000000
[  342.391000] R8  : 00000010 R9  : 01019ba8 R10 : 01019bf0 R11 : 00000010
[  342.393000] R12 : 29a24304 R13 : fffa9ddc R14 : 00000000
[  342.394000] MACH: 00000000 MACL: 00000000 GBR : 2955f828 PR  : 299a11f2
[  342.395000] vplayer       D 8252ebbc     0  1367      1 0x00000000
[  342.398000] Stack: (0x8e9cfcf4 to 0x8e9d0000)
[  342.399000] fce0:                                              8e9cfd18
82639908 9028acdc 
[  342.406000] fd00: 9028aca0 8263954c 82637460 9028ac60 8252ecd6 2955f828
8e9cfd24 8268fb5c 
[  342.413000] fd20: 00000000 10000000 82217830 9028ae6c 9028ae68 fffe6398
ffffffff 3320205b 
[  342.421000] fd40: 352e3933 9028ade8 fffe28ad ffffffff 825311c6 8e9cfd70
000000f0 8252e920 
[  342.429000] fd60: 00000002 ffffff0f 8e9cfd70 9028ac60 8ff800a8 8ff800a8
9028ac60 00000002 
[  342.436000] fd80: 82531270 8e9cfda0 00000001 00000001 8ff801f4 8ff80080
825d0708 00000005 
[  342.443000] fda0: 8253058a 8e9cfda8 8235a280 8e9cfdb0 8238dd9a 8e9cfdc4
8ff80040 825d0708 
[  342.451000] fdc0: 8e9cfe0c 82639a40 8252e920 10000000 82217830 00000005
8e9cfea0 00000000 
[  342.459000] fde0: 8e9cfe2f 8268baa8 00000000 8268fb48 0000000f 00000000
3320205b 8ff801c6 
[  342.466000] fe00: 9002c520 00000000 8b05c800 00000001 00000000 8ff80158
8ff80040 8e9cff24 
[  342.473000] fe20: 3320205b 352e3933 30303734 00000153 00000000 8252e866
00000060 00000000 
[  342.481000] fe40: 00000010 00000010 00000001 8238938a 8e9cfe6c 9002c520
00000060 00000000 
[  342.489000] fe60: 8e9cff24 00000001 8e9cfea0 8e9cfee8 00000001 82276ae6
8e9cfe94 8e9cfea0 
[  342.496000] fe80: 01019bf0 8e9cfee0 000001e8 825d0708 00000060 00000000
9002c520 8e9cff78 
[  342.503000] fea0: 00000036 82639a40 00000000 00000001 ffffffff 9002c520
00000000 00000000 
[  342.511000] fec0: 00000000 00000000 9028ac60 00000000 00000000 00000034
9028ac60 8222dea0 
[  342.519000] fee0: 8e9cfee0 8e9cfee0 00000060 00000000 8268fb48 0000000f
00000034 3320205b 
[  342.526000] ff00: 00000010 30303434 00205d30 00000153 00000000 8252e866
8e9cff34 01019bf0 
[  342.533000] ff20: 825d0708 01019bf0 00000010 82277346 8e9cff4c 01019bf0
825d0708 01019bf0 
[  342.541000] ff40: 8e9cff78 9002c520 00000010 fffffff7 8e9cff44 82277608
8e9cff70 00000020 
[  342.549000] ff60: 825d0708 fffffff7 8e9cff44 9002c520 9002c520 00000010
00000060 00000000 
[  342.556000] ff80: 00000001 82208920 00000000 fffa9ddc 00000594 00000000
00000071 00000100 
[  342.563000] ffa0: 822775a0 00000000 2956df6c 00000000 00000004 00000020
01019bf0 00000010 
[  342.571000] ffc0: 00000000 00000010 01019ba8 01019bf0 00000010 29a24304
fffa9ddc 00000000 
[  342.579000] ffe0: 7bc158cc 299ce136 299a11f2 00008001 2955f828 00000000
00000000 0000004c 
[  342.586000] 
[  342.586000] Call trace:
[  342.587000]  [<8252ecd6>] schedule+0x3b6/0x580
[  342.588000]  [<82217830>] vprintk+0x330/0x380
[  342.589000]  [<825311c6>] __down_write_nested+0xc6/0x164
[  342.590000]  [<8252e920>] schedule+0x0/0x580
[  342.591000]  [<82531270>] __down_write+0xc/0x1c
[  342.592000]  [<8253058a>] down_write+0xa/0x18
[  342.593000]  [<8235a280>] xfs_ilock+0x100/0x1a0
[  342.594000]  [<8238dd9a>] xfs_write+0x29a/0xb60
[  342.595000]  [<8252e920>] schedule+0x0/0x580
[  342.596000]  [<82217830>] vprintk+0x330/0x380
[  342.597000]  [<8252e866>] printk+0x1e/0x30
[  342.598000]  [<8238938a>] xfs_file_aio_write+0x6a/0xa0
[  342.599000]  [<82276ae6>] do_sync_write+0x106/0x320
[  342.600000]  [<8222dea0>] autoremove_wake_function+0x0/0x40
[  342.601000]  [<8252e866>] printk+0x1e/0x30
[  342.602000]  [<82277346>] vfs_write+0xa6/0x180
[  342.603000]  [<82277608>] sys_write+0x68/0x120
[  342.604000]  [<82208920>] syscall_call+0xa/0xe
[  342.605000]  [<822775a0>] sys_write+0x0/0x120

xfs guys told me that:
You disk has been disconnected (unplugged?) and the USB error handling has
tried to sync the device that just disappeared. That's a bug in the USB or SCSI
error handling layers, not a filesystem problem.you should ask the USB/SCSI people about that.
Comment 1 Alan Stern 2012-05-21 17:53:30 UTC
What are the xfs guys smoking?  The log clearly shows what's happening.  Here's the interesting part:

[  340.736000]  [<822a50d4>] fsync_bdev+0x74/0xc0
[  340.737000]  [<8252e848>] printk+0x0/0x30
[  340.738000]  [<823a453e>] invalidate_partition+0x1e/0x60
[  340.739000]  [<823a4520>] invalidate_partition+0x0/0x60
[  340.740000]  [<822c2940>] del_gendisk+0x40/0x140

There's no USB error handling in there.  Instead, the disk gets disconnected, the partition is invalidated, and the invalidate_partition() routine calls fsync_bdev().  That's in the block layer, not in SCSI or USB.
Comment 2 amethyst623 2012-05-22 00:39:48 UTC
what's your suggestion? 

how can I avoid the long time waiting before fwrite(or write) return?

thanks.
Comment 3 Dave Chinner 2012-05-23 01:28:22 UTC
(In reply to comment #1)
> What are the xfs guys smoking? The log clearly shows what's happening. 
> Here's
> the interesting part:
> 
> [  340.736000]  [<822a50d4>] fsync_bdev+0x74/0xc0
> [  340.737000]  [<8252e848>] printk+0x0/0x30
> [  340.738000]  [<823a453e>] invalidate_partition+0x1e/0x60
> [  340.739000]  [<823a4520>] invalidate_partition+0x0/0x60
> [  340.740000]  [<822c2940>] del_gendisk+0x40/0x140
> 
> There's no USB error handling in there.  Instead, the disk gets disconnected,
> the partition is invalidated, and the invalidate_partition() routine calls
> fsync_bdev().  That's in the block layer, not in SCSI or USB.

Alan (Stern), don't get you knickers in a knot because someone completely unfamiliar with USB/SCSI error handling paths mischaracterised a massive stack trace full of USB and SCSI functions leading up erroneously into the filesystem sync code.

However, given you comment, I'd love to know why Alan (Cox) went and characterised this as a filesystem/XFS bug. I can't reassign it to the block layer because normal bugzilla users can't change the product field.

FWIW, seeing as the person who raised this bug is now playing bugzilla bingo, here's the original XFS bz where this was raised back in january: 

http://oss.sgi.com/bugzilla/show_bug.cgi?id=916
Comment 4 Alan Stern 2012-05-23 01:52:37 UTC
I didn't mean to give the impression that I was particularly annoyed about anything.  And in fact, I was surprised too to see Alan's reassignment.  I would have expected it to be assigned to the block layer people.  Maybe he'll do that after reading these two comments.
Comment 5 Alan 2012-05-23 23:05:58 UTC
I am not a perfect genius and master of all thing everywhere kernel.  I'm just trying to clean up the bugzilla a bit and deal with stuff assigned as other/other etc.

So this should go Axboe's way ?

Alan
Comment 6 Alan Stern 2012-05-24 14:54:52 UTC
It would be a good idea at least to draw his attention to this bug report.  He might be able to help even if it turns out not to lie entirely within his bailiwick.

Note You need to log in before you can comment on or make changes to this bug.