Jim Henderson <his_jimboness@xxxxxxxx> wrote on 12/01/2005 05:10:46 PM:
> Steve,
>
> The patch applied perfectly to EVMS 2.5.3 (I decided to upgrade from
> 2.5.2 while I was at it) but unfortunately there's still a problem.
> Now, instead of "Function not implemented." I'm getting "Invalid
argument":
>
> ---
> Dec 01 22:59:28 samba _8_ LocalDskMgr: get_geometry: Error getting
> geometry for disk sda: 22: Invalid argument.
> ---
>
> In addition (not sure if this helps), I've found that hdparm has
> problems getting geometry in my domU too:
>
> ---
> samba ~ # hdparm /dev/sda
>
> /dev/sda:
> readonly = 0 (off)
> readahead = 256 (on)
> HDIO_GETGEO failed: Function not implemented
> ---
>
> Any ideas? Thanks for your help so far.
Hi, Jim.
Since hdparam is also getting an error on the HDIO_GETGEO ioctl, my guess
is that the Xen driver for the disk is not handling the ioctl. So, looking
at the Xen source, I see that in blkif_ioctl() in
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c that the case for
HDIO_GETGEO just does "return -ENOSYS;" with a comment that says "return
ENOSYS to use defaults". Looks like the ENOSYS is making its way back to
hdparam with no defaults set.
EVMS gets a different error code because it first tries the HDIO_GETGEO
ioctl, which fails with ENOSYS, then it tries the HDIO_GETGEO_BIG ioctl (an
old, deprecated ioctl) which blkif_ioctl() doesn't handle and returns its
default -EINVAL.
Taking a quick look at the fdisk code, it appears fdisk ignores errors from
the HDIO_GETGEO ioctl and uses the defaults of 255 heads and 63 sectors per
track. (It can get the settings of heads and sectors from several ways:
user input, the partition table, or HDIO_GETGEO ioctl, in that order. If
all three of those are not set, it uses the defaults.) It always
calculates the number of cylinders from the disk size, the number of heads,
and number of sectors per track.
I see two ways to fix this. One is to have the Xen blkif_ioctl() return
zeroes for the geometry and return a zero return code. Other Linux block
drivers do that, and EVMS handles that situation. The other fix is to
change EVMS to behave like fdisk and use defaults if the ioctls return
error codes.
Anyone on the list have thoughts on this issue?
Steve D.
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
|