lkml.org 
[lkml]   [2010]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -V7 3/9] vfs: Add name to file handle conversion support
From
Date
On 2010-05-13, at 12:17, Aneesh Kumar K. V wrote:
> How about below interface
>
> sys_open_by_handle_at(int mountdirfd, struct file_handle *handle, int
> flags)
>
> if mountdirfd == 0
> use UUID specified in the file handle to lookup vfsmount
> else
> else use mountdirfd to get the vfsmount

fd = 0 is a valid descriptor, though -1 is not. I'd be OK with this, because it still means we can use the UUID to positively identify the filesystem (it would also avoid the need to do a by-UUID lookup in most cases, since the dirfd would already point to a filesystem and we can just compare the handle UUID with the UUID for that superblock.

The question is what to do if the UUID in the file handle does not match the filesystem that is passed via vfsmount? It would seem that vfsmount is needed for determining the namespace and possibly disambiguating multiple mounts of snapshots with the same UUID. Independent of that if the UUID is not matching the underlying filesystem that the vfsmount is pointing to the open should fail with -ESTALE.

If the UUID is not the same, then the chance that the inode/generation stored in the file handle are still useful is slim. If someone is cloning the filesystem down to the inode number, then they can clone the UUID as well.

In summary, I'm OK with this approach.

Cheers, Andreas
--
Andreas Dilger
Lustre Technical Lead
Oracle Corporation Canada Inc.



\
 
 \ /
  Last update: 2010-05-14 00:57    [W:0.094 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site