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 2011/03/13 13:47:45 UTC

svn commit: r1081102 - /subversion/trunk/subversion/libsvn_subr/cache-inprocess.c

Author: stefan2
Date: Sun Mar 13 12:47:45 2011
New Revision: 1081102

URL: http://svn.apache.org/viewvc?rev=1081102&view=rev
Log:
Fix permanent lock in cache-inprocess case of a de-serialization failure.

* subversion/libsvn_subr/cache-inprocess.c
  (inprocess_cache_get): release the lock even if there was some de-serialization error
  (inprocess_cache_get_partial): formatting fix

Modified:
    subversion/trunk/subversion/libsvn_subr/cache-inprocess.c

Modified: subversion/trunk/subversion/libsvn_subr/cache-inprocess.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache-inprocess.c?rev=1081102&r1=1081101&r2=1081102&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-inprocess.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-inprocess.c Sun Mar 13 12:47:45 2011
@@ -209,6 +209,7 @@ inprocess_cache_get(void **value_p,
                     apr_pool_t *pool)
 {
   inprocess_cache_t *cache = cache_void;
+  svn_error_t *err = NULL;
   struct cache_entry *entry;
   char* buffer;
 
@@ -235,11 +236,11 @@ inprocess_cache_get(void **value_p,
    */
   *found = TRUE;
   if (entry->value)
-    return cache->deserialize_func(value_p, buffer, entry->size, pool);
+    err = cache->deserialize_func(value_p, buffer, entry->size, pool);
   else
     *value_p = NULL;
 
-  return unlock_cache(cache, SVN_NO_ERROR);
+  return unlock_cache(cache, err);
 }
 
 /* Removes PAGE from the LRU list, removes all of its entries from
@@ -451,22 +452,21 @@ inprocess_cache_get_partial(void **value
 {
   inprocess_cache_t *cache = cache_void;
   struct cache_entry *entry;
-  svn_error_t *err;
 
   SVN_ERR(lock_cache(cache));
 
   entry = apr_hash_get(cache->hash, key, cache->klen);
   if (! entry)
-  {
-    *found = FALSE;
-    return unlock_cache(cache, SVN_NO_ERROR);
-  }
+    {
+      *found = FALSE;
+      return unlock_cache(cache, SVN_NO_ERROR);
+    }
 
   move_page_to_front(cache, entry->page);
 
   *found = TRUE;
-  err = func(value_p, entry->value, entry->size, baton, pool);
-  return unlock_cache(cache, err);
+  return unlock_cache(cache,
+                      func(value_p, entry->value, entry->size, baton, pool));
 }
 
 static svn_boolean_t