Re: ips.c warnings

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

 



On Thu, 2005-10-20 at 18:29 +0100, Christoph Hellwig wrote:
> I think the real question is: what are these checks for.  You should never
> get an SG list with a NULL struct page or an SGL entry that points to address
> 0 from the higher level code, and no other drivers checks for that condition.

Actually, no, that's not the problem.

The macro is taking page_address((sgl)->page).  That can be null if the
page isn't mapped into the kernel.  According to my reading of the code
it's doing this for some type of buffering reasons which require an
in-kernel memcpy().  If it finds page_address() to be NULL then it
simply doesn't do the operation.  Scatter/Gather lists, by and large,
come from a user so this operation should be failing all the time in any
x86 machine that has > 1GB of memory, I would have thought.

That's why I advocated using kmap (or kmap_atomic) because you need to
make the page exist in the kernel while you do the copy (and then unmap
it afterwards).  We've been having to add this operation to quite a lot
of raid drivers recently because of the changes to SCSI that make all
operations go via block layer scatter/gather lists.

James


-
: 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