From: Anoop C S Date: Tue, 18 Sep 2018 16:23:54 +0000 (+0530) Subject: s3/locking: Fix logging of lock reference count X-Git-Tag: tdb-1.3.17~1474 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=380066d2e5065e987f9249d8edb68f545b3b6b76;p=thirdparty%2Fsamba.git s3/locking: Fix logging of lock reference count lock reference count is always increased and reduced by a value of 1. But lock_ref_count variable holds the old value prior to change and was being logged wrongly under debug level 10. DEBUG statement must log lock_ref_count+1 and lock_ref_count-1 respectively when value gets increased and decreased. Signed-off-by: Anoop C S Reviewed-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/source3/locking/posix.c b/source3/locking/posix.c index a9fb58c8381..a7bb5519bb4 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -432,7 +432,7 @@ static void increment_lock_ref_count(const files_struct *fsp) SMB_ASSERT(lock_ref_count < INT32_MAX); DEBUG(10,("lock_ref_count for file %s = %d\n", - fsp_str_dbg(fsp), (int)lock_ref_count)); + fsp_str_dbg(fsp), (int)(lock_ref_count + 1))); } /**************************************************************************** @@ -453,7 +453,7 @@ static void decrement_lock_ref_count(const files_struct *fsp) SMB_ASSERT(lock_ref_count > 0); DEBUG(10,("lock_ref_count for file %s = %d\n", - fsp_str_dbg(fsp), (int)lock_ref_count)); + fsp_str_dbg(fsp), (int)(lock_ref_count - 1))); } /****************************************************************************