Unionfs: interpose cleanup and fix for spliced dentries
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 25 Dec 2007 21:55:17 +0000 (16:55 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 23 Mar 2008 03:49:10 +0000 (23:49 -0400)
Fix unionfs_interpose to fill lower inode info when d_splice_alias returns
NULL.  Also cleanup impossible case (d_splice_alias doesn't return ERR_PTR).

Signed-off-by: Rachita Kothiyal <rachita@fsl.cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/main.c

index 22aa6e6b0053edaf98a1434f887481680b793813..ea8976d9b7ec90fb04ca5b99e9d0a75267aec9b2 100644 (file)
@@ -149,9 +149,7 @@ skip:
                break;
        case INTERPOSE_LOOKUP:
                spliced = d_splice_alias(inode, dentry);
-               if (IS_ERR(spliced)) {
-                       err = PTR_ERR(spliced);
-               } else if (spliced && spliced != dentry) {
+               if (spliced && spliced != dentry) {
                        /*
                         * d_splice can return a dentry if it was
                         * disconnected and had to be moved.  We must ensure
@@ -169,6 +167,12 @@ skip:
                                unionfs_fill_inode(dentry, inode);
                        }
                        goto out_spliced;
+               } else if (!spliced) {
+                       if (need_fill_inode) {
+                               need_fill_inode = 0;
+                               unionfs_fill_inode(dentry, inode);
+                               goto out_spliced;
+                       }
                }
                break;
        case INTERPOSE_REVAL: