tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: vnode_has_large_blocks() (vnd.c rev 1.255)



On Wed, Sep 05, 2018 at 11:27:51PM +0200, Manuel Bouyer wrote:
> > The backing store and the geometry are initialized before vndthread
> > is started, getdisksize() shouldn't fail and I'm sure it didn't
> > at that time.
> 
> AFAIK getdisksize() returns the parameters of the vnd device, not the
> backing store. For this it needs to read the vnd disklabel, and
> for read to work, it needs the vnd thread. The ioctl fails because
> VNF_INITED is not set. getdisksize() can't work before the thread is
> fully up and running.

thinking about it more, I think this is the wrong approach. For example,
if the vnd is for a linux domU, getdisksize() won't return anything
usefull, but the I/O will probably be 4k-compatible. Even for a NetBSD domU,
as the xbd protocol uses 512-bytes sectors, the disklabel will always contains
512, even if the filesystem is properly aligned and uses 4k fragments.
Worse, even if the disklabel contains 4k sectors, the xbd protocol may split
an I/O in 2 parts that are not 4k aligned.
I think the check should be made at I/O time. It will be cheaper than an
unneeded read/modify/write I/O anyway.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index