xen/privcmd: Mark pages as dirty

pages need to be marked as dirty before unpinned it in
unlock_pages() which was oversight. This is fixed now.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Suggested-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Paul Durrant <xadimgnik@gmail.com>
Link: https://lore.kernel.org/r/1594525195-28345-3-git-send-email-jrdr.linux@gmail.com
Signed-off-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
Souptick Joarder 2020-07-12 09:09:54 +05:30 committed by Juergen Gross
parent e398fb4bdf
commit a0c34d2251

View File

@ -612,8 +612,11 @@ static void unlock_pages(struct page *pages[], unsigned int nr_pages)
{
unsigned int i;
for (i = 0; i < nr_pages; i++)
for (i = 0; i < nr_pages; i++) {
if (!PageDirty(pages[i]))
set_page_dirty_lock(pages[i]);
put_page(pages[i]);
}
}
static long privcmd_ioctl_dm_op(struct file *file, void __user *udata)