ovl: explain error values when removing acl from workdir
authorMiklos Szeredi <mszeredi@redhat.com>
Tue, 4 Oct 2016 12:40:44 +0000 (14:40 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 14 Oct 2016 09:16:46 +0000 (11:16 +0200)
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/super.c

index 8ccebaf64c5b39d412b6abc092b258c08fcad7d5..eff0f909cd788de26dbf5ca5de95a5054f78eec2 100644 (file)
@@ -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;