OpenSolaris

Printable Version Enter a New Search
Bug ID 6342431
Synopsis off-by-one in sd driver must be solved
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:driver-sd-fixed
Keywords s10u2-triage
Responsible Engineer Minskey Guo
Reported Against snv_23
Duplicate Of
Introduced In
Commit to Fix snv_44
Fixed In snv_44
Release Fixed solaris_nevada(snv_44)
Related Bugs 6379750 , 6452730 , 6461930 , 6844425 , 6847000 , 4996920
Submit Date 27-October-2005
Last Update Date 6-November-2008
Description
currently, in sd, there is a workaround we called it "off-by-one".  sd uses READ_CAPACITY
command to get the capacity of a disk, but in sd_send_scsi_READ_CAPACITY(), sd doesn't report right capacity for non-removable devices on x86 platform.  see:

#if defined(__i386) || defined(__amd64)
    /*
     * On x86, compensate for off-by-1 error (number of sectors on
     * media)  (1175930)
     */
    if (!ISREMOVABLE(un) && (lbasize == un->un_sys_blocksize)) {
        capacity -= 1;
    }
#endif
 
This workaround causes somewhat uncompatible between x86 and sparc. As casper.disk said if you create a ZFS filesystem on SPARC and move it to x86, there will be unreadable blocks, one at the end of each block.

In addition, once EFI partition method becomes popular, we could encounted more troubles because EFI has a backup partition table to save in the last block of a disk.
Work Around
N/A
Comments
N/A