Re: [RFC PATCH 1/3] vfs: Add name to file handle conversion support

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

 



On Sat, 20 Feb 2010 11:15:33 -0700, Andreas Dilger <adilger@xxxxxxx> wrote:
> On 2010-02-18, at 22:42, Aneesh Kumar K.V wrote:
> > +static int do_sys_name_to_handle(const char __user *name,
> > +				struct file_handle *handle)
> > +{
> > +	/* we ask for a non connected handle */
> > +	retval = exportfs_encode_fh(path.dentry, (struct fid *)f_handle,
> > +				&handle_size,  0);
> > +	if (handle_size < handle->handle_size) {
> > +		if (copy_to_user(handle->f_handle, f_handle,
> > +					handle_size*sizeof(u32)))
> > +			retval = -EFAULT;
> 
> Shouldn't this be "handle_size <= handle->handle_size"?


Yes. Will fix in the next iteration.

> 
> > +SYSCALL_DEFINE2(name_to_handle, const char __user *, name,
> > +		struct file_handle __user *, handle)
> > +{
> > +	ret = do_sys_name_to_handle(name, &f_handle);
> > +	if (copy_to_user(&handle->handle_type,
> > +			&f_handle.handle_type, sizeof(f_handle.handle_type)) ||
> > +		copy_to_user(&handle->handle_size,
> > +			&f_handle.handle_size, sizeof(f_handle.handle_size)))
> 
> It seems strange to do the copy_to_user() of f_handle in  
> do_sys_name_to_handle(), but the handle_size and handle_type in  
> name_to_handle()?  Is there a reason it was split this way?
> 

No specific reason.

-aneesh

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux