Unionfs: don't printk an error if it's due to common copyup
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 1 Nov 2007 05:38:09 +0000 (01:38 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 13 Jan 2009 02:32:21 +0000 (21:32 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c
fs/unionfs/rename.c
fs/unionfs/subr.c

index 169365c2bfbe06f2eeccbe672d7500df2262c8fd..bcefe451e25f18740227bc99316731464bf1ad68 100644 (file)
@@ -465,10 +465,11 @@ static int unionfs_symlink(struct inode *dir, struct dentry *dentry,
                        if (!lower_dentry || IS_ERR(lower_dentry)) {
                                if (IS_ERR(lower_dentry))
                                        err = PTR_ERR(lower_dentry);
-
-                               printk(KERN_ERR "unionfs: lower dentry "
-                                      "NULL (or error) for bindex = %d\n",
-                                      bindex);
+                               if (!IS_COPYUP_ERR(err))
+                                       printk(KERN_ERR
+                                              "unionfs: create_parents for "
+                                              "symlink failed: bindex=%d "
+                                              "err=%d\n", bindex, err);
                                continue;
                        }
                }
index 1ab474fc953b228d9a8e6b4489fa0ed0802d7906..4a35b5eb6913bf011b6c5105968a219ca126a442 100644 (file)
@@ -41,7 +41,7 @@ static int __unionfs_rename(struct inode *old_dir, struct dentry *old_dentry,
                                       bindex);
                if (IS_ERR(lower_new_dentry)) {
                        err = PTR_ERR(lower_new_dentry);
-                       if (err == -EROFS)
+                       if (IS_COPYUP_ERR(err))
                                goto out;
                        printk(KERN_ERR "unionfs: error creating directory "
                               "tree for rename, bindex=%d err=%d\n",
index d97086a123a0e99ee21dc85f67193aa1d280141c..968ee8c6784fb244bfe6665d4802a2bf5eb9a296 100644 (file)
@@ -61,8 +61,12 @@ int create_whiteout(struct dentry *dentry, int start)
                                                      dentry->d_name.name,
                                                      bindex);
                        if (!lower_dentry || IS_ERR(lower_dentry)) {
-                               printk(KERN_ERR "unionfs: create_parents "
-                                      "failed for bindex = %d\n", bindex);
+                               int ret = PTR_ERR(lower_dentry);
+                               if (!IS_COPYUP_ERR(ret))
+                                       printk(KERN_ERR
+                                              "unionfs: create_parents for "
+                                              "whiteout failed: bindex=%d "
+                                              "err=%d\n", bindex, ret);
                                continue;
                        }
                }