Unionfs: return EINVAL in setattr on error
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 19 Sep 2008 03:00:23 +0000 (23:00 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 19 Sep 2008 03:00:23 +0000 (23:00 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index 22f2c323dfd216b0cb4357e3c845ca5e94b4498c..62311d2fafd2f9efdbfa8e59208dee826233c5fd 100644 (file)
@@ -914,7 +914,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 */