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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

---
 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;
 

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel


[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux