stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3] ovl: Pass ovl_get_nlink() parameters in right order
@ 2017-11-28 14:20 Vivek Goyal
  0 siblings, 0 replies; only message in thread
From: Vivek Goyal @ 2017-11-28 14:20 UTC (permalink / raw)
  To: linux-unionfs; +Cc: Amir Goldstein, Miklos Szeredi, vgoyal, stable

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.

Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries")
Cc: <stable@vger.kernel.org> #4.13
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 fs/overlayfs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 625ed8066570..5ef69bc09e0c 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -435,7 +435,7 @@ int ovl_verify_index(struct dentry *index, struct ovl_path *lower,
 
 	/* 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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-28 14:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-28 14:20 [PATCH V3] ovl: Pass ovl_get_nlink() parameters in right order Vivek Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).