Skip to content

Commit

Permalink
[SCSI] sg and st unmap_user_pages allow PageReserved
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Nick Piggin <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
Hugh Dickins authored and James Bottomley committed Dec 2, 2005
1 parent 6bc733e commit 032c09d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions drivers/scsi/sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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); */
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 032c09d

Please sign in to comment.