On Wed, Feb 26, 2020 at 11:33:10AM +1100, Dave Chinner wrote: > > - error = xfs_attr_get(XFS_I(inode), name, namelen, &kbuf, (int *)len, > > - flags); > > + error = xfs_attr_get(&args); > > if (error) > > goto out_kfree; > > > > - if (copy_to_user(ubuf, kbuf, *len)) > > + *len = args.valuelen; > > + if (copy_to_user(ubuf, args.value, args.valuelen)) > > error = -EFAULT; > > > > out_kfree: > > - kmem_free(kbuf); > > + kmem_free(args.value); > > return error; > > This would seem like a prime candidate for ATTR_ALLOC conversion? I'll add a patch to the end of the series to use lazy allocation here.