Hi Miklos, I was pleasantly surprised to find that this works as-is. I simplified this to call ceph_lookup_open for the atomic O_CREAT case as well, and it passes my basic battery of tests. An incremental patch is below. I haven't looked closely at the vfs bits, but from an fs perspective this series looks good to me! Thanks- sage diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 75df600..9d679dd 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -642,37 +642,17 @@ struct file *ceph_atomic_open(struct inode *dir, struct dentry *dentry, struct dentry *res = NULL; struct file *filp; - if (!(flags & O_CREAT)) { - if (dentry->d_name.len > NAME_MAX) - return ERR_PTR(-ENAMETOOLONG); - - err = ceph_init_dentry(dentry); - if (err < 0) - return ERR_PTR(err); - - return ceph_lookup_open(dir, dentry, od, flags, mode); - } - - if (d_unhashed(dentry)) { - res = ceph_lookup(dir, dentry, NULL); - if (IS_ERR(res)) - return ERR_CAST(res); - - if (res) - dentry = res; - } + dout("atomic_open %p dentry %p '%.*s'\n", + dir, dentry, dentry->d_name.len, dentry->d_name.name); - /* We don't deal with positive dentries here */ - if (dentry->d_inode) { - finish_no_open(od, res); - return NULL; - } + if (dentry->d_name.len > NAME_MAX) + return ERR_PTR(-ENAMETOOLONG); - *created = true; - filp = ceph_lookup_open(dir, dentry, od, flags, mode); - dput(res); + err = ceph_init_dentry(dentry); + if (err < 0) + return ERR_PTR(err); - return filp; + return ceph_lookup_open(dir, dentry, od, flags, mode); } /* -- 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