dm ioctl: set noio flag to avoid __vmalloc deadlock
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 10 Jul 2013 22:41:15 +0000 (23:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Aug 2013 08:51:02 +0000 (16:51 +0800)
commitba0e6dd5e64bbf820669f7451ac03f4f11cd64f7
tree2dd11d8443f7d329235132d6296b14f22d1e11bc
parent565ff95cdc72f76d53d4e98d5e84254368b9a041
dm ioctl: set noio flag to avoid __vmalloc deadlock

commit 1c0e883e86ece31880fac2f84b260545d66a39e0 upstream.

Set noio flag while calling __vmalloc() because it doesn't fully respect
gfp flags to avoid a possible deadlock (see commit
502624bdad3dba45dfaacaf36b7d83e39e74b2d2).

This should be backported to stable kernels 3.8 and newer. The kernel 3.8
doesn't have memalloc_noio_save(), so we should set and restore process
flag PF_MEMALLOC instead.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-ioctl.c