kern/72433: AMR raid, amrreg.h struct amr_enquery3 ae_driveformat should be u_int8_t

Henry Miller hmiller at intradyn.com
Thu Oct 7 15:40:42 PDT 2004


>Number:         72433
>Category:       kern
>Synopsis:       AMR raid, amrreg.h struct amr_enquery3 ae_driveformat should be u_int8_t
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 07 22:40:32 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Henry Miller
>Release:        4.9-release
>Organization:
Intradyn, Inc
>Environment:
uname -a    
  FreeBSD 4.9-RELEASE-p10 FreeBSD 4.9-RELEASE-p10 #0: Wed Jun 23 10:16:26 CDT 2004     root at chan.hq.intradyn.com:/usr/src/sys/compile/RV1U  i386

from adapter:
Adapter Name    = MegaRAID SATA 150-4D
The Firmware Version    = 712T
The BIOS Version        = G116
>Description:
This is seen in the source code of current as well.


in sys/dev/arm/amrreg.h
struct amr_enquiry3
the field ae_driveformat is listed as u_int16_t workign with real hardware, it appears that this field should be u_int8_t.  

>How-To-Repeat:
Wrote a simple program to send an ioctl:  
  struct amr_user_ioctl cmd;
  struct amr_enquiry3 ae;
  memset(&cmd,0,sizeof(struct amr_user_ioctl));
  memset(&ae,0,sizeof(struct amr_enquiry3));
  cmd.au_cmd[0] = AMR_CMD_CONFIG;
  cmd.au_cmd[1] = AMR_CONFIG_ENQ3;
  cmd.au_buffer = &ae; 
  cmd.au_length = sizeof(struct amr_enquiry3);
  cmd.au_direction  = AMR_IO_READ;
  open("/dev/amr0",O_RDONLY);
  ioctl(fd,AMR_IO_COMMAND,&cmd);
  printf("%x %x %x\n",ae.ae_driveformat[0],
    ae.ae_driveformat[1],ae.ae_driveformat[2]);
     
on a normal array with 4 drive (0-3) this resulted in
3333 5333 0          (note, drive 2 was failed in a previous test)
After removing drive 1:
3433 5333 0
after replacing drive
4533 5333 0

Expected results should be
33 45 53   
>Fix:
     Change the type.  However it is not known how this change will affect the overall size of the structure.  I do not have docs from LSIlogic so I do not know if there are any potential problems there.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list