[PATCH] device-mapper ioctl: reduce PF_MEMALLOC usage
authorAlasdair G Kergon <agk@redhat.com>
Wed, 1 Feb 2006 11:04:52 +0000 (03:04 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 1 Feb 2006 16:53:10 +0000 (08:53 -0800)
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>
drivers/md/dm-ioctl.c

index 1235135b384bea5ac1e82129926e30c85d36bd9f..442e2be6052e330f283379b3cc9eb02f7a5855df 100644 (file)
@@ -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)
@@ -1386,7 +1381,6 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
 
  out:
        free_params(param);
-       current->flags &= ~PF_MEMALLOC;
        return r;
 }