Commit 8c1e2162 authored by Junaid Shahid's avatar Junaid Shahid Committed by Mike Snitzer

dm ioctl: restore __GFP_HIGH in copy_params()

Commit d224e938 ("drivers/md/dm-ioctl.c: use kvmalloc rather than
opencoded variant") left out the __GFP_HIGH flag when converting from
__vmalloc to kvmalloc.  This can cause the DM ioctl to fail in some low
memory situations where it wouldn't have failed earlier.  Add __GFP_HIGH
back to avoid any potential regression.

Fixes: d224e938 ("drivers/md/dm-ioctl.c: use kvmalloc rather than opencoded variant")
Signed-off-by: default avatarJunaid Shahid <junaids@google.com>
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 702a6204
...@@ -1710,12 +1710,13 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kern ...@@ -1710,12 +1710,13 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kern
} }
/* /*
* Try to avoid low memory issues when a device is suspended. * Use __GFP_HIGH to avoid low memory issues when a device is
* suspended and the ioctl is needed to resume it.
* Use kmalloc() rather than vmalloc() when we can. * Use kmalloc() rather than vmalloc() when we can.
*/ */
dmi = NULL; dmi = NULL;
noio_flag = memalloc_noio_save(); noio_flag = memalloc_noio_save();
dmi = kvmalloc(param_kernel->data_size, GFP_KERNEL); dmi = kvmalloc(param_kernel->data_size, GFP_KERNEL | __GFP_HIGH);
memalloc_noio_restore(noio_flag); memalloc_noio_restore(noio_flag);
if (!dmi) { if (!dmi) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment