NetBSD-Bugs archive

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

Re: kern/57134: fstat on vnd returns empty size



The following reply was made to PR kern/57134; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/57134: fstat on vnd returns empty size
Date: Mon, 26 Dec 2022 21:42:29 -0000 (UTC)

 martin%duskware.de@localhost (Martin Husemann) writes:
 
 > the opendisk works (returns 3) and the fstat also works, but sb has
 > sb.st_size == 0 (and sb.st_dev == 0xab01, which also looks strange).
 
 
 disklabel routines are device and platform-specific. Some have been
 unified, but there is still lots of "individual" behaviour.
 
 The default result for a non-existing disklabel is to set only
 the raw partition to the whole disk and to make it of type BSDFFS
 so that you can use the raw disk for a FFS filesystem. That's what
 happens on sparc64.
 
 Platforms that use the PC-style readdisklabel routine will define
 the raw partition as unused and set partition 'a' as BSDFFS spanning
 the whole disk.
 
 
 st_dev == 0xab01 = 171.1. That's strange, it should be the device
 where the filesystem containing /dev is located. Maybe a typo? 
 0xa801 would be /dev/dk1. st_rdev would be the device itself, e.g.
 0800 for vnd0a.
 
 


Home | Main Index | Thread Index | Old Index