]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: scrub: add memalloc_nofs protection around init_ipath
authorDavid Sterba <dsterba@suse.com>
Wed, 31 May 2017 17:21:38 +0000 (19:21 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2017 16:26:02 +0000 (18:26 +0200)
commit9a2986683dc8e2af64283ad62d7633b0725ff9fc
treeb3fd451798e685ab306e10bbc842303d7aecace0
parent23ef3eea3edbde2c6828678483df7b12167ec074
btrfs: scrub: add memalloc_nofs protection around init_ipath

init_ipath is called from a safe ioctl context and from scrub when
printing an error.  The protection is added for three reasons:

* init_data_container calls vmalloc and this does not work as expected
  in the GFP_NOFS context, so this silently does GFP_KERNEL and might
  deadlock in some cases
* keep the context constraint of GFP_NOFS, used by scrub
* we want to use GFP_KERNEL unconditionally inside init_ipath or its
  callees

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c