Skip to content

Commit

Permalink
ceph: only link open operations to directory unsafe list if O_CREAT|O…
Browse files Browse the repository at this point in the history
…_TRUNC

We only need to put these on the directory unsafe list if they have
side effects that fsync(2) should flush out.

Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Jul 26, 2011
1 parent acda765 commit 9bae113
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ int ceph_open(struct inode *inode, struct file *file)
req->r_inode = inode;
ihold(inode);
req->r_num_caps = 1;
err = ceph_mdsc_do_request(mdsc, parent_inode, req);
err = ceph_mdsc_do_request(mdsc, (flags & (O_CREAT|O_TRUNC)) ?
parent_inode : NULL, req);
if (!err)
err = ceph_init_file(inode, file, req->r_fmode);
ceph_mdsc_put_request(req);
Expand Down

0 comments on commit 9bae113

Please sign in to comment.