aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2012-12-21 15:23:36 -0500
committerAlasdair G Kergon <agk@redhat.com>2012-12-21 15:23:36 -0500
commit5023e5cf58e1dae904e2e8b5b9779c33512b75a1 (patch)
tree4b006347d01a1526a3ee42b5219b90ea9cf4cae7
parent7960123f2d335ded2ac4c510bcd2a236b293b1b1 (diff)
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>
-rw-r--r--drivers/md/dm-ioctl.c13
-rw-r--r--include/uapi/linux/dm-ioctl.h4
2 files changed, 6 insertions, 11 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)
1556 1556
1557 secure_data = tmp.flags & DM_SECURE_DATA_FLAG; 1557 secure_data = tmp.flags & DM_SECURE_DATA_FLAG;
1558 1558
1559 dmi = vmalloc(tmp.data_size); 1559 /*
1560 * Try to avoid low memory issues when a device is suspended.
1561 */
1562 dmi = __vmalloc(tmp.data_size, GFP_NOIO | __GFP_REPEAT | __GFP_HIGH, PAGE_KERNEL);
1560 if (!dmi) { 1563 if (!dmi) {
1561 if (secure_data && clear_user(user, tmp.data_size)) 1564 if (secure_data && clear_user(user, tmp.data_size))
1562 return -EFAULT; 1565 return -EFAULT;
@@ -1657,18 +1660,10 @@ static int ctl_ioctl(uint command, struct dm_ioctl __user *user)
1657 } 1660 }
1658 1661
1659 /* 1662 /*
1660 * Trying to avoid low memory issues when a device is
1661 * suspended.
1662 */
1663 current->flags |= PF_MEMALLOC;
1664
1665 /*
1666 * Copy the parameters into kernel space. 1663 * Copy the parameters into kernel space.
1667 */ 1664 */
1668 r = copy_params(user, &param); 1665 r = copy_params(user, &param);
1669 1666
1670 current->flags &= ~PF_MEMALLOC;
1671
1672 if (r) 1667 if (r)
1673 return r; 1668 return r;
1674 1669
diff --git a/include/uapi/linux/dm-ioctl.h b/include/uapi/linux/dm-ioctl.h
index 91e3a360f611..539b179b349c 100644
--- a/include/uapi/linux/dm-ioctl.h
+++ b/include/uapi/linux/dm-ioctl.h
@@ -268,8 +268,8 @@ enum {
268 268
269#define DM_VERSION_MAJOR 4 269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 23 270#define DM_VERSION_MINOR 23
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 1
272#define DM_VERSION_EXTRA "-ioctl (2012-07-25)" 272#define DM_VERSION_EXTRA "-ioctl (2012-12-18)"
273 273
274/* Status bits */ 274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 275#define DM_READONLY_FLAG (1 << 0) /* In/Out */