[lkml]   [2019]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.14 195/267] ovl: relax WARN_ON() on rename to self
From: Amir Goldstein <>

commit 6889ee5a53b8d969aa542047f5ac8acdc0e79a91 upstream.

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().

Fixes: 804032fabb3b ("ovl: don't check rename to self")
Cc: <> # v4.9+
Signed-off-by: Amir Goldstein <>
Signed-off-by: Miklos Szeredi <>
Signed-off-by: Greg Kroah-Hartman <>

fs/overlayfs/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -1042,7 +1042,7 @@ static int ovl_rename(struct inode *oldd
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;

 \ /
  Last update: 2019-12-16 18:58    [W:0.498 / U:4.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site