> On 29. May 2022, at 08:30, Michael van Elst <mlelstv%serpens.de@localhost> wrote:
>
> bouyer%antioche.eu.org@localhost (Manuel Bouyer) writes:
>
>> Hello,
>> do you have an idea on the problem in this thread:
>> http://mail-index.netbsd.org/port-xen/2022/05/27/msg010213.html
> [...]
>> I can't reproduce this when using vnd from userland.
>
> You can replicate it by addressing the block device with vnconfig.
>
> A workaround would be to modify the Xen block script to select the
> raw device:
>
> vnconfig /dev/r${disk}d $xparams >/dev/null; then
>
> or just the disk name:
>
> vnconfig ${disk} $xparams >/dev/null; then
Good catch, sys/dev/vnd.c has this:
1751 static void
1752 vndclear(struct vnd_softc *vnd, int myminor)
1753 {
1754 struct vnode *vp = vnd->sc_vp;
1755 int fflags = FREAD;
1756 int bmaj, cmaj, i, mn;
1757 int s;
1758
1759 #ifdef DEBUG
1760 if (vnddebug & VDB_FOLLOW)
1761 printf("vndclear(%p): vp %p\n", vnd, vp);
1762 #endif
1763 /* locate the major number */
1764 bmaj = bdevsw_lookup_major(&vnd_bdevsw);
1765 cmaj = cdevsw_lookup_major(&vnd_cdevsw);
1766
1767 /* Nuke the vnodes for any open instances */
1768 for (i = 0; i < MAXPARTITIONS; i++) {
1769 mn = DISKMINOR(device_unit(vnd->sc_dev), i);
1770 vdevgone(bmaj, mn, mn, VBLK);
1771 if (mn != myminor) /* XXX avoid to kill own vnode */
1772 vdevgone(cmaj, mn, mn, VCHR);
1773 }
The "skip myself" on lines 1771/1772 is responsible for this behaviour.
--
J. Hannken-Illjes - hannken%mailbox.org@localhost
Attachment:
signature.asc
Description: Message signed with OpenPGP