• Jens Axboe's avatar
    [PATCH] gdth buggy page mapping · 53b2a84a
    Jens Axboe authored
    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: default avatarJens Axboe <axboe@suse.de>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
    53b2a84a
gdth.c 222 KB