Implement svn_repos_verify_fs and use it in svnadmin verify rather
commit111084b6bd798969671ff9dd4dc6331047b6d1ac
authorepg <epg@612f8ebc-c883-4be0-9ee0-a4e9ef946e3a>
Wed, 13 Feb 2008 21:51:45 +0000 (13 21:51 +0000)
committerepg <epg@612f8ebc-c883-4be0-9ee0-a4e9ef946e3a>
Wed, 13 Feb 2008 21:51:45 +0000 (13 21:51 +0000)
treef0af4bbbe2d32b280043bad3e4670227c3bb8584
parent5003220ad3301291efabcbdc5b8d4f65b98fcd74
Implement svn_repos_verify_fs and use it in svnadmin verify rather
than using svn_repos_dump_fs2, restoring complete verification after
losing it in r24559.

In r24559, I changed verify's use of svn_repos_dump_fs2 to dump only
the paths changed in the revision being dumped rather than dumping the
entire repository as of that revision.  Without r24559, verifying
large repositories is effectively impossible.  But without dumping the
entire repository contents, we were no longer verifying the links back
to previous revisions for the paths *not* changed in the revision
being verified.

* subversion/libsvn_fs_fs/fs_fs.c
  (svn_fs_fs__get_node_revision): Check that the HEADER_ID field is
    actually in the node-rev header block; all other fields are
    already checked, only this one was not.  This led to a segmentation
    fault in the particular corrupted revs file I created, as I simply
    incremented an offset, resulting in a "d" header but no "id" header.

* subversion/libsvn_repos/dump.c
  (verify_directory_entry): Add function that does a simple check that
    a directory entry is valid (svn_fs_dir_entries for directories and
    svn_fs_file_length for files).
  (verify_close_directory): Add svn_delta_editor_t.close_directory
    implementation that verify_directory_entry()s each entry.
  (svn_repos_verify_fs): Add new function to verify a file system,
    mostly by invoking svn_repos_replay2 with the dump editor, but
    with the additional check of verify_close_directory.

* subversion/include/svn_repos.h
  (svn_repos_verify_fs): Declare.
  (svn_repos_dump_fs2): Change doc string to point to
    svn_repos_verify_fs for verifying a file system.

* subversion/svnadmin/main.c
  (dump_repo): Remove.
  (subcommand_dump): Fold dump_repo body into here.
  (subcommand_verify): Use svn_repos_verify_fs rather than dump_repo.

* subversion/tests/cmdline/svnadmin_tests.py
  (verify_incremental_fsfs): Add test that corrupts a revision file in
    a way that svn_repos_dump_fs2 cannot detect and asserts that
    svnadmin verify detects it.

git-svn-id: http://svn.collab.net/repos/svn/trunk@29329 612f8ebc-c883-4be0-9ee0-a4e9ef946e3a
subversion/include/svn_repos.h
subversion/libsvn_fs_fs/fs_fs.c
subversion/libsvn_repos/dump.c
subversion/svnadmin/main.c
subversion/tests/cmdline/svnadmin_tests.py