]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: add truncate size handling support for fscrypt
authorXiubo Li <xiubli@redhat.com>
Thu, 25 Aug 2022 13:31:15 +0000 (09:31 -0400)
committerXiubo Li <xiubli@redhat.com>
Fri, 26 Aug 2022 23:58:55 +0000 (07:58 +0800)
commitcd00450cd57c8b391597c6f14f65d20d28d329c4
tree161ad4903a2158aed0d33d8be99cbe79469f0399
parenta63cbbd742313371387dba1c6ad9473257acc95c
ceph: add truncate size handling support for fscrypt

This will transfer the encrypted last block contents to the MDS
along with the truncate request only when the new size is smaller
and not aligned to the fscrypt BLOCK size. When the last block is
located in the file hole, the truncate request will only contain
the header.

The MDS could fail to do the truncate if there has another client
or process has already updated the RADOS object which contains
the last block, and will return -EAGAIN, then the kclient needs
to retry it. The RMW will take around 50ms, and will let it retry
20 times for now.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/crypto.h
fs/ceph/inode.c
fs/ceph/super.h