GIT: unionfs2-2.6.27.y: Unionfs: return EINVAL in setattr on error

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:18:10 EDT 2010


commit fd26f738d82f5098a064172751678f3ea820b6d4
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Wed Sep 17 03:24:57 2008 -0400

    Unionfs: return EINVAL in setattr on error
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
index dcf066c..15e1e33 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -904,7 +904,10 @@ static int unionfs_setattr(struct dentry *dentry, struct iattr *ia)
 		ia->ia_valid &= ~ATTR_MODE;
 
 	lower_dentry = unionfs_lower_dentry(dentry);
-	BUG_ON(!lower_dentry);	/* should never happen after above revalidate */
+	if (!lower_dentry) { /* should never happen after above revalidate */
+		err = -EINVAL;
+		goto out;
+	}
 	lower_inode = unionfs_lower_inode(inode);
 
 	/* check if user has permission to change lower inode */


More information about the unionfs-cvs mailing list