diff options
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 07fee811c09e..d86d5c26061d 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1887,13 +1887,17 @@ st_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_pages, | |||
1887 | int i; | 1887 | int i; |
1888 | 1888 | ||
1889 | for (i=0; i < nr_pages; i++) { | 1889 | for (i=0; i < nr_pages; i++) { |
1890 | if (dirtied && !PageReserved(sgl[i].page)) | 1890 | struct page *page = sgl[i].page; |
1891 | SetPageDirty(sgl[i].page); | 1891 | |
1892 | /* unlock_page(sgl[i].page); */ | 1892 | /* XXX: just for debug. Remove when PageReserved is removed */ |
1893 | BUG_ON(PageReserved(page)); | ||
1894 | if (dirtied) | ||
1895 | SetPageDirty(page); | ||
1896 | /* unlock_page(page); */ | ||
1893 | /* FIXME: cache flush missing for rw==READ | 1897 | /* FIXME: cache flush missing for rw==READ |
1894 | * FIXME: call the correct reference counting function | 1898 | * FIXME: call the correct reference counting function |
1895 | */ | 1899 | */ |
1896 | page_cache_release(sgl[i].page); | 1900 | page_cache_release(page); |
1897 | } | 1901 | } |
1898 | 1902 | ||
1899 | return 0; | 1903 | return 0; |