]> git.baikalelectronics.ru Git - kernel.git/commit
xen/blkfront: fix memory allocation flags in blkfront_setup_indirect()
authorJuergen Gross <jgross@suse.com>
Fri, 3 Apr 2020 09:00:34 +0000 (11:00 +0200)
committerJuergen Gross <jgross@suse.com>
Tue, 7 Apr 2020 10:12:58 +0000 (12:12 +0200)
commit0596fc2ea13aece3b00cc17ffad7bc69abf5526b
tree42b217b053050c30393d355e66d41dd7cd23c36c
parent362c9283ce7525e91a160d09ab1198154d682387
xen/blkfront: fix memory allocation flags in blkfront_setup_indirect()

Commit e0bdbbcd3b399 ("xen-blkfront: switch kcalloc to kvcalloc for
large array allocation") didn't fix the issue it was meant to, as the
flags for allocating the memory are GFP_NOIO, which will lead the
memory allocation falling back to kmalloc().

So instead of GFP_NOIO use GFP_KERNEL and do all the memory allocation
in blkfront_setup_indirect() in a memalloc_noio_{save,restore} section.

Fixes: e0bdbbcd3b399 ("xen-blkfront: switch kcalloc to kvcalloc for large array allocation")
Cc: stable@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Link: https://lore.kernel.org/r/20200403090034.8753-1-jgross@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/block/xen-blkfront.c