[xenial/master-next,1/1] UBUNTU: SAUCE: overlayfs: fix regression in whiteout detection
diff mbox

Message ID 20160906124734.26836-2-apw@canonical.com
State New
Headers show

Commit Message

Andy Whitcroft Sept. 6, 2016, 12:47 p.m. UTC
The Ubuntu backport of the below commit necessarily had to follow the
changes to is_ovl_whiteout.  In the process the wrong dentry was passed
preventing correct detection of legacy whitouts in a rename over a
whitout on some upper filesystem types (at least ramfs):

  commit 11f3710417d026ea2f4fcf362d866342c5274185
  Author: Miklos Szeredi <mszeredi@redhat.com>
  Date:   Mon Mar 21 17:31:44 2016 +0100

    ovl: verify upper dentry before unlink and rename

Pass the correct dentry to allow detection of the appropriate whiteout
types.

Fixes: 11f3710417d0 ("ovl: verify upper dentry before unlink and rename") in Ubuntu
BugLink: http://bugs.launchpad.net/bugs/1618572
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 fs/overlayfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Bader Sept. 6, 2016, 1 p.m. UTC | #1
Fixes overlayfs-root in my test environment.

Patch
diff mbox

diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index f85f51f..01b6b8a 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -919,7 +919,7 @@  static int ovl_rename2(struct inode *olddir, struct dentry *old,
 	} else {
 		new_create = true;
 		if (!d_is_negative(newdentry) &&
-		    (!new_opaque || !ovl_is_whiteout(newdentry,ovl_config_legacy(newdentry))))
+		    (!new_opaque || !ovl_is_whiteout(newdentry,ovl_config_legacy(new))))
 			goto out_dput;
 	}