Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Alasdair G Kergon and committed by
Linus Torvalds
dab6a429 a4fc4717

+4 -10
+4 -10
drivers/md/dm-ioctl.c
··· 1359 1359 * Copy the parameters into kernel space. 1360 1360 */ 1361 1361 r = copy_params(user, &param); 1362 - if (r) { 1363 - current->flags &= ~PF_MEMALLOC; 1364 - return r; 1365 - } 1366 1362 1367 - /* 1368 - * FIXME: eventually we will remove the PF_MEMALLOC flag 1369 - * here. However the tools still do nasty things like 1370 - * 'load' while a device is suspended. 1371 - */ 1363 + current->flags &= ~PF_MEMALLOC; 1364 + 1365 + if (r) 1366 + return r; 1372 1367 1373 1368 r = validate_params(cmd, param); 1374 1369 if (r) ··· 1381 1386 1382 1387 out: 1383 1388 free_params(param); 1384 - current->flags &= ~PF_MEMALLOC; 1385 1389 return r; 1386 1390 } 1387 1391