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 2013/03/29 16:45:21 UTC

svn commit: r1462501 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: cached_data.c low_level.c low_level.h transaction.c

Author: stefan2
Date: Fri Mar 29 15:45:21 2013
New Revision: 1462501

URL: http://svn.apache.org/r1462501
Log:
On the fsfs-format7 branch:  always handle NULL checksums when
serializing representations.  There is no point in risking segfaults.

* subversion/libsvn_fs_fs/low_level.h
  (svn_fs_fs__unparse_representation): drop may_be_corrupt parameter

* subversion/libsvn_fs_fs/low_level.c
  (svn_fs_fs__unparse_representation): always test for NULL checksums
  (svn_fs_fs__write_noderev): update caller

* subversion/libsvn_fs_fs/cached_data.c
  (create_rep_state): update caller

* subversion/libsvn_fs_fs/transaction.c
  (store_sha1_rep_mapping): same here

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c?rev=1462501&r1=1462500&r2=1462501&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c Fri Mar 29 15:45:21 2013
@@ -802,7 +802,7 @@ create_rep_state(rep_state_t **rep_state
                                "Corrupt representation '%s'",
                                rep
                                ? svn_fs_fs__unparse_representation
-                                   (rep, ffd->format, TRUE, TRUE, pool)->data
+                                   (rep, ffd->format, TRUE, pool)->data
                                : "(null)");
     }
   /* ### Call representation_string() ? */

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c?rev=1462501&r1=1462500&r2=1462501&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c Fri Mar 29 15:45:21 2013
@@ -529,7 +529,6 @@ svn_stringbuf_t *
 svn_fs_fs__unparse_representation(representation_t *rep,
                                   int format,
                                   svn_boolean_t mutable_rep_truncated,
-                                  svn_boolean_t may_be_corrupt,
                                   apr_pool_t *pool)
 {
   char buffer[SVN_INT64_BUFFER_SIZE];
@@ -537,7 +536,7 @@ svn_fs_fs__unparse_representation(repres
     return svn_stringbuf_ncreate("-1", 2, pool);
 
 #define DISPLAY_MAYBE_NULL_CHECKSUM(checksum)          \
-  ((!may_be_corrupt || (checksum) != NULL)     \
+  ((checksum != NULL)     \
    ? svn_checksum_to_cstring_display((checksum), pool) \
    : "(null)")
 
@@ -594,14 +593,13 @@ svn_fs_fs__write_noderev(svn_stream_t *o
                                 (noderev->data_rep,
                                  format,
                                  noderev->kind == svn_node_dir,
-                                 FALSE,
                                  pool)->data));
 
   if (noderev->prop_rep)
     SVN_ERR(svn_stream_printf(outfile, pool, HEADER_PROPS ": %s\n",
                               svn_fs_fs__unparse_representation
                                 (noderev->prop_rep, format,
-                                 TRUE, FALSE, pool)->data));
+                                 TRUE, pool)->data));
 
   SVN_ERR(svn_stream_printf(outfile, pool, HEADER_CPATH ": %s\n",
                             noderev->created_path));

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h?rev=1462501&r1=1462500&r2=1462501&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h Fri Mar 29 15:45:21 2013
@@ -69,7 +69,6 @@ svn_stringbuf_t *
 svn_fs_fs__unparse_representation(representation_t *rep,
                                   int format,
                                   svn_boolean_t mutable_rep_truncated,
-                                  svn_boolean_t may_be_corrupt,
                                   apr_pool_t *pool);
 
 /* Read a node-revision from STREAM. Set *NODEREV to the new structure,

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c?rev=1462501&r1=1462500&r2=1462501&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c Fri Mar 29 15:45:21 2013
@@ -586,7 +586,6 @@ store_sha1_rep_mapping(svn_fs_t *fs,
         = svn_fs_fs__unparse_representation(noderev->data_rep,
                                             ffd->format,
                                             (noderev->kind == svn_node_dir),
-                                            FALSE,
                                             pool);
       SVN_ERR(svn_io_file_open(&rep_file, file_name,
                                APR_WRITE | APR_CREATE | APR_TRUNCATE