Unionfs: return EINVAL in setattr on error
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 19 Sep 2008 01:49:47 +0000 (21:49 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 13 Jan 2009 01:43:39 +0000 (20:43 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index a33171d55498ce0c2ce1cf04ee1a877c491f775f..36ceaafcfb470520f8950fe4e81cdb5db63846f8 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 */