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 <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
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;