]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: During fscrypt set policy check null dentries
authorChristopher Hoffman <choffman@redhat.com>
Wed, 2 Jul 2025 13:50:25 +0000 (13:50 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Wed, 5 Nov 2025 13:59:35 +0000 (13:59 +0000)
During the dir empty check in set policy check null dentries.

Fixes: https://tracker.ceph.com/issues/71926
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/client/Client.cc

index d01f0b0d0d32b9ec6efe801ce959ea80e79864b5..a60a912fd1f4fc9286c806bdc510689a41b65b4e 100644 (file)
@@ -18322,8 +18322,9 @@ int Client::ll_set_fscrypt_policy_v2(Inode *in, const struct fscrypt_policy_v2&
     return 0;
   }
 
-  if (in->is_dir() && in->dir && in->dir->dentries.size() > 0)
+  if (in->dir && in->dir->dentries.size() != in->dir->num_null_dentries) {
     return -ENOTEMPTY;
+  }
 
   FSCryptContext fsc(cct);
   fsc.init(policy);