]> git.baikalelectronics.ru Git - kernel.git/commit
xen/gntdev.c: Mark pages as dirty
authorSouptick Joarder <jrdr.linux@gmail.com>
Sun, 6 Sep 2020 06:51:53 +0000 (12:21 +0530)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Sun, 4 Oct 2020 23:39:18 +0000 (18:39 -0500)
commit2a1e7e08670399f712eebc7bf291ea3884937529
treeed5d0d89d9207c4ae3e9a61d1753216bcd6895ef
parent8d14aede3a4dea0a8529c8aa849876125c838e4b
xen/gntdev.c: Mark pages as dirty

There seems to be a bug in the original code when gntdev_get_page()
is called with writeable=true then the page needs to be marked dirty
before being put.

To address this, a bool writeable is added in gnt_dev_copy_batch, set
it in gntdev_grant_copy_seg() (and drop `writeable` argument to
gntdev_get_page()) and then, based on batch->writeable, use
set_page_dirty_lock().

Fixes: 5e0182205507 (xen/gntdev: add ioctl for grant copy)
Suggested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1599375114-32360-1-git-send-email-jrdr.linux@gmail.com
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
drivers/xen/gntdev.c