Skip to contentSkip to conversation

dasd HDIO_GETGEO

DISCUSSION Stefan Weinhuber 1 participant 1 message May 28, 2014 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Karel,

Karel Zak <[email protected]> wrote on 2014-05-28 14:12:08:

Quoted 6 lines

but only dasd driver overwrites this default and reports in native sectors:

drivers/s390/block/dasd.c: dasd_getgeo():

Quoted 8 lines
           geo->start = get_start_sect(bdev) >> base->block->s2b_shift;

So, for normal SCSI I always get start sector independently on disk sector size, but for dasd...

Is it expected behavior? It's painful for userspace to care about driver type.

I looked up that line in old change logs, and apparently this was changed in 2002 during the Kernel 2.5 development phase with the commit message

Fixed HDIO_GETGEO to meet 2.4 semantics

So this was an intentional change to remain compatible with older versions of this ioctl.

Quoted 11 lines

(Well, HDIO_GETGEO sucks in many ways, so recommendation is to read
/sys/dev/block/<maj:min>/start rather than depends on this ioctl.)

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com

Mit freundlichen Gr��en / Kind regards

Stefan Weinhuber