Commit dab6a429 authored by Alasdair G Kergon's avatar Alasdair G Kergon Committed by Linus Torvalds

[PATCH] device-mapper ioctl: reduce PF_MEMALLOC usage

Reduce substantially the amount of code using PF_MEMALLOC, as envisaged in the
original FIXME.

If you're using lvm2, for this patch to work correctly you should update to
lvm2 version 2.02.01 or later and device-mapper version 1.02.02 or later.
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a4fc4717
...@@ -1359,16 +1359,11 @@ static int ctl_ioctl(struct inode *inode, struct file *file, ...@@ -1359,16 +1359,11 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
* Copy the parameters into kernel space. * Copy the parameters into kernel space.
*/ */
r = copy_params(user, &param); r = copy_params(user, &param);
if (r) {
current->flags &= ~PF_MEMALLOC;
return r;
}
/* current->flags &= ~PF_MEMALLOC;
* FIXME: eventually we will remove the PF_MEMALLOC flag
* here. However the tools still do nasty things like if (r)
* 'load' while a device is suspended. return r;
*/
r = validate_params(cmd, param); r = validate_params(cmd, param);
if (r) if (r)
...@@ -1386,7 +1381,6 @@ static int ctl_ioctl(struct inode *inode, struct file *file, ...@@ -1386,7 +1381,6 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
out: out:
free_params(param); free_params(param);
current->flags &= ~PF_MEMALLOC;
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment