• Amir Goldstein's avatar
    ovl: fix nested overlayfs mount · 48fab5d7
    Amir Goldstein authored
    When the upper overlayfs checks "trusted.overlay.*" xattr on the underlying
    overlayfs mount, it gets -EPERM, which confuses the upper overlayfs.
    
    Fix this by returning -EOPNOTSUPP instead of -EPERM from
    ovl_own_xattr_get() and ovl_own_xattr_set().  This behavior is consistent
    with the behavior of ovl_listxattr(), which filters out the private
    overlayfs xattrs.
    
    Note: nested overlays are deprecated.  But this change makes sense
    regardless: these xattrs are private to the overlay and should always be
    hidden.  Hence getting and setting them should indicate this.
    
    [SzMi: Use EOPNOTSUPP instead of ENODATA and use it for both getting and
    setting "trusted.overlay." xattrs.  This is a perfectly valid error code
    for "we don't support this prefix", which is the case here.]
    Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    48fab5d7
super.c 21.5 KB