subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r961629 - /subversion/trunk/subversion/libsvn_wc/lock.c
Date Thu, 08 Jul 2010 08:35:38 GMT
Author: rhuijben
Date: Thu Jul  8 08:35:38 2010
New Revision: 961629

URL: http://svn.apache.org/viewvc?rev=961629&view=rev
Log:
* subversion/libsvn_wc/lock.c
  (adm_access_alloc): Following up on r958908, only allow creating an
    access baton for a locked directory if there is no existing access
    baton for that directory attached to the db.

Modified:
    subversion/trunk/subversion/libsvn_wc/lock.c

Modified: subversion/trunk/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.c?rev=961629&r1=961628&r2=961629&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.c (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.c Thu Jul  8 08:35:38 2010
@@ -314,10 +314,17 @@ adm_access_alloc(svn_wc_adm_access_t **a
       /* If the db already owns a lock, we can't add an extra lock record */
       SVN_ERR(svn_wc__db_temp_own_lock(&owns_lock, db, path, scratch_pool));
 
-      if (!owns_lock)
-        SVN_ERR(svn_wc__db_wclock_set(db, lock->abspath, 0, scratch_pool));
+      /* If DB owns the lock, but when there is no access baton open for this
+         directory, old access baton based code is trying to access data that
+         was previously locked by new code. Just hand them the lock, or
+         important code paths like svn_wc_add3() will start failing */
+      if (!owns_lock
+          || svn_wc__adm_retrieve_internal2(db, lock->abspath, scratch_pool))
+        {
+          SVN_ERR(svn_wc__db_wclock_set(db, lock->abspath, 0, scratch_pool));
 
-      SVN_ERR(svn_wc__db_temp_mark_locked(db, lock->abspath, scratch_pool));
+          SVN_ERR(svn_wc__db_temp_mark_locked(db, lock->abspath, scratch_pool));
+        }
     }
 
   err = add_to_shared(lock, scratch_pool);



Mime
View raw message