Skip to content

Commit

Permalink
[PATCH] device-mapper ioctl: reduce PF_MEMALLOC usage
Browse files Browse the repository at this point in the history
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: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
kergon authored and Linus Torvalds committed Feb 1, 2006
1 parent a4fc471 commit dab6a42
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,16 +1359,11 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
* Copy the parameters into kernel space.
*/
r = copy_params(user, &param);
if (r) {
current->flags &= ~PF_MEMALLOC;
return r;
}

/*
* FIXME: eventually we will remove the PF_MEMALLOC flag
* here. However the tools still do nasty things like
* 'load' while a device is suspended.
*/
current->flags &= ~PF_MEMALLOC;

if (r)
return r;

r = validate_params(cmd, param);
if (r)
Expand All @@ -1386,7 +1381,6 @@ static int ctl_ioctl(struct inode *inode, struct file *file,

out:
free_params(param);
current->flags &= ~PF_MEMALLOC;
return r;
}

Expand Down

0 comments on commit dab6a42

Please sign in to comment.