[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r22026 - trunk/subversion/libsvn_fs_fs

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2006-10-19 00:16:32 CEST

Does this work on Windows? It has a reputation of being unable to do
stuff which Unix/POSIX systems can (such as unlinking open files)...

bye,

Erik.

On 10/19/06, malcolm@tigris.org <malcolm@tigris.org> wrote:
> Author: malcolm
> Date: Wed Oct 18 15:14:54 2006
> New Revision: 22026
>
> Log:
> FSFS: Remove a small race that would allow writes to a prototype revision file
> in the period between the file's closure and moving the revision file into
> place.
>
> Review by: rooneg
>
> * subversion/libsvn_fs_fs/fs_fs.c
> (commit_body): Delay unlocking the prototype revision file until after it
> has been moved into place.
>
>
> Modified:
> trunk/subversion/libsvn_fs_fs/fs_fs.c
>
> Modified: trunk/subversion/libsvn_fs_fs/fs_fs.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_fs_fs/fs_fs.c?pathrev=22026&r1=22025&r2=22026
> ==============================================================================
> --- trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
> +++ trunk/subversion/libsvn_fs_fs/fs_fs.c Wed Oct 18 15:14:54 2006
> @@ -4335,7 +4335,9 @@
> SVN_ERR(svn_io_file_flush_to_disk(proto_file, pool));
>
> SVN_ERR(svn_io_file_close(proto_file, pool));
> - SVN_ERR(unlock_proto_rev(cb->fs, cb->txn->id, proto_file_lockcookie, pool));
> + /* We don't unlock the prototype revision file immediately to avoid a
> + race with another caller writing to the prototype revision file
> + before we commit it. */
>
> /* Remove any temporary txn props representing 'flags'. */
> SVN_ERR(svn_fs_fs__txn_proplist(&txnprops, cb->txn, pool));
> @@ -4361,6 +4363,12 @@
> SVN_ERR(svn_fs_fs__move_into_place(proto_filename, rev_filename,
> old_rev_filename, pool));
>
> + /* Now that we've moved the prototype revision file out of the way,
> + we can unlock it (since further attempts to write to the file
> + will fail as it no longer exists). We must do this so that we can
> + remove the transaction directory later. */
> + SVN_ERR(unlock_proto_rev(cb->fs, cb->txn->id, proto_file_lockcookie, pool));
> +
> /* Update commit time to ensure that svn:date revprops remain ordered. */
> date.data = svn_time_to_cstring(apr_time_now(), pool);
> date.len = strlen(date.data);
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 19 00:16:50 2006

This is an archived mail posted to the Subversion Dev mailing list.