1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

smbd: Avoid checking the_lock->id for fresh locks

If we just fetched the lock, this check will always be true.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2014-03-20 14:53:14 +01:00 committed by Jeremy Allison
parent c416b34648
commit ede6f44821

View File

@ -385,15 +385,16 @@ struct share_mode_lock *get_share_mode_lock(
}
talloc_set_destructor(the_lock, the_lock_destructor);
} else {
if (!file_id_equal(&the_lock->data->id, &id)) {
DEBUG(1, ("Can not lock two share modes "
"simultaneously\n"));
goto fail;
}
if (talloc_reference(lck, the_lock) == NULL) {
DEBUG(1, ("talloc_reference failed\n"));
goto fail;
}
}
if (!file_id_equal(&the_lock->data->id, &id)) {
DEBUG(1, ("Can not lock two share modes simultaneously\n"));
goto fail;
}
lck->data = the_lock->data;
return lck;
fail: