All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ovl: copy up files with incompatible xattrs
@ 2018-04-16 14:35 Goldwyn Rodrigues
  2018-05-17 18:40 ` Goldwyn Rodrigues
  2018-05-17 19:26 ` Vivek Goyal
  0 siblings, 2 replies; 6+ messages in thread
From: Goldwyn Rodrigues @ 2018-04-16 14:35 UTC (permalink / raw)
  To: linux-unionfs; +Cc: rgoldwyn, Fabian Vogt

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"
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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-21 18:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2018-05-17 22:30   ` Goldwyn Rodrigues
2018-05-18  7:29     ` Miklos Szeredi
2018-05-21 18:53       ` Goldwyn Rodrigues

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.