From: Xiubo Li Date: Fri, 26 Nov 2021 02:23:25 +0000 (+0800) Subject: client: userland clients are only allowed to read if fscrypt is enabled X-Git-Tag: v18.0.0~1381^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b73a04837d3f1acb66310f7239d24e86a04e45ae;p=ceph.git client: userland clients are only allowed to read if fscrypt is enabled 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 38881a8fb899..857ae774c4af 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3498,8 +3498,10 @@ int Client::get_caps(Fh *fh, int need, int want, int *phave, loff_t endoff) 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) {