And then mv(1) recovers this failure with doing real mkdir and file copy.
So people will never aware the error of rename(2).
There might be another bug around real mkdir and copying, this one seems
to be a cause of Klaus's trouble.

According to unionfs document 'Technical Report FSL-04-01b',
unionfs_rename should copyup correctly. Shoud we address the bug of
copyup in rename first?

I found a twice-locked bug in create_parents_named() that caused chmod -R to lock up. When things fail inside the second while loop, the function failed to unlock dentries locked in the first loop. I am not sure if this is related to the other problems reported recently, but here is a patch to prevent the lockups (below).

Shortly after applying this patch, however, Klaus pointed a further bug: chmod -R on a directory containing many other directories reports missing files. For example, chmod -R o+w /usr/share/doc; gives "No such file or directory" for some subdirectories. Repeating the commands get more success with consecutive tries (the directories aren't really missing).

At first I could not reproduce this at all, but now it seems that the bug depends on order of branches. RW:RO produces missing file reports; RO:RW does not (at least not visibly). I have not yet been able to determine the cause of missing file reports. Goodnight.

- Denis Lukianov

--- copyup.c    2005-09-23 09:24:30.000000000 +0100
+++ copyup.c    2005-09-21 20:17:02.000000000 +0100
@@ -569,7 +569,7 @@
                 (struct dentry **)KMALLOC(kmalloc_size, GFP_KERNEL);
             if (!tmp_path) {
                 hidden_dentry = ERR_PTR(-ENOMEM);
-                goto out_release_locks;
+                goto out;
             }
             memset(tmp_path, 0, kmalloc_size);
             memcpy(tmp_path, path, old_kmalloc_size);
@@ -604,7 +604,7 @@
                 LOOKUP_ONE_LEN(childname, hidden_parent_dentry,
                        childnamelen);
             if (IS_ERR(hidden_dentry))
-                goto out_release_locks;
+                goto out;
         } else {
             int loop_start;
             int loop_end;
@@ -683,7 +683,7 @@
             if (err || !hidden_dentry->d_inode) {
                 DPUT(hidden_dentry);
                 hidden_dentry = ERR_PTR(err);
-                goto out_release_locks;
+                goto out;
             }
             err =
                 copyup_permissions(dir->i_sb, child_dentry,
@@ -691,7 +691,7 @@
             if (err) {
                 DPUT(hidden_dentry);
                 hidden_dentry = ERR_PTR(err);
-                goto out_release_locks;
+                goto out;
             }
             set_itohi_index(child_dentry->d_inode, bindex,
                     igrab(hidden_dentry->d_inode));
@@ -710,13 +710,6 @@
         parent_dentry = child_dentry;
         child_dentry = path[--count];
     }
-      out_release_locks:
-    while(child_dentry != dentry)
-    {
-        parent_dentry = child_dentry;
-        child_dentry = path[--count];
-        unlock_dentry(parent_dentry);
-    }
       out:
     KFREE(path);
     fist_print_dentry("OUT: create_parents_named", dentry);

_______________________________________________
unionfs mailing list
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs

Reply via email to