[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] virtio-scsi limits
From: |
Richard W.M. Jones |
Subject: |
Re: [Qemu-devel] virtio-scsi limits |
Date: |
Tue, 18 Apr 2017 18:17:03 +0100 |
User-agent: |
Mutt/1.5.20 (2009-12-10) |
On Tue, Apr 18, 2017 at 05:30:52PM +0200, Paolo Bonzini wrote:
> > When I changed libguestfs to use LUNs instead of targets (target=0
> > unit=i), I got a peculiar bug. It looks like there is some kind of
> > race when enumerating the device, where /sys is populated before the
> > device is actually available.
>
> That's not _too_ surprising because devtmpfs processes creation/deletion
> requests asynchronously.
I had a bit of a look into this, and I don't think this can be right.
At this point we're running inside the initramfs environment, where
/dev is a rootfs (a special case of either ramfs or tmpfs).
Would it still be the case that a single process that does mknod
followed by mount could not see the effect of the mknod?
The mount error (EINVAL) should indicate an invalid superblock rather
than a missing inode (if you believe the documentation, so that may be
wrong).
The sequence of events (happening in a single init process) is as
described below:
> > https://github.com/libguestfs/supermin/blob/master/init/init.c#L176
> >
> > * fp = fopen ("/sys/block/sdab/dev", "r") succeeds at line 181
> >
> > * we read major:minor from fp at line 230
> >
> > * we mknod ("/dev/root",...) at line 245
> >
> > * we mount ("/dev/root", "/root", "ext2"...) at line 262, which fails with
> > EINVAL
> >
> > * shortly after that, kernel messages indicate that sdab has been
> > attached.
Thanks,
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW