From: Christopher Hoffman Date: Wed, 8 Jan 2025 15:32:23 +0000 (+0000) Subject: client: change conditional to check for is locked. X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1d097e745394cf41e8e60b664daff72efac659db;p=ceph.git client: change conditional to check for is locked. Fixes: https://tracker.ceph.com/issues/64137 Signed-off-by: Christopher Hoffman --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 5e47e6766b4..d11f94a7b94 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3996,9 +3996,8 @@ int Client::get_caps(Fh *fh, int need, int want, int *phave, loff_t endoff) 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) { diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index 0379edf86f0..5b7e35ecbe0 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -974,7 +974,7 @@ static void fuse_ll_ioctl(fuse_req_t req, fuse_ino_t ino, 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);