From: Xiubo Li <xiubli@xxxxxxxxxx> Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx> --- fs/ceph/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = -- 2.27.0