]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
commit3a169c0be75b59dd85d159493634870cdec6d3c4
tree42b217b053050c30393d355e66d41dd7cd23c36c
parent0102e4efda76d0721bc744dd80258eb6cfa25fc3
xen/blkfront: fix memory allocation flags in blkfront_setup_indirect()

Commit 1d5c76e664333 ("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: 1d5c76e664333 ("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