Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347958
b: refs/heads/master
c: 5023e5c
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Dec 21, 2012
1 parent 6309807 commit b5c55d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7960123f2d335ded2ac4c510bcd2a236b293b1b1
refs/heads/master: 5023e5cf58e1dae904e2e8b5b9779c33512b75a1
13 changes: 4 additions & 9 deletions trunk/drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1656,19 +1659,11 @@ static int ctl_ioctl(uint command, struct dm_ioctl __user *user)
return -ENOTTY;
}

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

Expand Down
4 changes: 2 additions & 2 deletions trunk/include/uapi/linux/dm-ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ enum {

#define DM_VERSION_MAJOR 4
#define DM_VERSION_MINOR 23
#define DM_VERSION_PATCHLEVEL 0
#define DM_VERSION_EXTRA "-ioctl (2012-07-25)"
#define DM_VERSION_PATCHLEVEL 1
#define DM_VERSION_EXTRA "-ioctl (2012-12-18)"

/* Status bits */
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
Expand Down

0 comments on commit b5c55d8

Please sign in to comment.