Skip to content

Commit

Permalink
ovl: relax WARN_ON() on rename to self
Browse files Browse the repository at this point in the history
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: 804032f ("ovl: don't check rename to self")
Cc: <[email protected]> # v4.9+
Signed-off-by: Amir Goldstein <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
amir73il authored and Miklos Szeredi committed Dec 10, 2019
1 parent 9c6d8f1 commit 6889ee5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/overlayfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6889ee5

Please sign in to comment.