aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 6c90cf09060..9b667e9abf4 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -223,7 +223,6 @@ struct dentry *ceph_lookup_open(struct inode *dir, struct dentry *dentry,
223 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); 223 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb);
224 struct ceph_mds_client *mdsc = fsc->mdsc; 224 struct ceph_mds_client *mdsc = fsc->mdsc;
225 struct file *file = nd->intent.open.file; 225 struct file *file = nd->intent.open.file;
226 struct inode *parent_inode = get_dentry_parent_inode(file->f_dentry);
227 struct ceph_mds_request *req; 226 struct ceph_mds_request *req;
228 int err; 227 int err;
229 int flags = nd->intent.open.flags - 1; /* silly vfs! */ 228 int flags = nd->intent.open.flags - 1; /* silly vfs! */
@@ -242,7 +241,9 @@ struct dentry *ceph_lookup_open(struct inode *dir, struct dentry *dentry,
242 req->r_dentry_unless = CEPH_CAP_FILE_EXCL; 241 req->r_dentry_unless = CEPH_CAP_FILE_EXCL;
243 } 242 }
244 req->r_locked_dir = dir; /* caller holds dir->i_mutex */ 243 req->r_locked_dir = dir; /* caller holds dir->i_mutex */
245 err = ceph_mdsc_do_request(mdsc, parent_inode, req); 244 err = ceph_mdsc_do_request(mdsc,
245 (flags & (O_CREAT|O_TRUNC)) ? dir : NULL,
246 req);
246 dentry = ceph_finish_lookup(req, dentry, err); 247 dentry = ceph_finish_lookup(req, dentry, err);
247 if (!err && (flags & O_CREAT) && !req->r_reply_info.head->is_dentry) 248 if (!err && (flags & O_CREAT) && !req->r_reply_info.head->is_dentry)
248 err = ceph_handle_notrace_create(dir, dentry); 249 err = ceph_handle_notrace_create(dir, dentry);