subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1589254 - in /subversion/trunk/subversion: libsvn_fs/fs-loader.c libsvn_fs/fs-loader.h libsvn_fs_base/fs.c libsvn_fs_fs/fs.c libsvn_fs_x/fs.c
Date Tue, 22 Apr 2014 19:15:43 GMT
Author: stefan2
Date: Tue Apr 22 19:15:42 2014
New Revision: 1589254

URL: http://svn.apache.org/r1589254
Log:
Fix a race condition and pool lifetime issue between the FSFS / FSX'
svn_fs_hotcopy implementation and any other FS API call.

The problem is the access to the shared data struct hash.  New entries
must be allocated in a process-global pool (COMMON_POOL) and any access
to it needs to be sync'ed properly (COMMON_POOL_LOCK).

* subversion/libsvn_fs/fs-loader.h
  (fs_library_vtable_t): Add missing parameters to the hotcopy func.
                         It now is similar to all the other entries.

* subversion/libsvn_fs/fs-loader.c
  (svn_fs_hotcopy2): Update the vtable caller.

* subversion/libsvn_fs_fs/fs.c
  (fs_hotcopy): Update signature and use the extra params to open the source
                repo using the properly synchronizing fs_open.

* subversion/libsvn_fs_x/fs.c
  (x_hotcopy): Same.

* subversion/libsvn_fs_base/fs.c
  (base_hotcopy): Update signature, but we don't need it extra params here.

Modified:
    subversion/trunk/subversion/libsvn_fs/fs-loader.c
    subversion/trunk/subversion/libsvn_fs/fs-loader.h
    subversion/trunk/subversion/libsvn_fs_base/fs.c
    subversion/trunk/subversion/libsvn_fs_fs/fs.c
    subversion/trunk/subversion/libsvn_fs_x/fs.c

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.c?rev=1589254&r1=1589253&r2=1589254&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Tue Apr 22 19:15:42 2014
@@ -663,7 +663,7 @@ svn_fs_hotcopy2(const char *src_path, co
 
   SVN_ERR(vtable->hotcopy(src_fs, dst_fs, src_path, dst_path, clean,
                           incremental, cancel_func, cancel_baton,
-                          scratch_pool));
+                          common_pool_lock, scratch_pool, common_pool));
   return svn_error_trace(write_fs_type(dst_path, src_fs_type, scratch_pool));
 }
 

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.h?rev=1589254&r1=1589253&r2=1589254&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.h Tue Apr 22 19:15:42 2014
@@ -113,11 +113,17 @@ typedef struct fs_library_vtable_t
                             apr_pool_t *pool,
                             apr_pool_t *common_pool);
   svn_error_t *(*delete_fs)(const char *path, apr_pool_t *pool);
-  svn_error_t *(*hotcopy)(svn_fs_t *src_fs, svn_fs_t *dst_fs,
-                          const char *src_path, const char *dst_path,
-                          svn_boolean_t clean, svn_boolean_t incremental,
-                          svn_cancel_func_t cancel_func, void *cancel_baton,
-                          apr_pool_t *pool);
+  svn_error_t *(*hotcopy)(svn_fs_t *src_fs,
+                          svn_fs_t *dst_fs,
+                          const char *src_path,
+                          const char *dst_path,
+                          svn_boolean_t clean,
+                          svn_boolean_t incremental,
+                          svn_cancel_func_t cancel_func,
+                          void *cancel_baton,
+                          svn_mutex__t *common_pool_lock,
+                          apr_pool_t *pool,
+                          apr_pool_t *common_pool);
   const char *(*get_description)(void);
   svn_error_t *(*recover)(svn_fs_t *fs,
                           svn_cancel_func_t cancel_func, void *cancel_baton,

Modified: subversion/trunk/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/fs.c?rev=1589254&r1=1589253&r2=1589254&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/fs.c Tue Apr 22 19:15:42 2014
@@ -1293,7 +1293,9 @@ base_hotcopy(svn_fs_t *src_fs,
              svn_boolean_t incremental,
              svn_cancel_func_t cancel_func,
              void *cancel_baton,
-             apr_pool_t *pool)
+             svn_mutex__t *common_pool_lock,
+             apr_pool_t *pool,
+             apr_pool_t *common_pool)
 {
   svn_error_t *err;
   u_int32_t pagesize;

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs.c?rev=1589254&r1=1589253&r2=1589254&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs.c Tue Apr 22 19:15:42 2014
@@ -394,13 +394,11 @@ fs_hotcopy(svn_fs_t *src_fs,
            svn_boolean_t incremental,
            svn_cancel_func_t cancel_func,
            void *cancel_baton,
-           apr_pool_t *pool)
+           svn_mutex__t *common_pool_lock,
+           apr_pool_t *pool,
+           apr_pool_t *common_pool)
 {
-  SVN_ERR(svn_fs__check_fs(src_fs, FALSE));
-  SVN_ERR(initialize_fs_struct(src_fs));
-  SVN_ERR(svn_fs_fs__open(src_fs, src_path, pool));
-  SVN_ERR(svn_fs_fs__initialize_caches(src_fs, pool));
-  SVN_ERR(fs_serialized_init(src_fs, pool, pool));
+  SVN_ERR(fs_open(src_fs, src_path, common_pool_lock, pool, common_pool));
 
   SVN_ERR(svn_fs__check_fs(dst_fs, FALSE));
   SVN_ERR(initialize_fs_struct(dst_fs));

Modified: subversion/trunk/subversion/libsvn_fs_x/fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs.c?rev=1589254&r1=1589253&r2=1589254&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs.c Tue Apr 22 19:15:42 2014
@@ -381,13 +381,11 @@ x_hotcopy(svn_fs_t *src_fs,
           svn_boolean_t incremental,
           svn_cancel_func_t cancel_func,
           void *cancel_baton,
-          apr_pool_t *pool)
+          svn_mutex__t *common_pool_lock,
+          apr_pool_t *pool,
+          apr_pool_t *common_pool)
 {
-  SVN_ERR(svn_fs__check_fs(src_fs, FALSE));
-  SVN_ERR(initialize_fs_struct(src_fs));
-  SVN_ERR(svn_fs_x__open(src_fs, src_path, pool));
-  SVN_ERR(svn_fs_x__initialize_caches(src_fs, pool));
-  SVN_ERR(x_serialized_init(src_fs, pool, pool));
+  SVN_ERR(x_open(src_fs, src_path, common_pool_lock, pool, common_pool));
 
   SVN_ERR(svn_fs__check_fs(dst_fs, FALSE));
   SVN_ERR(initialize_fs_struct(dst_fs));



Mime
View raw message