From: Vivek Goyal Date: Wed, 1 Nov 2017 19:37:22 +0000 (-0400) Subject: ovl: Put upperdentry if ovl_check_origin() fails X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5455f92b54e516995a9ca45bbf790d3629c27a93;p=linux.git ovl: Put upperdentry if ovl_check_origin() fails If ovl_check_origin() fails, we should put upperdentry. We have a reference on it by now. So goto out_put_upper instead of out. Fixes: a9d019573e88 ("ovl: lookup non-dir copy-up-origin by file handle") Cc: #4.12 Signed-off-by: Vivek Goyal Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 6cc3ece3417d7..7d4099143a570 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -641,7 +641,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry, err = ovl_check_origin(upperdentry, roe->lowerstack, roe->numlower, &stack, &ctr); if (err) - goto out; + goto out_put_upper; } if (d.redirect) {