[SCSI] sg and st unmap_user_pages allow PageReserved

2.6.15-rc1 made sg's st_unmap_user_pages and st's sgl_unmap_user_pages
BUG on a PageReserved page. But that's wrong: they could be unmapping
the ZERO_PAGE, which is marked PG_reserved; and perhaps others (while
get_user_pages is still permitted on VM_PFNMAP areas - that may change).

More change is needed here: sg claims to dirty even pages written from,
and st claims not to dirty even pages read into; and SetPageDirty is not
adequate for this nowadays. Fixes to those follow in a later patch: for
the moment just fix the 2.6.15 regression.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by Hugh Dickins and committed by James Bottomley 032c09d7 6bc733e9

-4
-2
drivers/scsi/sg.c
··· 1878 1878 for (i=0; i < nr_pages; i++) { 1879 1879 struct page *page = sgl[i].page; 1880 1880 1881 - /* XXX: just for debug. Remove when PageReserved is removed */ 1882 - BUG_ON(PageReserved(page)); 1883 1881 if (dirtied) 1884 1882 SetPageDirty(page); 1885 1883 /* unlock_page(page); */
-2
drivers/scsi/st.c
··· 4525 4525 for (i=0; i < nr_pages; i++) { 4526 4526 struct page *page = sgl[i].page; 4527 4527 4528 - /* XXX: just for debug. Remove when PageReserved is removed */ 4529 - BUG_ON(PageReserved(page)); 4530 4528 if (dirtied) 4531 4529 SetPageDirty(page); 4532 4530 /* FIXME: cache flush missing for rw==READ