]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nfs/blocklayout: Use the passed in gfp flags
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 24 Jul 2023 08:08:46 +0000 (11:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 08:46:57 +0000 (10:46 +0200)
[ Upstream commit 08b45fcb2d4675f6182fe0edc0d8b1fe604051fa ]

This allocation should use the passed in GFP_ flags instead of
GFP_KERNEL.  One places where this matters is in filelayout_pg_init_write()
which uses GFP_NOFS as the allocation flags.

Fixes: 5c83746a0cf2 ("pnfs/blocklayout: in-kernel GETDEVICEINFO XDR parsing")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/blocklayout/dev.c

index 70c4165d2d742d3812fb7ebe850e359af2e60a25..a16c852412628d04ae2355fdc800885bd735d8d5 100644 (file)
@@ -422,7 +422,7 @@ bl_parse_concat(struct nfs_server *server, struct pnfs_block_dev *d,
        int ret, i;
 
        d->children = kcalloc(v->concat.volumes_count,
-                       sizeof(struct pnfs_block_dev), GFP_KERNEL);
+                       sizeof(struct pnfs_block_dev), gfp_mask);
        if (!d->children)
                return -ENOMEM;
 
@@ -451,7 +451,7 @@ bl_parse_stripe(struct nfs_server *server, struct pnfs_block_dev *d,
        int ret, i;
 
        d->children = kcalloc(v->stripe.volumes_count,
-                       sizeof(struct pnfs_block_dev), GFP_KERNEL);
+                       sizeof(struct pnfs_block_dev), gfp_mask);
        if (!d->children)
                return -ENOMEM;