Re: [PATCH 11/30] xfs: pass an initialized xfs_da_args to xfs_attr_get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux