From: Christoph Hellwig Date: Thu, 27 Feb 2020 01:30:45 +0000 (-0800) Subject: xfs: switch xfs_attrmulti_attr_get to lazy attr buffer allocation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5680c39073611b1490a311d351d648f602aa8d13;p=linux.git 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 --- 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;