ovl: relax WARN_ON() on rename to self
Amir Goldstein
maintainerPATCH 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+
Signed-off-by Amir Goldstein <[email protected]>
--- fs/overlayfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/overlayfs/dir.c +1 -1
@@ -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