Re: kernel unaligned accesses on IA64 in IDE

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

 



On Fri, Aug 22, 2008 at 11:51:47AM -0700, Luck, Tony wrote:
> > Why not just make rq->cmd always properly aligned in the block layer
> > i.e. by allocating BLK_MAX_CDB + 2 instead of BLK_MAX_CDB for rq->__cmd
> > and then doing ALIGN() when setting rq->cmd in blk_rq_init()?
> 
> There are two places that do
> 
>         if (rq->cmd != rq->__cmd)
>                 kfree(rq->cmd);
> 
> that would need to be adjusted if you did that.  Better to get __cmd
> aligned on a good boundary by changing the declaration to
> 
>         int __cmd[BLK_MAX_CDB / sizeof (int)];

How about long instead of int.  int leaves us with the possibility that
something else will expect 8 byte alignment.

> and adding a cast to blk_rq_init():
> 
>         rq->cmd = (char *)rq->__cmd;

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

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux