[dm-devel] [PATCH 1/3] dm-ioctl: don't use PF_MEMALLOC

Mikulas Patocka mpatocka at redhat.com
Fri Nov 23 00:19:35 UTC 2012


dm-ioctl: don't use PF_MEMALLOC

PF_MEMALLOC is a hack. Remove it and use documented GFP flags instead.

Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>

---
 drivers/md/dm-ioctl.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Index: linux-3.7-rc6/drivers/md/dm-ioctl.c
===================================================================
--- linux-3.7-rc6.orig/drivers/md/dm-ioctl.c	2012-11-20 22:44:00.000000000 +0100
+++ linux-3.7-rc6/drivers/md/dm-ioctl.c	2012-11-21 23:49:55.000000000 +0100
@@ -1598,7 +1598,7 @@ static int copy_params(struct dm_ioctl _
 
 	secure_data = tmp.flags & DM_SECURE_DATA_FLAG;
 
-	dmi = vmalloc(tmp.data_size);
+	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;
@@ -1691,18 +1691,10 @@ static int ctl_ioctl(uint command, struc
 	}
 
 	/*
-	 * 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;
 




More information about the dm-devel mailing list