LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mark Lord <lkml@rtr.ca>
To: Sarangi_Santosh@emc.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: ioctl (HDIO_GETGEO) on partition
Date: Sat, 01 Nov 2008 09:43:25 -0400	[thread overview]
Message-ID: <490C5CFD.6000703@rtr.ca> (raw)
In-Reply-To: <490C5C64.2060609@rtr.ca>

Mark Lord wrote:
> Sarangi_Santosh@emc.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.

      reply	other threads:[~2008-11-01 13:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-30 10:02 Sarangi_Santosh
2008-11-01 13:40 ` Mark Lord
2008-11-01 13:43   ` Mark Lord [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=490C5CFD.6000703@rtr.ca \
    --to=lkml@rtr.ca \
    --cc=Sarangi_Santosh@emc.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: PROBLEM: ioctl (HDIO_GETGEO) on partition' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).