diff mbox series

[SRU,FOCAL,2/2] Revert "UBUNTU: SAUCE: overlayfs: use shiftfs hacks only with shiftfs as underlay"

Message ID 20200521111210.3568-3-kleber.souza@canonical.com
State New
Headers show
Series Reverts to fix overlayfs regression | expand

Commit Message

Kleber Sacilotto de Souza May 21, 2020, 11:12 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1879690

This reverts commit 6f18a8434050333afc80b5bfce2e0e994c86b790.

The change applied for LP: #1857257 and its followup fix LP: #1876645
introduced a regression on overlayfs. Revert these commits for now.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
---
 fs/overlayfs/file.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Colin Ian King May 21, 2020, 11:22 a.m. UTC | #1
On 21/05/2020 12:12, Kleber Sacilotto de Souza wrote:
> BugLink: https://bugs.launchpad.net/bugs/1879690
> 
> This reverts commit 6f18a8434050333afc80b5bfce2e0e994c86b790.
> 
> The change applied for LP: #1857257 and its followup fix LP: #1876645
> introduced a regression on overlayfs. Revert these commits for now.
> 
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
> ---
>  fs/overlayfs/file.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
> index a2faa086ee4b..1a1c1746bf83 100644
> --- a/fs/overlayfs/file.c
> +++ b/fs/overlayfs/file.c
> @@ -3,7 +3,6 @@
>   * Copyright (C) 2017 Red Hat, Inc.
>   */
>  
> -#include <uapi/linux/magic.h>
>  #include <linux/cred.h>
>  #include <linux/file.h>
>  #include <linux/mount.h>
> @@ -32,12 +31,9 @@ static struct file *ovl_open_realfile(const struct file *file,
>  	int flags = file->f_flags | O_NOATIME | FMODE_NONOTIFY;
>  
>  	old_cred = ovl_override_creds(inode->i_sb);
> -	if (realpath.dentry->d_sb->s_magic == SHIFTFS_MAGIC)
> -		realfile = open_with_fake_path(&realpath, flags, realinode,
> -					       current_cred());
> -	else
> -		realfile = open_with_fake_path(&file->f_path, flags, realinode,
> -					       current_cred());
> +	ovl_path_real(file->f_path.dentry, &realpath);
> +	realfile = open_with_fake_path(&realpath, flags, realinode,
> +				       current_cred());
>  	revert_creds(old_cred);
>  
>  	pr_debug("open(%p[%pD2/%c], 0%o) -> (%p, 0%o)\n",
> 

Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox series

Patch

diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
index a2faa086ee4b..1a1c1746bf83 100644
--- a/fs/overlayfs/file.c
+++ b/fs/overlayfs/file.c
@@ -3,7 +3,6 @@ 
  * Copyright (C) 2017 Red Hat, Inc.
  */
 
-#include <uapi/linux/magic.h>
 #include <linux/cred.h>
 #include <linux/file.h>
 #include <linux/mount.h>
@@ -32,12 +31,9 @@  static struct file *ovl_open_realfile(const struct file *file,
 	int flags = file->f_flags | O_NOATIME | FMODE_NONOTIFY;
 
 	old_cred = ovl_override_creds(inode->i_sb);
-	if (realpath.dentry->d_sb->s_magic == SHIFTFS_MAGIC)
-		realfile = open_with_fake_path(&realpath, flags, realinode,
-					       current_cred());
-	else
-		realfile = open_with_fake_path(&file->f_path, flags, realinode,
-					       current_cred());
+	ovl_path_real(file->f_path.dentry, &realpath);
+	realfile = open_with_fake_path(&realpath, flags, realinode,
+				       current_cred());
 	revert_creds(old_cred);
 
 	pr_debug("open(%p[%pD2/%c], 0%o) -> (%p, 0%o)\n",