[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y5r47cyg.fsf@tucsk.pomaz.szeredi.hu>
Date: Tue, 13 Mar 2012 16:11:35 +0100
From: Miklos Szeredi <miklos@...redi.hu>
To: "Myklebust\, Trond" <Trond.Myklebust@...app.com>
Cc: "viro\@ZenIV.linux.org.uk" <viro@...IV.linux.org.uk>,
"linux-fsdevel\@vger.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
"hch\@infradead.org" <hch@...radead.org>,
"sfrench\@samba.org" <sfrench@...ba.org>,
"sage\@newdream.net" <sage@...dream.net>,
"ericvh\@gmail.com" <ericvh@...il.com>
Subject: Re: [PATCH 04/25] vfs: add i_op->atomic_open()
"Myklebust, Trond" <Trond.Myklebust@...app.com> 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
Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists