]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: change conditional to check for is locked.
authorChristopher Hoffman <choffman@redhat.com>
Wed, 8 Jan 2025 15:32:23 +0000 (15:32 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Wed, 5 Nov 2025 13:59:34 +0000 (13:59 +0000)
Fixes: https://tracker.ceph.com/issues/64137
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/client/Client.cc
src/client/fuse_ll.cc

index 5e47e6766b4e31f806c508130a6ed8e1bb18c7f9..d11f94a7b946a0e7ce619c38fccbbcf65493dd7c 100644 (file)
@@ -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) {
index 0379edf86f0ce304302b4aa398dd71c8a39639d5..5b7e35ecbe0e745df469322a79ddde7d721818dc 100644 (file)
@@ -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);