// truncate cached file data
if (prior_size > size) {
- _invalidate_inode_cache(in, truncate_size, prior_size - truncate_size);
+ _invalidate_inode_cache(in, size, prior_size - size);
}
}
mds_rank_t mds = session->mds_num;
ceph_assert(in->caps.count(mds));
+ uint64_t size = m->get_size();
+ if (in->is_fscrypt_enabled()) {
+ size = std::stoll(std::string(std::rbegin(m->fscrypt_file),
+ std::rend(m->fscrypt_file)));
+ }
ldout(cct, 10) << __func__ << " on ino " << *in
<< " size " << in->size << " -> " << m->get_size()
<< dendl;
-
+
int issued;
in->caps_issued(&issued);
issued |= in->caps_dirty();
- update_inode_file_size(in, issued, m->get_size(),
- m->get_truncate_seq(), m->get_truncate_size());
+ update_inode_file_size(in, issued, size, m->get_truncate_seq(),
+ m->get_truncate_size());
}
void Client::handle_cap_flush_ack(MetaSession *session, Inode *in, Cap *cap, const MConstRef<MClientCaps>& m)
std::vector<uint8_t> fscrypt_auth;
std::vector<uint8_t> fscrypt_file;
+ bool is_fscrypt_enabled() {
+ return !!fscrypt_auth.size();
+ }
bool is_root() const { return ino == CEPH_INO_ROOT; }
bool is_symlink() const { return (mode & S_IFMT) == S_IFLNK; }