From: Vivek Goyal Date: Mon, 27 Nov 2017 15:12:44 +0000 (-0500) Subject: ovl: Pass ovl_get_nlink() parameters in right order X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=066f40dc495d5ab2ec9a871cb8703d9591d636c5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ovl: Pass ovl_get_nlink() parameters in right order commit 08d8f8a5b094b66b29936e8751b4a818b8db1207 upstream. Right now we seem to be passing index as "lowerdentry" and origin.dentry as "upperdentry". IIUC, we should pass these parameters in reversed order and this looks like a bug. Signed-off-by: Vivek Goyal Acked-by: Amir Goldstein Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries") Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index bc6d5c5a3443..4bb7e4f53ea6 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -437,7 +437,7 @@ int ovl_verify_index(struct dentry *index, struct path *lowerstack, /* Check if index is orphan and don't warn before cleaning it */ if (d_inode(index)->i_nlink == 1 && - ovl_get_nlink(index, origin.dentry, 0) == 0) + ovl_get_nlink(origin.dentry, index, 0) == 0) err = -ENOENT; dput(origin.dentry);