subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1559777 - in /subversion/trunk/subversion/libsvn_fs_fs: cached_data.c pack.c verify.c
Date Mon, 20 Jan 2014 16:52:00 GMT
Author: stefan2
Date: Mon Jan 20 16:52:00 2014
New Revision: 1559777

URL: http://svn.apache.org/r1559777
Log:
Reduce the lifetime of open revision files within core FSFS routines.
Whenever these files are only required in the scope of the routine itself,
there is no reason not to close them before exiting that routine.  Moreover,
leaving them open can lead to various problems when attempting to reorganize
the repository structure on Windows (e.g., ENOTEMPTY error when removing
folders during 'svnadmin pack').

This changeset restores the 1.8.x behavior of these routines and unbreaks the
upgrade_new_txns_to_log_addressing / upgrade_old_txns_to_log_addressing tests
(fs-fs-pack-tests) on Windows.

* subversion/libsvn_fs_fs/cached_data.c
  (get_node_revision_body, svn_fs_fs__check_rep):
    Call svn_fs_fs__close_revision_file().

* subversion/libsvn_fs_fs/pack.c
  (append_revision): Call svn_fs_fs__close_revision_file().

* subversion/libsvn_fs_fs/verify.c
  (compare_l2p_to_p2l_index, compare_p2l_to_l2p_index, compare_p2l_to_rev):
    Call svn_fs_fs__close_revision_file().

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
    subversion/trunk/subversion/libsvn_fs_fs/pack.c
    subversion/trunk/subversion/libsvn_fs_fs/verify.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/cached_data.c?rev=1559777&r1=1559776&r2=1559777&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Mon Jan 20 16:52:00 2014
@@ -354,7 +354,6 @@ get_node_revision_body(node_revision_t *
                              revision_file,
                              pool,
                              pool));
-          SVN_ERR(svn_fs_fs__close_revision_file(revision_file));
         }
       else
         {
@@ -373,6 +372,8 @@ get_node_revision_body(node_revision_t *
                                    *noderev_p,
                                    pool));
         }
+
+      SVN_ERR(svn_fs_fs__close_revision_file(revision_file));
     }
 
   return SVN_NO_ERROR;
@@ -884,6 +885,7 @@ svn_fs_fs__check_rep(representation_t *r
       if (is_packed != rev_file.is_packed)
         {
           svn_error_clear(err);
+          SVN_ERR(svn_fs_fs__close_revision_file(&rev_file));
           return svn_error_trace(svn_fs_fs__check_rep(rep, fs, hint, pool));
         }
       else
@@ -900,6 +902,8 @@ svn_fs_fs__check_rep(representation_t *r
                                    " in revision %ld"),
                                  apr_off_t_toa(pool, entry->offset),
                                  rep->item_index, rep->revision);
+
+      SVN_ERR(svn_fs_fs__close_revision_file(&rev_file));
     }
   else
     {

Modified: subversion/trunk/subversion/libsvn_fs_fs/pack.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/pack.c?rev=1559777&r1=1559776&r2=1559777&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/pack.c Mon Jan 20 16:52:00 2014
@@ -1426,6 +1426,8 @@ append_revision(pack_context_t *context,
   svn_pool_destroy(iterpool);
   context->pack_offset += finfo.size;
 
+  SVN_ERR(svn_fs_fs__close_revision_file(rev_file));
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/libsvn_fs_fs/verify.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/verify.c?rev=1559777&r1=1559776&r2=1559777&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/verify.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/verify.c Mon Jan 20 16:52:00 2014
@@ -233,6 +233,8 @@ compare_l2p_to_p2l_index(svn_fs_t *fs,
 
   svn_pool_destroy(iterpool);
 
+  SVN_ERR(svn_fs_fs__close_revision_file(&rev_file));
+
   return SVN_NO_ERROR;
 }
 
@@ -321,6 +323,8 @@ compare_p2l_to_l2p_index(svn_fs_t *fs,
 
   svn_pool_destroy(iterpool);
 
+  SVN_ERR(svn_fs_fs__close_revision_file(&rev_file));
+
   return SVN_NO_ERROR;
 }
 
@@ -576,6 +580,8 @@ compare_p2l_to_rev(svn_fs_t *fs,
 
   svn_pool_destroy(iterpool);
 
+  SVN_ERR(svn_fs_fs__close_revision_file(rev_file));
+
   return SVN_NO_ERROR;
 }
 



Mime
View raw message