@@ -2247,7 +2247,8 @@ static void ceph_zero_pagecache_range(struct inode *inode, loff_t offset,
ceph_zero_partial_page(inode, offset, length);
}
-int ceph_zero_partial_object(struct inode *inode, loff_t offset, loff_t *length)
+static int ceph_zero_partial_object(struct inode *inode,
+ loff_t offset, loff_t *length)
{
struct ceph_inode_info *ci = ceph_inode(inode);
struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
@@ -2391,6 +2391,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr, struct ceph_iattr *c
cpu_to_le64(round_up(isize,
CEPH_FSCRYPT_BLOCK_SIZE));
req->r_fscrypt_file = attr->ia_size;
+ /* FIXME: client must zero out any partial blocks! */
} else {
req->r_args.setattr.size = cpu_to_le64(attr->ia_size);
req->r_args.setattr.old_size = cpu_to_le64(isize);
@@ -2479,28 +2480,8 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr, struct ceph_iattr *c
ceph_mdsc_put_request(req);
ceph_free_cap_flush(prealloc_cf);
- if (err >= 0 && (mask & (CEPH_SETATTR_SIZE|CEPH_SETATTR_FSCRYPT_FILE))) {
+ if (err >= 0 && (mask & CEPH_SETATTR_SIZE))
__ceph_do_pending_vmtruncate(inode);
- if (mask & CEPH_SETATTR_FSCRYPT_FILE) {
- loff_t orig_len, len;
-
- len = round_up(attr->ia_size, CEPH_FSCRYPT_BLOCK_SIZE) - attr->ia_size;
- orig_len = len;
-
- /*
- * FIXME: this is just doing the truncating the last OSD
- * object, but for "real" fscrypt support, we need
- * to do a RMW with the end of the block zeroed out.
- */
- if (len) {
- err = ceph_zero_partial_object(inode, attr->ia_size, &len);
- /* This had better not be shortened */
- WARN_ONCE(!err && len != orig_len,
- "attr->ia_size=%lld orig_len=%lld len=%lld\n",
- attr->ia_size, orig_len, len);
- }
- }
- }
return err;
}
@@ -1236,7 +1236,6 @@ extern int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
extern int ceph_release(struct inode *inode, struct file *filp);
extern void ceph_fill_inline_data(struct inode *inode, struct page *locked_page,
char *data, size_t len);
-int ceph_zero_partial_object(struct inode *inode, loff_t offset, loff_t *length);
/* dir.c */
extern const struct file_operations ceph_dir_fops;
From: Xiubo Li <xiubli@redhat.com> This reverts commit c97968122078ce0380cd8db405b8505a8b0a55d8. --- fs/ceph/file.c | 3 ++- fs/ceph/inode.c | 23 ++--------------------- fs/ceph/super.h | 1 - 3 files changed, 4 insertions(+), 23 deletions(-)