You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stephane D'Alu <St...@insa-lyon.fr> on 2011/11/07 19:15:33 UTC

Cross-device link problem with 1.7.x

Hi,

I've been using subversion with a working copy crossing mount point 
without problem until 1.7.x, (this was perfect to manage unix 
configuration files instead of using RCS)

Would it be possible to go back to the same behavior as the previous 
versions, where performing a commit (I'm using svn:keywords) doesn't 
generate a cross device link error.


By performing for example a copy/remove if the rename fails with an 
EXDEV error.

Something in svn_io_file_rename like that

   status = apr_file_rename(from_path_apr, to_path_apr, pool);
   if (APR_STATUS_IS_EXDEV(status)) {
       (status = apr_file_copy(from_path_apr, to_path_apr,
                               APR_FILE_SOURCE_PERMS, pool)) &&
       (status = apr_file_remove(from_path_apr, pool));
   }


This was a dirty hack to fix my problem, but i'm sure special cases must 
be added to take care of atomicity and to handle directory.


Perhaps a better way to handle this is to create the temporary file in 
the same directory as the file that it must replace.

Sincerely

Re: Cross-device link problem with 1.7.x

Posted by Stefan Sperling <st...@elego.de>.
On Mon, Nov 07, 2011 at 10:41:48PM +0200, Daniel Shahaf wrote:
> Stephane: in the future please spell out a precise list of steps needed
> to reproduce the error you see.  We would rather spend our times
> thinking about how to fix bugs than guessing how to create them.

"Reproduce", not "create". We don't really want to create them :)

Re: Cross-device link problem with 1.7.x

Posted by Daniel Shahaf <da...@elego.de>.
Specifically, I see an error with 1.7.0 when I do:

% cd greek-tree-wc
% rm -rf A/D
% mkdir A/D
% sudo mount -t tmpfs -o size=1M tmpfs $PWD/A/D
% $svn revert -R .
subversion/svn/revert-cmd.c:80: (apr_err=18)
subversion/libsvn_client/revert.c:196: (apr_err=18)
subversion/libsvn_client/revert.c:106: (apr_err=18)
subversion/libsvn_client/revert.c:106: (apr_err=18)
subversion/libsvn_subr/sqlite.c:179: (apr_err=18)
subversion/libsvn_wc/adm_ops.c:1741: (apr_err=18)
subversion/libsvn_wc/adm_ops.c:1741: (apr_err=18)
subversion/libsvn_wc/adm_ops.c:1741: (apr_err=18)
subversion/libsvn_wc/adm_ops.c:1692: (apr_err=18)
subversion/libsvn_wc/workqueue.c:1568: (apr_err=18)
subversion/libsvn_wc/workqueue.c:1486: (apr_err=18)
subversion/libsvn_wc/workqueue.c:764: (apr_err=18)
subversion/libsvn_subr/io.c:3370: (apr_err=18)
svn: E000018: Can't move '/tmp/svn/wc1/.svn/tmp/svn-wmeVIN' to '/tmp/svn/wc1/trunk/A/D/gamma': Invalid cross-device link
zsh: exit 1     $SVN revert -R .

Stephane: in the future please spell out a precise list of steps needed
to reproduce the error you see.  We would rather spend our times
thinking about how to fix bugs than guessing how to create them.
Thanks.


Stephane D'Alu wrote on Mon, Nov 07, 2011 at 19:15:33 +0100:
> Hi,
> 
> I've been using subversion with a working copy crossing mount point
> without problem until 1.7.x, (this was perfect to manage unix
> configuration files instead of using RCS)
> 
> Would it be possible to go back to the same behavior as the previous
> versions, where performing a commit (I'm using svn:keywords) doesn't
> generate a cross device link error.
> 
> 
> By performing for example a copy/remove if the rename fails with an
> EXDEV error.
> 
> Something in svn_io_file_rename like that
> 
>   status = apr_file_rename(from_path_apr, to_path_apr, pool);
>   if (APR_STATUS_IS_EXDEV(status)) {
>       (status = apr_file_copy(from_path_apr, to_path_apr,
>                               APR_FILE_SOURCE_PERMS, pool)) &&
>       (status = apr_file_remove(from_path_apr, pool));
>   }
> 
> 
> This was a dirty hack to fix my problem, but i'm sure special cases
> must be added to take care of atomicity and to handle directory.
> 
> 
> Perhaps a better way to handle this is to create the temporary file
> in the same directory as the file that it must replace.
> 
> Sincerely