From: Sage Weil Date: Tue, 26 Jul 2011 18:27:59 +0000 (-0700) Subject: ceph: only link open operations to directory unsafe list if O_CREAT|O_TRUNC X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9bae113a085b790de384bf86f09e15b42a65a985;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ceph: only link open operations to directory unsafe list if O_CREAT|O_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 Signed-off-by: Sage Weil --- diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 9b667e9abf4c..e0115eb4e9ba 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -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);