lkml.org 
[lkml]   [2010]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -V7 3/9] vfs: Add name to file handle conversion support
On Wed, May 12, 2010 at 03:49:49PM -0600, Andreas Dilger wrote:
> On 2010-05-12, at 09:50, Aneesh Kumar K.V wrote:
> > +static long do_sys_name_to_handle(struct path *path,
> > + struct file_handle __user *ufh)
> > +{
> > + if (handle_size <= f_handle.handle_size) {
> > + /* get the uuid */
> > + retval = sb->s_op->get_fsid(sb, &this_fs_id);
> > + if (!retval) {
> > + /*
> > + * Now verify whether we get the same vfsmount
> > + * if we lookup with uuid. In case we end up having
> > + * same uuid for the multiple file systems. When doing
> > + * uuid based lookup we would return the first one.So
> > + * with name_to_handle if we don't find the same
> > + * vfsmount with lookup return EOPNOTSUPP
> > + */
> > + mnt = fs_get_vfsmount(current, &this_fs_id);
> > + if (mnt != path->mnt) {
> > + retval = -EOPNOTSUPP;
> > + mntput(mnt);
> > + goto err_free_out;
> > + }
>
> I don't see that this does anything for us except add overhead.
> This is no protection against mounting a second filesystem with
> the same UUID after the handle is returned, since there is no
> expiration for file handles.
>
> At best I think we could start by changing the list-based UUID
> lookup with a hash-based one, and when adding a duplicate UUID at
> mount time start by printing out an error message to the console
> in case of duplicated UUIDs, and maybe at some point in the future
> this might cause the mount to fail (though I don't think we can
> make that decision lightly or quickly).
>
> That moves the overhead to mount time instead of for each
> name_to_handle() call (which would be brutal for a system with
> many filesystems mounted).

That will pretty much match exactly what XFS already does. Can we
start by moving the XFS functionality (xfs_uuid_mount(), "nouuid"
mount option, etc) to the VFS level and then optimise from there?

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com


\
 
 \ /
  Last update: 2010-05-13 02:23    [W:0.098 / U:20.964 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site