• Eric Sandeen's avatar
    xfs: only return -errno or success from attr ->put_listent · 2a6fba6d
    Eric Sandeen authored
    Today, the put_listent formatters return either 1 or 0; if
    they return 1, some callers treat this as an error and return
    it up the stack, despite "1" not being a valid (negative)
    error code.
    
    The intent seems to be that if the input buffer is full,
    we set seen_enough or set count = -1, and return 1;
    but some callers check the return before checking the
    seen_enough or count fields of the context.
    
    Fix this by only returning non-zero for actual errors
    encountered, and rely on the caller to first check the
    return value, then check the values in the context to
    decide what to do.
    Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    
    2a6fba6d
xfs_xattr.c 6.11 KB