All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: linux-unionfs@vger.kernel.org, rgoldwyn@suse.com,
	Fabian Vogt <fvogt@suse.com>
Subject: Re: [PATCH] ovl: copy up files with incompatible xattrs
Date: Thu, 17 May 2018 15:26:38 -0400	[thread overview]
Message-ID: <20180517192638.GA4979@redhat.com> (raw)
In-Reply-To: <20180416143525.8328-1-rgoldwyn@suse.de>

On Mon, Apr 16, 2018 at 09:35:25AM -0500, Goldwyn Rodrigues wrote:
> From: Fabian Vogt <fvogt@suse.com>
> 
> xattrs are not guarantees to be compatible across different filesystems.
> Operations which lead to copying of files to the upper layer fail with an
> "Operation not supported" error from the filesystem if a xattr could not be
> written in the upper layer. We can safely ignore "system" xattrs.
> 
> One easy to hit example is using NFS as a read-only lower layer and !NFS as
> upper layer to store changes. Files on NFS can have the "system.nfs4_acl"

I don't know much about nfs4_acl. But name suggests that it stored ACLs
there. So if we ignore these over copy up, does that mean we are not
enforcing ACL policy over copy up. So say some user which was not able
to read a file when it was on lower, might be able to read it after
copy up?

Or I have completely misunderstood it?

Vivek

> xattr set to make the full information available to userspace, but it cannot
> be written to on other filesystems.
> 
> Signed-off-by: Fabian Vogt <fvogt@suse.com>
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
> ---
>  fs/overlayfs/copy_up.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
> index d855f508fa20..e7662e9664be 100644
> --- a/fs/overlayfs/copy_up.c
> +++ b/fs/overlayfs/copy_up.c
> @@ -125,6 +125,10 @@ int ovl_copy_xattr(struct dentry *old, struct dentry *new)
>  			continue; /* Discard */
>  		}
>  		error = vfs_setxattr(new, name, value, size, 0);
> +		if (error == -EOPNOTSUPP && strncmp("system.", name, 7) == 0) {
> +			error = 0;
> +			continue; /* Discard */
> +		}
>  		if (error)
>  			break;
>  	}
> -- 
> 2.16.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-05-17 19:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16 14:35 [PATCH] ovl: copy up files with incompatible xattrs Goldwyn Rodrigues
2018-05-17 18:40 ` Goldwyn Rodrigues
2018-05-17 19:26 ` Vivek Goyal [this message]
2018-05-17 22:30   ` Goldwyn Rodrigues
2018-05-18  7:29     ` Miklos Szeredi
2018-05-21 18:53       ` Goldwyn Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180517192638.GA4979@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=fvogt@suse.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=rgoldwyn@suse.com \
    --cc=rgoldwyn@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.