For now the userland clients hasn't support the fscrypt yet, they
will be only allowed to read the encrypted files.
Signed-off-by: Xiubo Li <xiubli@redhat.com>
waitfor_caps = true;
}
- if ((need & CEPH_CAP_FILE_WR) && in->auth_cap &&
- in->auth_cap->session->readonly)
+ if ((need & CEPH_CAP_FILE_WR) &&
+ ((in->auth_cap && in->auth_cap->session->readonly) ||
+ // userland clients are only allowed to read if fscrypt enabled
+ in->is_fscrypt_enabled()))
return -CEPHFS_EROFS;
if (in->flags & I_CAP_DROPPED) {