From: Alasdair G Kergon 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 Signed-off-by: Andrew Morton --- drivers/md/dm-ioctl.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) diff -puN drivers/md/dm-ioctl.c~device-mapper-ioctl-reduce-pf_memalloc-usage drivers/md/dm-ioctl.c --- devel/drivers/md/dm-ioctl.c~device-mapper-ioctl-reduce-pf_memalloc-usage 2006-01-22 21:42:14.000000000 -0800 +++ devel-akpm/drivers/md/dm-ioctl.c 2006-01-22 21:42:14.000000000 -0800 @@ -1359,16 +1359,11 @@ static int ctl_ioctl(struct inode *inode * Copy the parameters into kernel space. */ r = copy_params(user, ¶m); - 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 out: free_params(param); - current->flags &= ~PF_MEMALLOC; return r; } _