[PATCH] gdth buggy page mapping
Just tripped over a bug report for the SUSE kernel where gdth would crash on a 32G opteron, turned out that the gdth_internal_copy() sg handling was really buggy. After fixing this I wanted to do the same for mainline, but I can see that a vain attempt was already made to fix it. Unfortunately it wasn't complete, and on top of that there's room for improvement. The current code is buggy on highmem, as page_address() will not yield a valid kernel address causing a NULL pointer dereference. The current code also doesn't unmap the sg list if it sees a NULL sl->page. In fact, the whole sg mapping looks really strange, why on earth would you be mapping the sglist for dma when you are only going to copy from it? This patch corrects both errors - correctly maps in the page, and kills the pci_map_sg/pci_unmap_sg calls completely. If someone could test this, that would be great. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Showing
Please register or sign in to comment