On 2018/8/22 6:52 PM, shenghui wrote: > > Hi, > > I used sda6 as a backing device and had it attached to cache_set already. > > I first run detach and it worked. Then I tried to re-attach sda6 to the cache_set, but the command blocked. > ---------------------------------------- > /sys/block/sda/sda6/bcache# echo 1 > detach > /sys/block/sda/sda6/bcache# echo a514972f-3a2e-42b0-a0db-d99dcde607d9 > attach > [hung here, and ps showed state in 'D+'] > > > In dmesg, there is: > > [ 1209.534265] INFO: task bash:1575 blocked for more than 120 seconds. > [ 1209.534277] Not tainted 4.18.0+ #4 > [ 1209.534282] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > [ 1209.534289] bash D 0 1575 1574 0x00000004 > [ 1209.534300] Call Trace: > [ 1209.534319] __schedule+0x1f2/0x740 > [ 1209.534330] ? __switch_to_asm+0x33/0x4c > [ 1209.534339] schedule+0x27/0x70 > [ 1209.534347] rwsem_down_write_failed+0x135/0x2f0 > [ 1209.534357] call_rwsem_down_write_failed+0x9/0xc > [ 1209.534365] down_write+0x25/0x40 > [ 1209.534386] bch_cached_dev_attach+0x409/0x4f0 [bcache] > [ 1209.534403] ? bch_keybuf_init+0x70/0x70 [bcache] > [ 1209.534420] bch_cached_dev_store+0x76a/0x800 [bcache] > [ 1209.534438] ? bch_cache_set_internal_show+0x20/0x20 [bcache] > [ 1209.534447] sysfs_kf_write+0x35/0x50 > [ 1209.534455] ? sysfs_kf_bin_read+0xb0/0xb0 > [ 1209.534462] kernfs_fop_write+0xf1/0x180 > [ 1209.534470] ? kernfs_seq_start+0x90/0x90 > [ 1209.534480] __vfs_write+0x33/0x1a0 > [ 1209.534491] ? apparmor_file_permission+0x16/0x20 > [ 1209.534500] ? security_file_permission+0x2c/0xb0 > [ 1209.534508] ? rw_verify_area+0x5b/0x110 > [ 1209.534516] vfs_write+0x94/0x1c0 > [ 1209.534525] ksys_write+0x49/0xb0 > [ 1209.534533] sys_write+0x16/0x20 > [ 1209.534542] do_fast_syscall_32+0x7f/0x19c > [ 1209.534552] entry_SYSENTER_32+0x6b/0xbe > [ 1209.534559] EIP: 0xb7f38d11 > [ 1209.534570] Code: Bad RIP value. > [ 1209.534577] EAX: ffffffda EBX: 00000001 ECX: 00d602f0 EDX: 00000025 > [ 1209.534584] ESI: 00d602f0 EDI: 00000025 EBP: b7eead80 ESP: bfc5a290 > [ 1209.534591] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000246 Hi Shenghui, Could you please to try the patch just posted by Shan ? I think his fix addresses this issue. Thanks. Coly Li