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

r23516: Fix bug found & fixed by Doug Rudoff (doug_rudoff@isilon.com)

- when cleaning up invalid locks make sure we mark the lck
struct as modified so it'll get saved back correctly (that
was the original intent).
Jeremy.
(This used to be commit cbf0829abc)
This commit is contained in:
Jeremy Allison 2007-06-16 01:04:22 +00:00 committed by Gerald (Jerry) Carter
parent b877360b2e
commit 9dee722b09

View File

@ -1646,6 +1646,7 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
memcpy(br_lck->lock_data, data.dptr, data.dsize);
if (!fsp->lockdb_clean) {
int orig_num_locks = br_lck->num_locks;
/* This is the first time we've accessed this. */
/* Go through and ensure all entries exist - remove any that don't. */
@ -1658,6 +1659,11 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
return NULL;
}
/* Ensure invalid locks are cleaned up in the destructor. */
if (orig_num_locks != br_lck->num_locks) {
br_lck->modified = True;
}
/* Mark the lockdb as "clean" as seen from this open file. */
fsp->lockdb_clean = True;
}