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=d1dbf638dc315e42d49a520999c273bbe3e433e6;p=ceph.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 98580a73ceb..81fac6d17e5 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5698,6 +5698,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()); }