From: Jeremy Allison Date: Sat, 16 Jun 2007 01:04:22 +0000 (+0000) Subject: r23516: Fix bug found & fixed by Doug Rudoff (doug_rudoff@isilon.com) X-Git-Tag: samba-4.0.0alpha6~801^2~5605 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9dee722b09b86622513f5d1b7ecab4dbf0787645;p=thirdparty%2Fsamba.git 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) --- diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index e0cc4eec1e0..202fab36ccd 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; }