ovl: ignore failure to copy up unknown xattrs
authorMiklos Szeredi <mszeredi@redhat.com>
Tue, 17 Mar 2020 14:04:22 +0000 (15:04 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 17 Mar 2020 14:04:22 +0000 (15:04 +0100)
commitc61ca5572508516b41039aecb23d936466076950
treecb00e9b4a0f9ec99f7c32ce528c6d448ee542cc0
parent4c494bd582fa23d2d70851e958da6cee1dc161cb
ovl: ignore failure to copy up unknown xattrs

This issue came up with NFSv4 as the lower layer, which generates
"system.nfs4_acl" xattrs (even for plain old unix permissions).  Prior to
this patch this prevented copy-up from succeeding.

The overlayfs permission model mandates that permissions are checked
locally for the task and remotely for the mounter(*).  NFS4 ACLs are not
supported by the Linux kernel currently, hence they cannot be enforced
locally.  Which means it is indifferent whether this attribute is copied or
not.

Generalize this to any xattr that is not used in access checking (i.e. it's
not a POSIX ACL and not in the "security." namespace).

Incidentally, best effort copying of xattrs seems to also be the behavior
of "cp -a", which is what overlayfs tries to mimic.

(*) Documentation/filesystems/overlayfs.txt#Permission model

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/copy_up.c