[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <490C5CFD.6000703@rtr.ca>
Date: Sat, 01 Nov 2008 09:43:25 -0400
From: Mark Lord <lkml@....ca>
To: Sarangi_Santosh@....com
Cc: linux-kernel@...r.kernel.org
Subject: Re: PROBLEM: ioctl (HDIO_GETGEO) on partition
Mark Lord wrote:
> Sarangi_Santosh@....com wrote:
..
>> if ((sts = ioctl(fd, HDIO_GETGEO, &hd_geometry_rec)) < 0) ------->
>> ioctl((HDIO_GETGEO) is failing for device partition (/dev/emcpowerg1)
>> {
>> close(fd);
>> return OS_SYSTEM_CALL_FAILED;
>> }
..
And while we're at it, that code above REALLY wants
a perror(p_ppdevname) call just before the close(fd) line.
That way, when it fails, you'll find out *why* it fails,
making bugs like this much easier to figure out.
..
> The code should try HDIO_GETGEO_BIG before falling back to HDIO_GETGEO.
> But neither will work for LARGE drives (>= 2TB) on 32-bit systems,
> so the code really should try sysfs for this info before using the ioctls.
>
> Sample code to do this correctly is in the geom.c file of recent hdparm
> source code packages from sourceforge.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists