Re: [PATCH 04/25] vfs: add i_op->atomic_open()

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

 



On Tue, 2012-03-13 at 16:11 +0100, Miklos Szeredi wrote:
> "Myklebust, Trond" <Trond.Myklebust@xxxxxxxxxx> writes:
> 
> > On Wed, 2012-03-07 at 22:22 +0100, Miklos Szeredi wrote:
> >> +
> >> +	if ((nd->flags & LOOKUP_OPEN) && dir_inode->i_op->atomic_open) {
> >> +		struct file *filp;
> >> +
> >> +		filp = atomic_open(nd, dentry, op, want_write, &create_error);
> >> +		if (filp) {
> >> +			dput(dentry);
> >> +			return filp;
> >> +		}
> >> +		/* fall back to plain lookup */
> >> +	}
> >
> > Would it be possible to allow the filesystem to return a new dentry even
> > if it can't complete the actual open? That way we can return the actual
> > symlink that caused the open to fail instead of looking it up separately
> > (which may be subject to races).
> 
> This should be possible, but I'm reluctant to add more arguments to
> ->atomic_open.  Other possibilites that come to mind:
> 
>   return -ELOOKEDUP - caller should retry d_lookup and proceed with the result
> 
>   call opendata_set_dentry(od, dentry) and return NULL - caller checks
>   opendata for non-NULL dentry and proceeds with that

Or convert the existing 'dentry' argument into a struct dentry **.

Then again, it might just be easier to convert the existing arguments
into a single "open" structure.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com

��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[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