From 5680c39073611b1490a311d351d648f602aa8d13 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 26 Feb 2020 17:30:45 -0800 Subject: [PATCH] xfs: switch xfs_attrmulti_attr_get to lazy attr buffer allocation Let the low-level attr code only allocate the needed buffer size for xfs_attrmulti_attr_get instead of allocating the upper bound at the top of the call chain. Suggested-by: Dave Chinner Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_ioctl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index ef8e378c42cb7..5a1d2b9cb05a0 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -481,10 +481,6 @@ xfs_attrmulti_attr_get( if (*len > XFS_XATTR_SIZE_MAX) return -EINVAL; - args.value = kmem_zalloc_large(*len, 0); - if (!args.value) - return -ENOMEM; - error = xfs_attr_get(&args); if (error) goto out_kfree; -- 2.30.2