lkml.org 
[lkml]   [2006]   [Jun]   [1]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 1 Jun 2006 08:05:49 +0300 (EEST)
FromKai Makisara <>
SubjectRe: [GIT PATCH] scsi bug fixes for 2.6.17-rc5
On Wed, 31 May 2006, James Bottomley wrote:

> This is my current slew of small bug fixes which either fix serious
> bugs, or are completely safe for this -rc5 stage of the kernel.  I've
> added one more since I last sent you this pull request (the fix memory
> building non-aligned sg lists)
> 
> The patch is available from:
> 
> master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
> 
> The short changelog is:
> 
> Bryan Holty:
>   o fix memory building non-aligned sg lists
> 
I looked at 
www.kernel.org/git/?p=linux/kernel/git/jejb/scsi-rc-fixes-2.6.git;.

This patch does the following change:

- int nr_pages = (bufflen + PAGE_SIZE - 1) >> PAGE_SHIFT;
+ int nr_pages = PAGE_ALIGN(bufflen + sgl[0].offset);

This seems to wrong: the new version is missing the right shift. For 
instance, offset=0 and bufflen=4096 results in 4096 and not 1!

(Using asm-x86_64, the new version translates to
((bufflen + sgl[0].offset+PAGE_SIZE-1)&(~(PAGE_SIZE-1)))
)

According to the original patch by Brian, the change should probably have 
been to (or something equivalent):

+       int nr_pages = (bufflen + sgl[0].offset + PAGE_SIZE - 1) >> 
PAGE_SHIFT;
This was tested by several people. Did anyone test the version put into 
scsi-rc-fixes-2.6.git?

-- 
Kai
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-01 05:09    [from the cache]
©2003-2008