commit 4a1a0a076887f6a03234b73bea09db29256c9322
Author: Erez Zadok <[email protected]>
Date:   Mon Jan 12 23:03:29 2009 -0500

    Unionfs: handle partial copyup errors gracefully
    
    Don't leave any dentries behind if copying up the inode (or setting its
    permission, i.e., using TOMOYO) failed.
    
    CC: Tetsuo Handa <[email protected]>
    Signed-off-by: Erez Zadok <[email protected]>

diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c
index bbd49c8..0254b60 100644
--- a/fs/unionfs/copyup.c
+++ b/fs/unionfs/copyup.c
@@ -519,8 +519,17 @@ out_free:
                dput(old_lower_dentry);
        kfree(symbuf);
 
-       if (err)
+       if (err) {
+               /*
+                * if directory creation succeeded, but inode copyup failed,
+                * then purge new dentries.
+                */
+               if (dbstart(dentry) < old_bstart &&
+                   ibstart(dentry->d_inode) > dbstart(dentry))
+                       __clear(dentry, NULL, old_bstart, old_bend,
+                               unionfs_lower_dentry(dentry), dbstart(dentry));
                goto out;
+       }
        if (!S_ISDIR(dentry->d_inode->i_mode)) {
                unionfs_postcopyup_release(dentry);
                if (!unionfs_lower_inode(dentry->d_inode)) {
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to