diff options
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 8b79d87eaf46..0c62868b5c56 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -136,7 +136,6 @@ int ceph_open(struct inode *inode, struct file *file) | |||
136 | struct ceph_mds_client *mdsc = fsc->mdsc; | 136 | struct ceph_mds_client *mdsc = fsc->mdsc; |
137 | struct ceph_mds_request *req; | 137 | struct ceph_mds_request *req; |
138 | struct ceph_file_info *cf = file->private_data; | 138 | struct ceph_file_info *cf = file->private_data; |
139 | struct inode *parent_inode = NULL; | ||
140 | int err; | 139 | int err; |
141 | int flags, fmode, wanted; | 140 | int flags, fmode, wanted; |
142 | 141 | ||
@@ -210,10 +209,7 @@ int ceph_open(struct inode *inode, struct file *file) | |||
210 | ihold(inode); | 209 | ihold(inode); |
211 | 210 | ||
212 | req->r_num_caps = 1; | 211 | req->r_num_caps = 1; |
213 | if (flags & O_CREAT) | 212 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
214 | parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry); | ||
215 | err = ceph_mdsc_do_request(mdsc, parent_inode, req); | ||
216 | iput(parent_inode); | ||
217 | if (!err) | 213 | if (!err) |
218 | err = ceph_init_file(inode, file, req->r_fmode); | 214 | err = ceph_init_file(inode, file, req->r_fmode); |
219 | ceph_mdsc_put_request(req); | 215 | ceph_mdsc_put_request(req); |
@@ -279,7 +275,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, | |||
279 | if (err) | 275 | if (err) |
280 | goto out_req; | 276 | goto out_req; |
281 | 277 | ||
282 | if (err == 0 && (flags & O_CREAT) && !req->r_reply_info.head->is_dentry) | 278 | if ((flags & O_CREAT) && !req->r_reply_info.head->is_dentry) |
283 | err = ceph_handle_notrace_create(dir, dentry); | 279 | err = ceph_handle_notrace_create(dir, dentry); |
284 | 280 | ||
285 | if (d_unhashed(dentry)) { | 281 | if (d_unhashed(dentry)) { |
@@ -956,6 +952,12 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from) | |||
956 | /* We can write back this queue in page reclaim */ | 952 | /* We can write back this queue in page reclaim */ |
957 | current->backing_dev_info = inode_to_bdi(inode); | 953 | current->backing_dev_info = inode_to_bdi(inode); |
958 | 954 | ||
955 | if (iocb->ki_flags & IOCB_APPEND) { | ||
956 | err = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE, false); | ||
957 | if (err < 0) | ||
958 | goto out; | ||
959 | } | ||
960 | |||
959 | err = generic_write_checks(iocb, from); | 961 | err = generic_write_checks(iocb, from); |
960 | if (err <= 0) | 962 | if (err <= 0) |
961 | goto out; | 963 | goto out; |