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 2015/06/20 12:24:39 UTC
svn commit: r1686546 - in /subversion/trunk/subversion/libsvn_fs_fs: fs_fs.c
fs_fs.h hotcopy.c
Author: stefan2
Date: Sat Jun 20 10:24:39 2015
New Revision: 1686546
URL: http://svn.apache.org/r1686546
Log:
Revert r1686232 as it turned out ineffective on some platforms
and on all systems that use ACLs.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h
subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1686546&r1=1686545&r2=1686546&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Sat Jun 20 10:24:39 2015
@@ -415,75 +415,6 @@ svn_fs_fs__with_all_locks(svn_fs_t *fs,
return svn_error_trace(with_lock(lock_baton, pool));
}
-/* Set *READ_ONLY to TRUE, if the (lock) file at PATH is read-only.
- Should that file not exist, try to create an empty one at PATH.
- If that fails due to insufficient access rights, set *READ_ONLY
- to TRUE as well. Use SCRATCH_POOL for temporary allocations.
- */
-static svn_error_t *
-is_read_only(svn_boolean_t *read_only,
- const char *path,
- apr_pool_t *scratch_pool)
-{
- apr_finfo_t finfo;
-
- svn_error_t *err
- = svn_io_stat(&finfo, path, SVN__APR_FINFO_READONLY, scratch_pool);
- if (err && APR_STATUS_IS_ENOENT(err->apr_err))
- {
- /* No lock file? Try to create one.
- If that is not allowed, the repo can't be written to.
- Report it as r/o in that case. */
- svn_error_clear(err);
-
- /* This file creation is racy (see further below). */
- err = svn_io_file_create_empty(path, scratch_pool);
- if (err && APR_STATUS_IS_EACCES(err->apr_err))
- {
- /* File creation is not allowed. */
- svn_error_clear(err);
- *read_only = TRUE;
- return SVN_NO_ERROR;
- }
-
- /* Don't leak ... */
- svn_error_clear(err);
-
- /* At this point, there should either be a file or something pretty
- bad happened. In the latter case, this will fail with some error. */
- SVN_ERR(svn_io_stat(&finfo, path, SVN__APR_FINFO_READONLY,
- scratch_pool));
- }
-
- SVN_ERR(svn_io__is_finfo_read_only(read_only, &finfo, scratch_pool));
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_fs_fs__is_read_only(svn_boolean_t *read_only,
- svn_fs_t *fs,
- apr_pool_t *scratch_pool)
-{
- fs_fs_data_t *ffd = fs->fsap_data;
-
- *read_only = FALSE;
- SVN_ERR(is_read_only(read_only,
- svn_fs_fs__path_lock(fs, scratch_pool),
- scratch_pool));
-
- if (ffd->format >= SVN_FS_FS__MIN_TXN_CURRENT_FORMAT && !*read_only)
- SVN_ERR(is_read_only(read_only,
- svn_fs_fs__path_txn_current_lock(fs, scratch_pool),
- scratch_pool));
-
- if (ffd->format >= SVN_FS_FS__MIN_PACK_LOCK_FORMAT && !*read_only)
- SVN_ERR(is_read_only(read_only,
- svn_fs_fs__path_pack_lock(fs, scratch_pool),
- scratch_pool));
-
- return SVN_NO_ERROR;
-}
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h?rev=1686546&r1=1686545&r2=1686546&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h Sat Jun 20 10:24:39 2015
@@ -215,21 +215,6 @@ svn_fs_fs__with_all_locks(svn_fs_t *fs,
void *baton,
apr_pool_t *pool);
-/* Set *READ_ONLY to TRUE, if we can't write to FS (create txns, commit or
- pack). If *READ_ONLY is FALSE, we expect that the on-disk permissions
- allow for any write operation.
-
- Note that we check the access rights for the current user and that a
- read-only repository may still be writable for other users.
-
- Furthermore, we expect OS access rights to be set consistently on all
- files and folders. Therefore, *READ_ONLY==FALSE is no guarantee that
- a write will actually succeed. */
-svn_error_t *
-svn_fs_fs__is_read_only(svn_boolean_t *read_only,
- svn_fs_t *fs,
- apr_pool_t *scratch_pool);
-
/* Find the value of the property named PROPNAME in transaction TXN.
Return the contents in *VALUE_P. The contents will be allocated
from POOL. */
Modified: subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c?rev=1686546&r1=1686545&r2=1686546&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c Sat Jun 20 10:24:39 2015
@@ -1003,21 +1003,10 @@ hotcopy_locking_src_body(void *baton, ap
struct hotcopy_body_baton *hbb = baton;
fs_fs_data_t *src_ffd = hbb->src_fs->fsap_data;
- /* Hotcopying while packing is racy and can lead to hotcopy failure.
- Therefore, we try to block packing while we are copying data. */
- if (src_ffd->format >= SVN_FS_FS__MIN_PACK_LOCK_FORMAT)
- {
- svn_boolean_t read_only;
- SVN_ERR(svn_fs_fs__is_read_only(&read_only, hbb->src_fs, pool));
- if (!read_only)
- return svn_error_trace(svn_fs_fs__with_pack_lock(hbb->src_fs,
- hotcopy_body,
- baton, pool));
- }
-
- /* Fall-back code: Just copy. This may fail with ENOENT if the source
- repo is being packed at the same time. */
- return svn_error_trace(hotcopy_body(baton, pool));
+ return src_ffd->format >= SVN_FS_FS__MIN_PACK_LOCK_FORMAT
+ ? svn_error_trace(svn_fs_fs__with_pack_lock(hbb->src_fs, hotcopy_body,
+ baton, pool))
+ : hotcopy_body(baton, pool);
}
/* Create an empty filesystem at DST_FS at DST_PATH with the same