]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: init dentry shared_gen with invalid value
authorPatrick Donnelly <pdonnell@ibm.com>
Wed, 19 Feb 2025 17:49:09 +0000 (12:49 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Thu, 27 Feb 2025 18:41:56 +0000 (13:41 -0500)
Directories and dentries are initialized with value 0 which makes detecting a
null  (or placeholder) dentry created via Client::get_or_create difficult.  We
already do checks to see if a dentry is invalid when the directory's shared_gen
changes so use an invalid value for these synthetic dentries until they can be
appropriately updated from Client::update_dentry_lease.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/client/Dentry.h

index 745c611574261ca1bd8d677d6437dea3974cb08d..9668953b4128d2aa4c4d621af2fad5fbd00073fc 100644 (file)
@@ -105,7 +105,7 @@ public:
   utime_t lease_ttl;
   uint64_t lease_gen = 0;
   ceph_seq_t lease_seq = 0;
-  int cap_shared_gen = 0;
+  int cap_shared_gen = -1;
   std::string alternate_name;
   bool is_renaming = false;