]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Use share_entry_stale_pid() in share_mode_stale_pid()
authorVolker Lendecke <vl@samba.org>
Tue, 13 Aug 2019 14:04:13 +0000 (16:04 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 17 Sep 2019 22:49:36 +0000 (22:49 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/locking.c

index 0cb6c6ff2f33e01e4811b23e86bfc78babce1768..547741ecbc7e7250436b438406087d4d73960a7e 100644 (file)
@@ -744,8 +744,8 @@ bool share_entry_stale_pid(struct share_mode_entry *e)
  */
 bool share_mode_stale_pid(struct share_mode_data *d, uint32_t idx)
 {
-       struct server_id_buf tmp;
        struct share_mode_entry *e;
+       bool stale;
 
        if (idx > d->num_share_modes) {
                DBG_WARNING("Asking for index %"PRIu32", "
@@ -755,27 +755,12 @@ bool share_mode_stale_pid(struct share_mode_data *d, uint32_t idx)
                return false;
        }
        e = &d->share_modes[idx];
-       if (e->stale) {
-               /*
-                * Checked before
-                */
-               return true;
-       }
-       if (serverid_exists(&e->pid)) {
-               DBG_DEBUG("PID %s (index %"PRIu32" out of %"PRIu32") "
-                         "still exists\n",
-                         server_id_str_buf(e->pid, &tmp),
-                         idx,
-                         d->num_share_modes);
+
+       stale = share_entry_stale_pid(e);
+       if (!stale) {
                return false;
        }
-       DBG_DEBUG("PID %s (index %"PRIu32" out of %"PRIu32") "
-                 "does not exist anymore\n",
-                 server_id_str_buf(e->pid, &tmp),
-                 idx,
-                 d->num_share_modes);
-
-       e->stale = true;
+       d->modified = true;
 
        if (d->num_delete_tokens != 0) {
                uint32_t i;