From: Erez Zadok Date: Wed, 17 Sep 2008 07:24:57 +0000 (-0400) Subject: Unionfs: return EINVAL in setattr on error X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=c9d719188157dbde6a566cd51a5c16e9b7424212;p=unionfs-2.6.39.y.git Unionfs: return EINVAL in setattr on error Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c index dcf066c399c..15e1e331d28 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 */