You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/01/26 00:00:04 UTC

svn commit: r1561419 - in /subversion/trunk/subversion: libsvn_fs_fs/recovery.c libsvn_fs_fs/transaction.c tests/cmdline/svnadmin_tests.py

Author: stefan2
Date: Sat Jan 25 23:00:04 2014
New Revision: 1561419

URL: http://svn.apache.org/r1561419
Log:
Fix a backward compat regression in FSFS introduced with 1.8:
When a non-deltified directory is written, the expanded size
was no longer stored explicitly.  That causes a crash in the
verification code for pre-1.4 repositories.

With this patch, all size information will always be given --
even for properties where it used to be omitted in the past.
We also fixes the recovery code for pre-1.4 format repositories
with faulty 1.8 commits in them.

* subversion/libsvn_fs_fs/transaction.c
  (write_container_rep): Always set the expanded_size.

* subversion/libsvn_fs_fs/recovery.c
  (recover_find_max_ids): If expanded_size should not be given
                          due to faulty 1.8 code, determine it.

* subversion/tests/cmdline/svnadmin_tests.py
  (verify_non_utf8_paths): Update repo content patterns.
  (fsfs_recover_old_non_empty): Should no longer fail.

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

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/recovery.c
    subversion/trunk/subversion/libsvn_fs_fs/transaction.c
    subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py

Modified: subversion/trunk/subversion/libsvn_fs_fs/recovery.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/recovery.c?rev=1561419&r1=1561418&r2=1561419&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/recovery.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/recovery.c Sat Jan 25 23:00:04 2014
@@ -191,9 +191,12 @@ recover_find_max_ids(svn_fs_t *fs,
                               "representation"));
 
   /* Now create a stream that's allowed to read only as much data as is
-     stored in the representation. */
+     stored in the representation.  Note that this is a directory, i.e. 
+     represented using the hash format on disk and can never have 0 length. */
   baton.pool = pool;
-  baton.remaining = noderev->data_rep->expanded_size;
+  baton.remaining = noderev->data_rep->expanded_size
+                  ? noderev->data_rep->expanded_size
+                  : noderev->data_rep->size;
   stream = svn_stream_create(&baton, pool);
   svn_stream_set_read(stream, read_handler_recover);
 

Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1561419&r1=1561418&r2=1561419&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Sat Jan 25 23:00:04 2014
@@ -2609,7 +2609,7 @@ write_container_rep(representation_t *re
 
       /* update the representation */
       rep->size = whb->size;
-      rep->expanded_size = 0;
+      rep->expanded_size = whb->size;
     }
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py?rev=1561419&r1=1561418&r2=1561419&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py Sat Jan 25 23:00:04 2014
@@ -1540,15 +1540,15 @@ def verify_non_utf8_paths(sbox):
     if line == "A\n":
       # replace 'A' with a latin1 character -- the new path is not valid UTF-8
       fp_new.write("\xE6\n")
-    elif line == "text: 1 279 32 0 d63ecce65d8c428b86f4f8b0920921fe\n":
+    elif line == "text: 1 279 32 32 d63ecce65d8c428b86f4f8b0920921fe\n":
       # phys, PLAIN directories: fix up the representation checksum
-      fp_new.write("text: 1 279 32 0 b50b1d5ed64075b5f632f3b8c30cd6b2\n")
+      fp_new.write("text: 1 279 32 32 b50b1d5ed64075b5f632f3b8c30cd6b2\n")
     elif line == "text: 1 292 44 32 a6be7b4cf075fd39e6a99eb69a31232b\n":
       # phys, deltified directories: fix up the representation checksum
       fp_new.write("text: 1 292 44 32 f2e93e73272cac0f18fccf16f224eb93\n")
-    elif line == "text: 1 6 31 0 90f306aa9bfd72f456072076a2bd94f7\n":
+    elif line == "text: 1 6 31 31 90f306aa9bfd72f456072076a2bd94f7\n":
       # log addressing: fix up the representation checksum
-      fp_new.write("text: 1 6 31 0 db2d4a0bad5dff0aea9a288dec02f1fb\n")
+      fp_new.write("text: 1 6 31 31 db2d4a0bad5dff0aea9a288dec02f1fb\n")
     elif line == "cpath: /A\n":
       # also fix up the 'created path' field
       fp_new.write("cpath: /\xE6\n")
@@ -2213,7 +2213,6 @@ def verify_denormalized_names(sbox):
     output, errput, exp_out, exp_err)
 
 
-@XFail()
 @SkipUnless(svntest.main.is_fs_type_fsfs)
 def fsfs_recover_old_non_empty(sbox):
   "fsfs recover non-empty --compatible-version=1.3"