From: Christopher Hoffman Date: Wed, 18 Dec 2024 15:03:15 +0000 (+0000) Subject: client: clear logical size on open(O_TRUNC) X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e5c2ff8e90238c010f7dfdcb493388db41e59398;p=ceph-ci.git client: clear logical size on open(O_TRUNC) Fixes: https://tracker.ceph.com/issues/65613 Signed-off-by: Christopher Hoffman --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 77a93ceb76d..c1931003bcd 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5688,6 +5688,8 @@ void Server::do_open_truncate(const MDRequestRef& mdr, int cmode) uint64_t old_size = std::max(pi.inode->size, mdr->client_request->head.args.open.old_size); if (old_size > 0) { + if (pi.inode->fscrypt_file.size() >= sizeof(uint64_t)) + *(ceph_le64 *)pi.inode->fscrypt_file.data() = 0; pi.inode->truncate(old_size, 0); le->metablob.add_truncate_start(in->ino()); }