Red Hat Bugzilla – Bug 524039
block device cannot be detached from DomU
Last modified: 2011-06-27 10:23:42 EDT
Description of problem:
On a PV DomU with 2.6.31-12.fc12.x86_64 detaching a block device fails, dumping a backtrace to the console.
Steps to Reproduce:
dd if=/dev/zero of=/var/lib/xen/images/disk1.dsk bs=1 count=1 seek=10G
virsh attach-disk rawhide --driver file /var/lib/xen/images/disk1.dsk xvdb
Attach will complete successfully and from DomU the new device can be seen and used without any problem.
virsh detach-disk rawhide xvdb
Detach appears to complete successfully from Dom0, but a stack backtrace is dumped to DomU's console and the device is only partially removed.
Device is completely removed without failure.
general protection fault: 0000 [#1] SMP
last sysfs file: /sys/devices/vbd-51728/block/xvdb/size
Modules linked in: nfsd lockd nfs_acl auth_rpcgss exportfs sunrpc ip6t_REJECT nf_conntrack_ipv6 ip6table_filter ip6_tables ipv6 dm_multipath uinput joydev xen_netfront xen_blkfront [last unloaded: microcode]
Pid: 11, comm: xenwatch Tainted: G W 2.6.31-12.fc12.x86_64 #1
RIP: e030:[<ffffffff812136eb>] [<ffffffff812136eb>] debugfs_remove+0x27/0x90
RSP: e02b:ffff88007d461bf0 EFLAGS: 00010202
RAX: 0000000000000000 RBX: ffff8800041fb850 RCX: 00000000001a0006
RDX: 0000000000000000 RSI: ffffea000321bfa8 RDI: 6b6b6b6b6b6b6b6b
RBP: ffff88007d461c10 R08: 0000000000000000 R09: 00000000e027cfb5
R10: ffffffff81678e0f R11: 0000000000000000 R12: 6b6b6b6b6b6b6b6b
R13: ffff88007d461c80 R14: ffff8800798d5520 R15: ffffffffa0005048
FS: 00007f9f6266e7c0(0000) GS:ffffc90000000000(0000) knlGS:0000000000000000
CS: e033 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f97099ac000 CR3: 000000007b978000 CR4: 0000000000002620
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000000
Process xenwatch (pid: 11, threadinfo ffff88007d460000, task ffff88007d4524a0)
ffff88007d461c30 00000000e027cfb5 ffff8800041fb850 0000000000000000
<0> ffff88007d461c40 ffffffff811126bf ffff88007d461c40 00000000e027cfb5
<0> ffff88007d461c70 ffff88007ad3c480 ffff88007d461c70 ffffffff8126ad2c
[<ffffffffa000134a>] blkfront_closing+0xad/0x105 [xen_blkfront]
[<ffffffffa00017ef>] backend_changed+0x44d/0x52e [xen_blkfront]
[<ffffffff8100ec42>] ? check_events+0x12/0x20
[<ffffffff8100ec2f>] ? xen_restore_fl_direct_end+0x0/0x1
[<ffffffff81081487>] ? autoremove_wake_function+0x0/0x5f
[<ffffffff8130e414>] ? xenwatch_thread+0x0/0x160
[<ffffffff81012a90>] ? restore_args+0x0/0x30
[<ffffffff81013120>] ? child_rip+0x0/0x20
Code: 41 5e c9 c3 55 48 89 e5 41 54 53 48 83 ec 10 0f 1f 44 00 00 65 48 8b 04 25 28 00 00 00 48 89 45 e8 31 c0 48 85 ff 49 89 fc 74 4e <48> 8b 5f 68 48 85 db 74 45 48 8b 7b 50 48 85 ff 74 3c 48 81 c7
RIP [<ffffffff812136eb>] debugfs_remove+0x27/0x90
---[ end trace a7919e7f17c0a729 ]---
This is still happening with 126.96.36.199-56.fc12.x86_64. The backtrace is
identical, but of course with different addresses. The new rip is
0xffffffff8121350b and the offending instruction is
0xffffffff8121350b <debugfs_remove+39>: mov 0x68(%rdi),%rbx
We see that rdi is corrupted, all 6b6b..
The offending code is in debugfs_remove(struct dentry *dentry)
and rdi is the input argument. The function is called from here
static void bdi_debug_unregister(struct backing_dev_info *bdi)
We know we're breaking on the first call, since the backtrace says we're at
bdi_unregister+0x36. So it is seems that the debugfs member(s) are corrupt.
After attaching the device I mounted the debugfs and looked at the stats file
# mount -t debugfs none /sys/kernel/debug/
# cd /sys/kernel/debug/bdi/202:16
# cat stats
BdiWriteback: 0 kB
BdiReclaimable: 0 kB
BdiDirtyThresh: 0 kB
DirtyThresh: 140240 kB
BackgroundThresh: 70120 kB
That looked fine, but still on detach the backtrace appears with the same
This problem is a recreatable regression, so it's probably bisectable, but I
think it would take a long time to do the compile-boot-recreate cycle, so
I'll start by looking at suspect patches put in since the previous working rev.
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.
More information and reason for this action is here:
This bug disappeared on it's own for a several kernel revs, but is now back with F13's 188.8.131.52-38.fc13.x86_64.
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '13'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 13's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 13 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.