summaryrefslogtreecommitdiff
path: root/source3/locking/brlock.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-06-16 01:04:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:24 -0500
commit9dee722b09b86622513f5d1b7ecab4dbf0787645 (patch)
tree4d1b11f30a5bd9ae7bb60a0d09bf4a7942d42a77 /source3/locking/brlock.c
parentb877360b2e5bdf3811ea7a31fb879bce8c12d29d (diff)
downloadsamba-9dee722b09b86622513f5d1b7ecab4dbf0787645.tar.gz
samba-9dee722b09b86622513f5d1b7ecab4dbf0787645.tar.bz2
samba-9dee722b09b86622513f5d1b7ecab4dbf0787645.zip
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 cbf0829abcc3689edd7ab225054dfc79d43c6309)
Diffstat (limited to 'source3/locking/brlock.c')
-rw-r--r--source3/locking/brlock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index e0cc4eec1e..202fab36cc 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -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;
}