s3:locking: make use of share_mode_lock_file_id() in share_mode_watch_send()
authorStefan Metzmacher <metze@samba.org>
Fri, 26 Aug 2022 10:08:03 +0000 (12:08 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:35 +0000 (00:34 +0000)
We should avoid dereference 'struct share_mode_lock' as much as possible.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/share_mode_lock.c

index c7d3ae3bd82de516ca01e0a08baefcb8f4ab9c29..549a360e93f14b570d90ca2d7ea161234c589c15 100644 (file)
@@ -1308,7 +1308,8 @@ struct tevent_req *share_mode_watch_send(
        struct share_mode_lock *lck,
        struct server_id blocker)
 {
-       TDB_DATA key = locking_key(&lck->data->id);
+       struct file_id id = share_mode_lock_file_id(lck);
+       TDB_DATA key = locking_key(&id);
        struct tevent_req *req = NULL, *subreq = NULL;
        struct share_mode_watch_state *state = NULL;