summaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorSam Lang <sam.lang@inktank.com>2012-12-28 18:56:46 +0100
committerAlex Elder <elder@inktank.com>2013-01-17 19:42:36 +0100
commit6e8575faa8fa680d59404a4d58d12190667be815 (patch)
tree702820d6f2acc31fcb8a6efd18471d390a54e962 /fs/ceph/file.c
parentceph: Check for err on mds request in atomic_open (diff)
downloadlinux-6e8575faa8fa680d59404a4d58d12190667be815.tar.xz
linux-6e8575faa8fa680d59404a4d58d12190667be815.zip
ceph: Check for created flag in response from mds
The mds now sends back a created inode if the create request performed the create. If the file already existed, no inode is returned in the reply. This allows ceph to set the created flag in atomic_open so that permissions are properly checked in the case that the file wasn't created by the create call to the mds. To ensure compability with previous kernels, a feature for sending back the inode in the create reply was added, so that the mds will only send back the inode if the client indicates it supports the feature. Signed-off-by: Sam Lang <sam.lang@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 2c71cbd78332..22b5b71b5401 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -266,6 +266,9 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
err = finish_no_open(file, dn);
} else {
dout("atomic_open finish_open on dn %p\n", dn);
+ if (req->r_op == CEPH_MDS_OP_CREATE && req->r_reply_info.has_create_ino) {
+ *opened |= FILE_CREATED;
+ }
err = finish_open(file, dentry, ceph_open, opened);
}