The branch, v3-5-test has been updated
       via  df0430e... Turn on LOCK9 test which will test for regressions in 
bug 6828. Jeremy.
       via  573c2cc... Fix bug 6828 - infinite timeout occurs when byte lock 
held outside of samba Jeremy.
      from  8db60c4... Fix comments on new test. Jeremy

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit df0430e1c3753d4adbcbbdc717bab466c3a934ff
Author: Jeremy Allison <[email protected]>
Date:   Tue Oct 20 17:53:06 2009 -0700

    Turn on LOCK9 test which will test for regressions in bug 6828.
    Jeremy.

commit 573c2cc5c54ea3d46ac729c3e0e5a8eb6b6799ea
Author: Jeremy Allison <[email protected]>
Date:   Tue Oct 20 17:52:34 2009 -0700

    Fix bug 6828 - infinite timeout occurs when byte lock held outside of samba
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source3/script/tests/selftest.sh           |    2 ++
 source3/script/tests/test_smbtorture_s3.sh |    4 ++--
 source3/smbd/blocking.c                    |   26 ++++++++++++++++++--------
 3 files changed, 22 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh
index 43e7bf1..73d0aa4 100755
--- a/source3/script/tests/selftest.sh
+++ b/source3/script/tests/selftest.sh
@@ -89,6 +89,7 @@ NSS_WRAPPER_PASSWD="$PRIVATEDIR/passwd"
 NSS_WRAPPER_GROUP="$PRIVATEDIR/group"
 WINBINDD_SOCKET_DIR=$PREFIX_ABS/winbindd
 WINBINDD_PRIV_PIPE_DIR=$LOCKDIR/winbindd_privileged
+TEST_DIRECTORY=$DIRECTORY
 
 export PREFIX PREFIX_ABS
 export CONFIGURATION CONFFILE SAMBA4CONFIGURATION SAMBA4CONFFILE
@@ -99,6 +100,7 @@ export USERNAME PASSWORD
 export WORKGROUP SERVER SERVER_IP
 export NSS_WRAPPER_PASSWD NSS_WRAPPER_GROUP
 export WINBINDD_SOCKET_DIR WINBINDD_PRIV_PIPE_DIR
+export TEST_DIRECTORY
 
 PATH=bin:$PATH
 export PATH
diff --git a/source3/script/tests/test_smbtorture_s3.sh 
b/source3/script/tests/test_smbtorture_s3.sh
index 602433b..a6ac948 100755
--- a/source3/script/tests/test_smbtorture_s3.sh
+++ b/source3/script/tests/test_smbtorture_s3.sh
@@ -24,7 +24,7 @@ incdir=`dirname $0`
 SMB_CONF_PATH="$CONFFILE"
 export SMB_CONF_PATH
 
-tests="FDPASS LOCK1 LOCK2 LOCK3 LOCK4 LOCK5 LOCK6 LOCK7"
+tests="FDPASS LOCK1 LOCK2 LOCK3 LOCK4 LOCK5 LOCK6 LOCK7 LOCK9"
 #tests="$tests UNLINK BROWSE ATTR TRANS2 MAXFID TORTURE "
 tests="$tests UNLINK BROWSE ATTR TRANS2 TORTURE "
 tests="$tests OPLOCK1 OPLOCK2 OPLOCK3 STREAMERROR"
@@ -53,7 +53,7 @@ for t in $tests; do
     fi
     start=""
     name="$t"
-    testit "$name" $VALGRIND $BINDIR/smbtorture $unc -U"$username"%"$password" 
$ADDARGS $t || failed=`expr $failed + 1`
+    testit "$name" $VALGRIND $BINDIR/smbtorture $unc -U"$username"%"$password" 
-l"$PREFIX_ABS"/tmp $ADDARGS $t || failed=`expr $failed + 1`
 done
 
 testok $0 $failed
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index e752194..01d9ca8 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -48,6 +48,22 @@ static void brl_timeout_fn(struct event_context *event_ctx,
 }
 
 /****************************************************************************
+ We need a version of timeval_min that treats zero timval as infinite.
+****************************************************************************/
+
+static struct timeval timeval_brl_min(const struct timeval *tv1,
+                                       const struct timeval *tv2)
+{
+       if (timeval_is_zero(tv1)) {
+               return *tv2;
+       }
+       if (timeval_is_zero(tv2)) {
+               return *tv1;
+       }
+       return timeval_min(tv1, tv2);
+}
+
+/****************************************************************************
  After a change to blocking_lock_queue, recalculate the timed_event for the
  next processing.
 ****************************************************************************/
@@ -70,19 +86,13 @@ static bool recalc_brl_timeout(void)
                         */
                         if (blr->blocking_pid == 0xFFFFFFFF) {
                                struct timeval psx_to = timeval_current_ofs(10, 
0);
-                               next_timeout = timeval_min(&next_timeout, 
&psx_to);
+                               next_timeout = timeval_brl_min(&next_timeout, 
&psx_to);
                         }
 
                        continue;
                }
 
-               if (timeval_is_zero(&next_timeout)) {
-                       next_timeout = blr->expire_time;
-               }
-               else {
-                       next_timeout = timeval_min(&next_timeout,
-                                                  &blr->expire_time);
-               }
+               next_timeout = timeval_brl_min(&next_timeout, 
&blr->expire_time);
        }
 
        if (timeval_is_zero(&next_timeout)) {


-- 
Samba Shared Repository

Reply via email to