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

index b1a454a1c5cb0861846df403f647dda08a065a1f..4737be2e9f7aa089099d0bd5d77ff2cac6ac7d4f 100644 (file)
@@ -907,7 +907,10 @@ static int unionfs_setattr(struct dentry *dentry, struct iattr *ia)
        inode = dentry->d_inode;
 
        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 */