Message ID | 20211108135012.79941-3-xiubli@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ceph: misc fixes for the fscrypt truncate size handling | expand |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index b371f596b97d..1b4ce453d397 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2560,7 +2560,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr, struct ceph_iattr *c mask |= CEPH_SETATTR_SIZE; release |= CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL | CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR; - if (IS_ENCRYPTED(inode)) { + if (IS_ENCRYPTED(inode) && attr->ia_size) { set_bit(CEPH_MDS_R_FSCRYPT_FILE, &req->r_req_flags); mask |= CEPH_SETATTR_FSCRYPT_FILE; req->r_args.setattr.size =