Bug 47058 - kernel get_last_block ioctl fails
kernel get_last_block ioctl fails
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-02 16:24 EDT by Matt Domsch
Modified: 2007-04-18 12:34 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-11 12:51:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matt Domsch 2001-07-02 16:24:08 EDT
Description of Problem:
On Fairfax, beta 1.
parted tries to read the last block of the disk via the get_last_sector 
ioctl, which is failing.  Looks like parted is fine, but the kernel 
implementation of get_last_sector is failing.

How Reproducible:
Always on aacraid (all I've tried so far).

Steps to Reproduce:
1. Run fairfax beta1 installer (I'm using FTP installs)
2. Choose to use Disk Druid for partitioning.  See screen gets screwed up 
with "read failed: Operation not permitted" messages.
3. Switch to VT4 and see:
 SCSI disk error: host 1 channel 0 id 0 lun 0 return code = 1
 I/O error: dev 08:00, sector 35542272
 get_last_sector ioctl: bread returned NULL.

Similarly, doing:
  mknod /dev/sda
  parted /dev/sda print
reproduces this quite easily. 

Actual Results:
Can't partition the disk.

Expected Results:
Can partition the disk.

Additional Information:
Looks like the get_last_block ioctl is getting called, but doesn't work 
for some reason.
Comment 1 Matt Domsch 2001-07-03 16:59:35 EDT
It's not a Linux bug.  I believe it to be a bug in the PERC 2/Si firmware.  A 
SCSI Read Capacity to a RAID10 logical drive with a 64K stripe size returns an 
odd number of sectors (in fact it's 64K*x+1).  That can't be right.  I'm 
pursuing this with Adaptec.
-Matt
Comment 2 Matt Domsch 2001-07-11 12:51:23 EDT
It's a bug in the aacraid driver which implements the READ CAPACITY command.  
Here's a patch which fixes it.  Arjan, please apply.

--- linux-2.4/drivers/scsi/aacraid/aachba.c~	Wed Jun 27 13:58:50 2001
+++ linux-2.4/drivers/scsi/aacraid/aachba.c	Tue Jul 10 18:57:01 2001
@@ -663,7 +663,7 @@
 			char *cp;
 
 			cmn_err( CE_DEBUG, "READ CAPACITY command" );
-			capacity = fsa_dev_ptr->ContainerSize[ContainerId];
+			capacity = fsa_dev_ptr->ContainerSize[ContainerId] - 1;
 			cp = scsi_cmnd_ptr->request_buffer;
 			cp[0] = ( capacity >> 24 ) & 0xff;
 			cp[1] = ( capacity >> 16 ) & 0xff;
Comment 3 Arjan van de Ven 2001-07-12 04:23:57 EDT
Added to tree

Note You need to log in before you can comment on or make changes to this bug.