Filesystems do not necessarily set PageError; instead they will leave PageUptodate clear on errors. We should also kmap() the page before accessing it in case the page is allocated from HIGHMEM. Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> --- drivers/scsi/scsicam.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c index acdc0aceca5e..baba801895df 100644 --- a/drivers/scsi/scsicam.c +++ b/drivers/scsi/scsicam.c @@ -40,8 +40,12 @@ unsigned char *scsi_bios_ptable(struct block_device *dev) if (IS_ERR(page)) return NULL; - if (!PageError(page)) - res = kmemdup(page_address(page) + 0x1be, 66, GFP_KERNEL); + if (PageUptodate(page)) { + char *addr = kmap_local_page(page); + + res = kmemdup(addr + 0x1be, 66, GFP_KERNEL); + kunmap_local(addr); + } put_page(page); return res; } -- 2.34.1