diff options
author | Junaid Shahid <junaids@google.com> | 2017-05-18 15:00:51 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2017-05-22 19:30:03 -0400 |
commit | 8c1e2162f27b319da913683143c0c6c09b083ebb (patch) | |
tree | 1b890d720aba77344c49cb306a469dae44ce1ac0 /drivers/md/dm-ioctl.c | |
parent | 702a6204f804bad946c455e7cd8d50d79c9d1629 (diff) |
dm ioctl: restore __GFP_HIGH in copy_params()
Commit d224e9381897 ("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: d224e9381897 ("drivers/md/dm-ioctl.c: use kvmalloc rather than opencoded variant")
Signed-off-by: Junaid Shahid <junaids@google.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r-- | drivers/md/dm-ioctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 0555b4410e05..41852ae287a5 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -1710,12 +1710,13 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kern | |||
1710 | } | 1710 | } |
1711 | 1711 | ||
1712 | /* | 1712 | /* |
1713 | * Try to avoid low memory issues when a device is suspended. | 1713 | * Use __GFP_HIGH to avoid low memory issues when a device is |
1714 | * suspended and the ioctl is needed to resume it. | ||
1714 | * Use kmalloc() rather than vmalloc() when we can. | 1715 | * Use kmalloc() rather than vmalloc() when we can. |
1715 | */ | 1716 | */ |
1716 | dmi = NULL; | 1717 | dmi = NULL; |
1717 | noio_flag = memalloc_noio_save(); | 1718 | noio_flag = memalloc_noio_save(); |
1718 | dmi = kvmalloc(param_kernel->data_size, GFP_KERNEL); | 1719 | dmi = kvmalloc(param_kernel->data_size, GFP_KERNEL | __GFP_HIGH); |
1719 | memalloc_noio_restore(noio_flag); | 1720 | memalloc_noio_restore(noio_flag); |
1720 | 1721 | ||
1721 | if (!dmi) { | 1722 | if (!dmi) { |