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

HELP! Need more eyes on this.

From: <cmpilato_at_collab.net>
Date: 2002-01-17 04:22:41 CET

I tried to make the following patch to turn off deltification of
directory entries lists in the filesystem. The logic is fine, as far
as I can tell, but with the patch applied, `tests/libsvn_fs/fs-test
18` hangs for me in a call to select() something like 31 stack frames
deep, below Berkeley's db->get() call. Wondering if this is
reproducible for others.

Here's the log and patch.

--
* subversion/libsvn_fs/node-rev.c
  (deltify): No longer deltify directory entries lists (the 'data'
  representation for a directory node).
Index: ./subversion/libsvn_fs/node-rev.c
===================================================================
--- ./subversion/libsvn_fs/node-rev.c
+++ ./subversion/libsvn_fs/node-rev.c	Wed Jan 16 16:57:00 2002
@@ -97,6 +97,18 @@
     *source_pkey,         /* source property rep key  */
     *source_dkey;         /* source data rep key      */
 
+  svn_fs_root_t *root;
+  int is_dir;
+  svn_stringbuf_t *s_id;
+
+  /* Get an ID root... */
+  SVN_ERR (svn_fs_id_root (&root, fs, trail->pool));
+
+  /* ...so we can detect if TARGET is a directory (we won't be
+     deltifying directory entries lists. */
+  s_id = svn_fs_unparse_id (target_id, trail->pool);
+  svn_fs_is_dir (&is_dir, root, s_id->data, trail->pool);
+
   /* Turn those IDs into skels, so we can get the rep keys. */
   SVN_ERR (svn_fs__get_node_revision (&target_nr, fs, target_id, trail));
   SVN_ERR (svn_fs__get_node_revision (&source_nr, fs, source_id, trail));
@@ -117,41 +129,45 @@
 
     /* Target property key. */
     target_pkey_skel = SVN_FS__NR_PROP_KEY (target_nr);
-    if (target_pkey_skel->len != 0) {
-      target_pkey = apr_pstrndup (trail->pool,
-                                  target_pkey_skel->data,
-                                  target_pkey_skel->len);
-    }
+    if (target_pkey_skel->len != 0) 
+      {
+        target_pkey = apr_pstrndup (trail->pool,
+                                    target_pkey_skel->data,
+                                    target_pkey_skel->len);
+      }
     else
       target_pkey = NULL;
 
     /* Target data key. */
     target_dkey_skel = SVN_FS__NR_DATA_KEY (target_nr);
-    if (target_dkey_skel->len != 0) {
-      target_dkey = apr_pstrndup (trail->pool,
-                                  target_dkey_skel->data,
-                                  target_dkey_skel->len);
-    }
+    if (target_dkey_skel->len != 0) 
+      {
+        target_dkey = apr_pstrndup (trail->pool,
+                                    target_dkey_skel->data,
+                                    target_dkey_skel->len);
+      }
     else
       target_dkey = NULL;
     
     /* Source property key. */
     source_pkey_skel = SVN_FS__NR_PROP_KEY (source_nr);
-    if (source_pkey_skel->len != 0) {
-      source_pkey = apr_pstrndup (trail->pool,
-                                  source_pkey_skel->data,
-                                  source_pkey_skel->len);
-    }
+    if (source_pkey_skel->len != 0) 
+      {
+        source_pkey = apr_pstrndup (trail->pool,
+                                    source_pkey_skel->data,
+                                    source_pkey_skel->len);
+      }
     else
       source_pkey = NULL;
 
     /* Source data key. */
     source_dkey_skel = SVN_FS__NR_DATA_KEY (source_nr);
-    if (source_dkey_skel->len != 0) {
-      source_dkey = apr_pstrndup (trail->pool,
-                                  source_dkey_skel->data,
-                                  source_dkey_skel->len);
-    }
+    if (source_dkey_skel->len != 0) 
+      {
+        source_dkey = apr_pstrndup (trail->pool,
+                                    source_dkey_skel->data,
+                                    source_dkey_skel->len);
+      }
     else
       source_dkey = NULL;
   }
@@ -160,7 +176,7 @@
       && (strcmp (target_pkey, source_pkey)))
     SVN_ERR (svn_fs__rep_deltify (fs, target_pkey, source_pkey, trail));
 
-  if ((target_dkey && source_dkey)
+  if ((target_dkey && source_dkey && (! is_dir))
       && (strcmp (target_dkey, source_dkey)))     
    SVN_ERR (svn_fs__rep_deltify (fs, target_dkey, source_dkey, trail));
 
@@ -301,7 +317,8 @@
   /* Destroy the subpool. */
   svn_pool_destroy (subpool);
 
-  /* If we found a valid source ID, perform the deltification step. */
+  /* If we found a valid source ID, perform the deltification step
+     (though we only deltify the data reps for non-dirs). */
   if (source_id)
     SVN_ERR (deltify (target_id, source_id, args->fs, trail));
 
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:56 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.