]> git.apps.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>
Mon, 17 Mar 2025 19:43:19 +0000 (15:43 -0400)
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>
(cherry picked from commit 4f8d1d38a38d44ec9984912effdb9d166128ccb1)

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;