Fixes: https://tracker.ceph.com/issues/64137
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
if ((need & CEPH_CAP_FILE_WR) &&
((in->auth_cap && in->auth_cap->session->readonly) ||
- // userland clients are only allowed to read if fscrypt enabled but no fscrypt ctx exists
// (is locked)
- (in->is_fscrypt_enabled() && !in->fscrypt_ctx)))
+ (in->is_fscrypt_enabled() && is_inode_locked(in))))
return -EROFS;
if (in->flags & I_CAP_DROPPED) {
Fh *fh = (Fh*)fi->fh;
Inode *in = fh->inode.get();
- if (in->fscrypt_ctx) {
+ if (in->is_fscrypt_enabled()) {
in->fscrypt_ctx->convert_to(&out_arg.policy.v2);
out_arg.policy_size = sizeof(out_arg.policy);