From 6526432682760f182fdd9152b923fa3468c042ff Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 22 May 2012 12:27:06 -0700 Subject: Fix an invalid state only reachable on server crash/abort. Remove any delete-on-close tokens and clear the count if there are no valid share modes. Signed-off-by: Stefan Metzmacher --- source3/locking/locking.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3') diff --git a/source3/locking/locking.c b/source3/locking/locking.c index df21104028..9074d2f0c0 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -653,6 +653,17 @@ bool share_mode_stale_pid(struct share_mode_data *d, unsigned i) (unsigned)d->num_share_modes)); *e = d->share_modes[d->num_share_modes-1]; d->num_share_modes -= 1; + + if (d->num_share_modes == 0 && + d->num_delete_tokens) { + /* + * We cannot have any delete tokens + * if there are no valid share modes. + */ + TALLOC_FREE(d->delete_tokens); + d->num_delete_tokens = 0; + } + d->modified = true; return true; } -- cgit