From: Patrick Donnelly Date: Wed, 19 Feb 2025 17:49:09 +0000 (-0500) Subject: client: init dentry shared_gen with invalid value X-Git-Tag: v19.2.3~288^2~41 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=944ef3bcbac78adc169ac44572ca95757cc6ca30;p=ceph.git client: init dentry shared_gen with invalid value 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 (cherry picked from commit 4f8d1d38a38d44ec9984912effdb9d166128ccb1) --- diff --git a/src/client/Dentry.h b/src/client/Dentry.h index 745c611574261..9668953b4128d 100644 --- a/src/client/Dentry.h +++ b/src/client/Dentry.h @@ -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;