summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-03-20 14:57:19 +0100
committerJeremy Allison <jra@samba.org>2014-03-21 19:20:17 +0100
commit698f7f21c2dd3a8eaaccee32bf8dd7d36e8c794e (patch)
tree3fb2158d326fc659e38f3a95650d7585ffa766a8 /source3/locking
parentede6f448215a4ee81a1c7701c1cead2cc0a33198 (diff)
downloadsamba-698f7f21c2dd3a8eaaccee32bf8dd7d36e8c794e.tar.gz
smbd: Keep "the_lock"s file id separately
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/share_mode_lock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index a34f3043b1d..50d5cf1f547 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -351,10 +351,12 @@ static struct share_mode_lock *get_share_mode_lock_internal(
* talloc_reference.
*/
static struct share_mode_lock *the_lock;
+static struct file_id the_lock_id;
static int the_lock_destructor(struct share_mode_lock *l)
{
the_lock = NULL;
+ ZERO_STRUCT(the_lock_id);
return 0;
}
@@ -384,8 +386,9 @@ struct share_mode_lock *get_share_mode_lock(
goto fail;
}
talloc_set_destructor(the_lock, the_lock_destructor);
+ the_lock_id = id;
} else {
- if (!file_id_equal(&the_lock->data->id, &id)) {
+ if (!file_id_equal(&the_lock_id, &id)) {
DEBUG(1, ("Can not lock two share modes "
"simultaneously\n"));
goto fail;