Unable to create Subversion repository with compil

2019-08-26 06:45发布

问题:

We have compiled subversion 1.10.2 on AiX machine using the compile command :-

./configure CFLAGS="-I/temp1110/subversion/zlib" --without-berkeley-db --with-apr=/temp1110/subversion/apr --with-apr-util=/temp1110/subversion/apr-util --with-lz4=internal --with-utf8proc=internal --disable-nls

Whereas, after generating the required files using "make" command. We are unable to create a repository. After passing the command ./svnadmin create /temp1110/home/Repo_test", we get the error:

svnadmin: E000009: Can't write '/temp1110/home/Repo_test/db/current' atomically svnadmin: E000009: Can't flush file '/temp1110/home/Repo_test/db' to disk: Bad file number

Any idea how to resolve this?

回答1:

Well, you cannot solve this, this is a bug in subversion.

Or rather an AIX-specific problem: fsync(2) called on a directory returns errno=EBADF which makes subverions/libsvn_subr/io.c:svn_io_flush_to_disk sad.

This can be fixed with the following patch:

--- subversion/libsvn_subr/io.cold  2018-01-19 05:00:11.000000000 +0100
+++ subversion/libsvn_subr/io.c     2018-12-22 20:25:42.000000000 +0100
@@ -4286,7 +4286,13 @@
      return svn_error_wrap_apr(status, _("Can't move '%s' to '%s'"),
                                svn_dirent_local_style(from_path, pool),
                                svn_dirent_local_style(to_path, pool));
- 
+ #if !defined(_AIX)
+     /* on Aix, you cannot do fsync(2) on a directory,
+        also you cannot open a file for APR_WRITE
+        if its access bits are 444
+        Nonetheless this is a very useful peace of code,
+        just not for AIX.
+     */
  #if defined(SVN_ON_POSIX)
    if (flush_to_disk)
      {
@@ -4314,7 +4320,7 @@
        SVN_ERR(svn_io_file_close(file, pool));
      }
  #endif
- 
+ #endif
    return SVN_NO_ERROR;
  }


标签: svn aix