From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Subject: Re: dom0 panic when using xm block-attach/block-detach -f Date: Wed, 13 Jan 2010 13:13:16 +0200 Message-ID: <20100113111316.GD25902@reaktio.net> References: <201001081209.25149.dietmar.hahn@ts.fujitsu.com> <201001131113.50257.dietmar.hahn@ts.fujitsu.com> <20100113103244.GB25902@reaktio.net> <201001131154.27549.dietmar.hahn@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <201001131154.27549.dietmar.hahn@ts.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dietmar Hahn Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Wed, Jan 13, 2010 at 11:54:27AM +0100, Dietmar Hahn wrote: > Am 13.01.2010 schrieb Pasi K=E4rkk=E4inen: > > On Wed, Jan 13, 2010 at 11:13:50AM +0100, Dietmar Hahn wrote: > > > Am 13.01.2010 schrieb Pasi K=E4rkk=E4inen: > > > > On Wed, Jan 13, 2010 at 10:23:17AM +0100, Dietmar Hahn wrote: > > > > > Hi list, > > > > >=20 > > > > > I tried to verify my problem with xen-4.0.0-rc1. > > > > > > > > >=20 > > > > What dom0 kernel did you use? What kernel did you use in the gues= t? > > >=20 > > > The pv_ops kernel downloaded during make world: > > > # uname -a > > > Linux chiana 2.6.31.6-xen-400rc1 #6 SMP Wed Jan 13 10:43:49 CET 201= 0 x86_64 x86_64 x86_64 GNU/Linux > > >=20 > > > I only added ext4 to the config because the Linux-partition is ext4= ;-) > > > > >=20 > > Ok.=20 > >=20 > > I'm not sure if block-attach to dom0 has ever been supported?=20 > > Did it work at some point for you?=20 > >=20 > > -- Pasi >=20 > As you can see in my first mail below this works in openSuse-11.2 with > xen-4.3 and linux-2.6.31.5. > Ok.. It shouldn't crash though, even if it doesn't work. Someone should investigate this more in depth.. Out of curiosity, why do you want to do that? :) kpartx is much more simple, and doesn't need Xen at all to do the same.. -- Pasi > Dietmar. >=20 > >=20 > > > Dietmar. > > >=20 > > > >=20 > > > > -- Pasi > > > >=20 > > > >=20 > > > > > I did again the block-attach: > > > > >=20 > > > > > # xm block-attach 0 tap:aio:my-image.iso xvda r > > > > >=20 > > > > > But now I don't get any devices /dev/xvda? > > > > > Now I'am a little bit confused! > > > > >=20 > > > > > # fdisk -l my-image.iso > > > > > You must set cylinders. > > > > > You can do this from the extra functions menu. > > > > >=20 > > > > > Disk my-image.iso: 0 MB, 0 bytes > > > > > 255 heads, 63 sectors/track, 0 cylinders > > > > > Units =3D cylinders of 16065 * 512 =3D 8225280 bytes > > > > > Disk identifier: 0x00044fcc > > > > >=20 > > > > > Device Boot Start End Blocks Id Sys= tem > > > > > my-image.iso1 1 17 136521 82 Lin= ux swap / Solaris > > > > > my-image.iso2 * 18 522 4056412+ 83 Lin= ux > > > > >=20 > > > > > Any help would be appreciated. > > > > > Thanks. > > > > >=20 > > > > > Dietmar. > > > > >=20 > > > > > Am 08.01.2010 schrieb Dietmar Hahn: > > > > > > Hi list, > > > > > >=20 > > > > > > I have an image with a bootable system and do the following s= teps: > > > > > > # xm block-attach 0 tap:aio:my-image.iso xvda r > > > > > > mount the root partition: > > > > > > # mount /dev/xvda2 /mnt > > > > > > Now forcing block-detach: > > > > > > # xm block-detach 0 51712 -f > > > > > >=20 > > > > > > This leads to an inconsistent sysfs in dom0. > > > > > > The xen device /sys/devices/xen/vbd-51712 gets removed but lo= ts of links remain. > > > > > >=20 > > > > > > In the log I can see the message: > > > > > > [ 349.928350] vbd vbd-51712: 16 Device in use; refusing to c= lose > > > > > >=20 > > > > > > The next call of > > > > > > # xm block-attach 0 tap:aio:my-image.iso xvda r > > > > > > leads to the panic, because creating of a sysfs entry failed > > > > > > (it's already there) and a not existing failure handling (ret= urn of > > > > > > register_disk() in add_disk()) leads to the panic later. > > > > > >=20 > > > > > > [ 210.184660] WARNING: at /usr/src/linux-2.6.31.5-0.1/fs/sys= fs/dir.c:489 sysfs_add_one+0xde/0x150() > > > > > > [ 210.184662] Hardware name: CELSIUS H270 > > > > > > [ 210.184663] sysfs: cannot create duplicate filename '/dev/= block/202:0' > > > > > > [ 210.184664] Modules linked in: ext4 jbd2 crc16 netbk blkbk= blkback_pagemap snd_pcm_oss snd_mixer_oss blktap snd_seq snd_seq_device = edd ipv6 af_packet bridge stp llc fuse loop dm_mod arc4 ecb cryptomgr aea= d pcompress snd_hda_codec_realtek crypto_blkcipher crypto_hash crypto_alg= api snd_hda_intel iwlagn snd_hda_codec iwlcore pcmcia snd_hwdep led_class= snd_pcm ppdev mac80211 snd_timer 8250_pci yenta_socket parport_pc 8250_p= np snd tpm_infineon rsrc_nonstatic i2c_i801 parport iTCO_wdt 8250 soundco= re cfg80211 intel_agp tpm e1000e video pcmcia_core i2c_core heci(C) iTCO_= vendor_support sr_mod sg pcspkr serio_raw joydev serial_core snd_page_all= oc rfkill agpgart tpm_bios output container battery button ac usbhid hid = uhci_hcd ehci_hcd xenblk cdrom xennet fan thermal processor thermal_sys h= wmon ide_pci_generic ide_core sata_sil24 ata_generic > > > > > > [ 210.184697] Pid: 15, comm: xenwatch Tainted: G C 2= .6.31.5-0.1-xen-hahn #9 > > > > > > [ 210.184698] Call Trace: > > > > > > [ 210.184701] [] try_stack_unwind+0x189/0= x1b0 > > > > > > [ 210.184704] [] dump_trace+0xa6/0x1e0 > > > > > > [ 210.184707] [] show_trace_log_lvl+0x64/= 0x90 > > > > > > [ 210.184710] [] show_trace+0x23/0x40 > > > > > > [ 210.184712] [] dump_stack+0x81/0x9e > > > > > > [ 210.184717] [] warn_slowpath_common+0x8= 0/0xd0 > > > > > > [ 210.184720] [] warn_slowpath_fmt+0x4b/0= x70 > > > > > > [ 210.184723] [] sysfs_add_one+0xde/0x150 > > > > > > [ 210.184726] [] sysfs_do_create_link+0x1= 7b/0x200 > > > > > > [ 210.184729] [] sysfs_create_link+0x21/0= x40 > > > > > > [ 210.184732] [] device_add+0x1d5/0x620 > > > > > > [ 210.184734] [] register_disk+0x66/0x1c0 > > > > > > [ 210.184737] [] add_disk+0xcb/0x1b0 > > > > > > [ 210.184742] [] backend_changed+0x354/0x= 3a0 [xenblk] > > > > > > [ 210.184746] [] otherend_changed+0xf2/0x= 1c0 > > > > > > [ 210.184749] [] xenwatch_handle_callback= +0x2c/0x80 > > > > > > [ 210.184752] [] xenwatch_thread+0x1c8/0x= 200 > > > > > > [ 210.184755] [] kthread+0xb6/0xc0 > > > > > > [ 210.184758] [] child_rip+0xa/0x20 > > > > > > [ 210.184760] ---[ end trace 2db54c629bf6d53c ]--- > > > > > > ... > > > > > >=20 > > > > > > The problem seems to be that in backend_changed() the device = is seen as in use > > > > > > and so blkfront_closing() -> xlvbd_del() -> del_gendisk() > > > > > > isn't called to remove the links but later the xen device get= s removed. > > > > > >=20 > > > > > > What to do here? > > > > > > If a user of the -f flag "SHOULD know what he is doing" than = the manual page > > > > > > of the xm command has to be changed. > > > > > > Ohterwise how can this be solved? > > > > > >=20 > > > > > > Thanks. > > > > > > Dietmar. > > > > > >=20 > > > > > > This was testet on OpenSuSE-11.2 with xen-3.4 and linux-2.6.3= 1.5, > > > > > > don't know about xen-unstable! > > > > > >=20 > > > > > >=20 > > > >=20 > > > >=20 > >=20 > >=20 > --=20 > Dietmar Hahn > TSP ES&S SWE OS Telephone: +49 (0) 89 32= 22-2952 > Fujitsu Technology Solutions Email: dietmar.hahn@ts.fuji= tsu.com > Domagkstra=DFe 28 Internet: http://ts.fu= jitsu.com > D-80807 M=FCnchen Company details:ts.fujitsu.com/imp= rint.html