Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / md / dm-vdo / permassert.c
blobbf9eccea1cb33970eb413c2efb8d83ab375dd024
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright 2023 Red Hat
4 */
6 #include "permassert.h"
8 #include "errors.h"
9 #include "logger.h"
11 int vdo_assertion_failed(const char *expression_string, const char *file_name,
12 int line_number, const char *format, ...)
14 va_list args;
16 va_start(args, format);
18 vdo_log_embedded_message(VDO_LOG_ERR, VDO_LOGGING_MODULE_NAME, "assertion \"",
19 format, args, "\" (%s) failed at %s:%d",
20 expression_string, file_name, line_number);
21 vdo_log_backtrace(VDO_LOG_ERR);
23 va_end(args);
25 return UDS_ASSERTION_FAILED;