summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2012-12-22 00:23:36 +0400
committerAlasdair G Kergon <agk@redhat.com>2012-12-22 00:23:36 +0400
commit5023e5cf58e1dae904e2e8b5b9779c33512b75a1 (patch)
tree4b006347d01a1526a3ee42b5219b90ea9cf4cae7 /drivers
parent7960123f2d335ded2ac4c510bcd2a236b293b1b1 (diff)
downloadlinux-5023e5cf58e1dae904e2e8b5b9779c33512b75a1.tar.xz
dm ioctl: remove PF_MEMALLOC
When allocating memory for the userspace ioctl data, set some appropriate GPF flags directly instead of using PF_MEMALLOC. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-ioctl.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index a651d528f80d..a37aeba7dc1b 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1556,7 +1556,10 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl **param)
secure_data = tmp.flags & DM_SECURE_DATA_FLAG;
- dmi = vmalloc(tmp.data_size);
+ /*
+ * Try to avoid low memory issues when a device is suspended.
+ */
+ dmi = __vmalloc(tmp.data_size, GFP_NOIO | __GFP_REPEAT | __GFP_HIGH, PAGE_KERNEL);
if (!dmi) {
if (secure_data && clear_user(user, tmp.data_size))
return -EFAULT;
@@ -1657,18 +1660,10 @@ static int ctl_ioctl(uint command, struct dm_ioctl __user *user)
}
/*
- * Trying to avoid low memory issues when a device is
- * suspended.
- */
- current->flags |= PF_MEMALLOC;
-
- /*
* Copy the parameters into kernel space.
*/
r = copy_params(user, &param);
- current->flags &= ~PF_MEMALLOC;
-
if (r)
return r;