summaryrefslogtreecommitdiff
path: root/drivers/xen
diff options
context:
space:
mode:
authorSouptick Joarder <jrdr.linux@gmail.com>2020-07-12 06:39:54 +0300
committerJuergen Gross <jgross@suse.com>2020-08-03 08:42:18 +0300
commita0c34d225183fd4aca61dccb50e5783fa2f26db1 (patch)
treed8bee51feaa7c2afdcccee0de17f30fd2d246a7b /drivers/xen
parente398fb4bdf522abdeb8ddb61235bbf66065fc105 (diff)
downloadlinux-a0c34d225183fd4aca61dccb50e5783fa2f26db1.tar.xz
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>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/privcmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index a9b2baa2c7be..aa8ca58e6efc 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -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)