[glib] bugster#6955199, on hsfs portfs will fail, and FEN backend will fail to run lstat and port_associate



commit 798eed43a2ee756b32651559f95ce55f0a448e7b
Author: Lin Ma <lin ma sun com>
Date:   Wed May 26 14:32:37 2010 +0800

    bugster#6955199, on hsfs portfs will fail, and FEN backend will fail
    to run lstat and port_associate on root node.

 gio/fen/fen-node.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/gio/fen/fen-node.c b/gio/fen/fen-node.c
index 7238e36..a57e196 100644
--- a/gio/fen/fen-node.c
+++ b/gio/fen/fen-node.c
@@ -417,9 +417,24 @@ node_adjust_deleted(node_t* f)
 
     FN_W ("%s %s\n", __func__, NODE_NAME(f));
 
-    for (ancestor = node_find_accessible_ancestor(f);
-         !NODE_HAS_STATE(ancestor, NODE_STATE_ASSOCIATED) && port_add(ancestor) != 0;
-         ancestor = node_find_accessible_ancestor(ancestor)) { /* Empty */ }
+    for (ancestor = NODE_PARENT(f);
+         ancestor != NULL;
+         ancestor = NODE_PARENT(ancestor)) {
+        /* Stop if we find a node which been already associated or is existed
+         * and can be associated.
+         */
+        if (NODE_HAS_STATE(ancestor, NODE_STATE_ASSOCIATED) ||
+          (node_lstat(ancestor) == 0 && port_add(ancestor) == 0)) {
+            break;
+        }
+    }
+
+    /* We assume we shouldn't reach here, because Root is always existed and
+     * associated. But given bugster#6955199, if PORT FS has problems on root,
+     * we may reach here. So just return ROOT and the whole GIO fen backend will
+     * fail.
+     */
+    /* g_assert(ancestor != NULL); */
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]