subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1173323 - /subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c
Date Tue, 20 Sep 2011 19:46:30 GMT
Author: danielsh
Date: Tue Sep 20 19:46:30 2011
New Revision: 1173323

URL: http://svn.apache.org/viewvc?rev=1173323&view=rev
Log:
On the fs-successor-id branch: FSFS: fix a bug in the successors index
reading code, introduced (by me) in r1169991.

Found by: fs-test.c

* subversion/libsvn_fs_fs/fs_fs.c
  (read_successor_index_entry): 
    Initialize IDS_FILE in the early-out case too.
  (read_successors_from_candidates):
    Assert that the secondary return value was initialized.

Modified:
    subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c?rev=1173323&r1=1173322&r2=1173323&view=diff
==============================================================================
--- subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/fs-successor-ids/subversion/libsvn_fs_fs/fs_fs.c Tue Sep 20 19:46:30
2011
@@ -5964,6 +5964,12 @@ read_successor_index_entry(apr_off_t *re
   /* The trivial case: The caller asked for the first revision in a file. */
   if (revision % FSFS_SUCCESSORS_MAX_REVS_PER_FILE == 0)
     {
+      /* We promise to open the filehandle, too. */
+      if (file_p && ! *file_p)
+        SVN_ERR(svn_io_file_open(file_p, local_abspath, APR_READ,
+                                 APR_OS_DEFAULT, result_pool));
+
+      /* Set the right answer (without consulting the file), and get out. */
       *revision_offset = FSFS_SUCCESSORS_INDEX_SIZE;
       return SVN_NO_ERROR;
     }
@@ -8066,6 +8072,7 @@ read_successors_from_candidates(apr_arra
       /* This will either reuse IDS_FILE or open() it for us. */
       SVN_ERR(read_successor_index_entry(&offset, &ids_file, fs, rev,
                                          scratch_pool, iterpool));
+      SVN_ERR_ASSERT(ids_file);
 
       /* Seek and read. */
       SVN_ERR(svn_io_file_seek(ids_file, APR_SET, &offset, iterpool));



Mime
View raw message