Skip to contentSkip to conversation

ovl: relax WARN_ON() on rename to self

PATCH New Amir Goldstein 1 participant 1 message Dec 6, 2019 Overlay filesystem

lore
Share & tools
lore

Amir Goldstein

author maintainer
#0 lore raw

PATCH 1/1 ovl: relax WARN_ON() on rename to self

In ovl_rename(), if new upper is hardlinked to old upper underneath overlayfs before upper dirs are locked, user will get an ESTALE error and a WARN_ON will be printed.

Changes to underlying layers while overlayfs is mounted may result in unexpected behavior, but it shouldn't crash the kernel and it shouldn't trigger WARN_ON() either, so relax this WARN_ON().

Reported-by [email protected]
Fixes 804032fabb3b ("ovl: don't check rename to self")
Cc <[email protected]> # v4.9+
---
 fs/overlayfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/overlayfs/dir.c +1 -1
index 702aa63f6774..29abdb1d3b5c 100644
@@ -1170,7 +1170,7 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
 	if (newdentry == trap)
 		goto out_dput;
 
-	if (WARN_ON(olddentry->d_inode == newdentry->d_inode))
+	if (olddentry->d_inode == newdentry->d_inode)
 		goto out_dput;
 
 	err = 0;
Signature · 1 line
2.17.1