From: Miklos Szeredi Date: Tue, 4 Oct 2016 12:40:44 +0000 (+0200) Subject: ovl: explain error values when removing acl from workdir X-Git-Tag: v4.9-rc1~8^2~3 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=cb348edb6bef7250d1d0f8f2d7dac152d8b52626;hp=6a45b3628ce4dcf7498b39c87d475bab6e2a9b24;p=cascardo%2Flinux.git ovl: explain error values when removing acl from workdir Suggested-by: Linus Torvalds Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 8ccebaf64c5b..eff0f909cd78 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -832,6 +832,19 @@ retry: if (err) goto out_dput; + /* + * Try to remove POSIX ACL xattrs from workdir. We are good if: + * + * a) success (there was a POSIX ACL xattr and was removed) + * b) -ENODATA (there was no POSIX ACL xattr) + * c) -EOPNOTSUPP (POSIX ACL xattrs are not supported) + * + * There are various other error values that could effectively + * mean that the xattr doesn't exist (e.g. -ERANGE is returned + * if the xattr name is too long), but the set of filesystems + * allowed as upper are limited to "normal" ones, where checking + * for the above two errors is sufficient. + */ err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT); if (err && err != -ENODATA && err != -EOPNOTSUPP) goto out_dput;