[SCSI] sg and st unmap_user_pages allow PageReserved
authorHugh Dickins <hugh@veritas.com>
Fri, 2 Dec 2005 15:59:59 +0000 (15:59 +0000)
committerJames Bottomley <jejb@titanic.(none)>
Fri, 2 Dec 2005 16:24:14 +0000 (10:24 -0600)
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>
drivers/scsi/sg.c
drivers/scsi/st.c

index 72ec594..6de7ff9 100644 (file)
@@ -1878,8 +1878,6 @@ st_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_pages,
        for (i=0; i < nr_pages; i++) {
                struct page *page = sgl[i].page;
 
-               /* XXX: just for debug. Remove when PageReserved is removed */
-               BUG_ON(PageReserved(page));
                if (dirtied)
                        SetPageDirty(page);
                /* unlock_page(page); */
index b1056d2..7ac6ea1 100644 (file)
@@ -4525,8 +4525,6 @@ static int sgl_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_p
        for (i=0; i < nr_pages; i++) {
                struct page *page = sgl[i].page;
 
-               /* XXX: just for debug. Remove when PageReserved is removed */
-               BUG_ON(PageReserved(page));
                if (dirtied)
                        SetPageDirty(page);
                /* FIXME: cache flush missing for rw==READ