subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1718167 - /subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
Date Sun, 06 Dec 2015 12:02:00 GMT
Author: kotkov
Date: Sun Dec  6 12:02:00 2015
New Revision: 1718167

Disable zero-copy code path for ra_local update reporters.

The known and documented limitation of svn_repos_begin_report3() is that
with zero-copy enabled, the delta editor callbacks cannot access FSFS
or use Subversion caches directly.  This limitation comes from the fact
that sending delta using the zero-copy code path happens from within a cache
access wrapper — that is, while holding the lock.  If a particular delta
consumer happens to access or invalidate the cache, bad things could happen,
spanning from UB due to accessing a dangling pointer to a deadlock caused by
an attempt to take a non-recursive (blocking) lock, that has already been
taken by the same thread.

Within ra_local, we cannot be sure that arbitrary callers of our public
API, namely, svn_ra_do_update3(), svn_ra_do_switch3() or svn_ra_do_status2(),
are aware of this limitation and pass-in the delta editor that doesn't access
FSFS or caches — because everything happens locally and all operations that
use the FS layer have a chance of using the cache.

* subversion/libsvn_ra_local/ra_plugin.c
  (make_reporter): Pass 0 as zero_copy_limit when creating the update


Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c Sun Dec  6 12:02:00 2015
@@ -360,8 +360,13 @@ make_reporter(svn_ra_session_t *session,
-                                  1024 * 1024,  /* process-local transfers
-                                                   should be fast */
+                                  0, /* Disable zero-copy codepath, because
+                                        RA API users are unaware about the
+                                        zero-copy code path limitation (do
+                                        not access FSFS data structures
+                                        and, hence, caches).  See notes
+                                        to svn_repos_begin_report3() for
+                                        additional details. */
   /* Wrap the report baton given us by the repos layer with our own

View raw message