Re: [PATCH] advansys: fix overrun_buf aligned bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2008-02-08 at 09:50 +0900, FUJITA Tomonori wrote:
> struct asc_dvc_var needs overrun buffer to be placed on an 8 byte
> boundary. advansys defines struct asc_dvc_var:
> 
> struct asc_dvc_var {
> 	...
> 	uchar overrun_buf[ASC_OVERRUN_BSIZE] __aligned(8);
> 
> The problem is that struct asc_dvc_var is placed on
> shost->hostdata. So if the hostdata is not on an 8 byte boundary, the
> advansys crashes. The hostdata is placed on a sizeof(unsigned long)
> boundary so the 8 byte boundary is not garanteed with x86_32.
> 
> With 2.6.23 and 2.6.24, the hostdata is on an 8 byte boundary by
> chance, but with the current git, it's not.
> 
> This patch removes overrun_buf static array and use kzalloc.

It's a bit of a waste of a kmallocs.  The usual way of fixing this type
of cockup is to float the structure until it becomes aligned, but I
suppose that involves changing all calls to shost_priv in the driver ...

James


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux