]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commitdiff
log entry_poison
authorAlex Markuze <amarkuze@redhat.com>
Sun, 16 Mar 2025 19:06:18 +0000 (19:06 +0000)
committerAlex Markuze <amarkuze@redhat.com>
Sun, 16 Mar 2025 19:06:18 +0000 (19:06 +0000)
include/linux/ceph/ceph_san_logger.h
net/ceph/ceph_san_logger.c

index 7d7846f108393dbd0c3a05384f6aeba52d28e036..46a7f1c4071d64f33084b3e4b40ee8804455a9c9 100644 (file)
 
 /* Maximum length of a log entry buffer */
 #define CEPH_SAN_LOG_MAX_LEN 256
-
+#define CEPH_SAN_LOG_ENTRY_POISON 0xDEADBEEF
 /* Log entry structure */
 struct ceph_san_log_entry {
+    u64 debug_poison;           /* Debug poison value */
     u64 ts;                     /* Timestamp (jiffies) */
     unsigned int line;          /* Line number */
     unsigned int len;           /* Length of the message */
index dd120785fcc5da7943952c0d6cb6fa8fa7d9c56e..6e9eb8c547ace2a628481d9b79471b0267a49b9a 100644 (file)
@@ -134,6 +134,7 @@ void ceph_san_log(const char *file, unsigned int line, const char *fmt, ...)
     alloc = cephsan_pagefrag_alloc(&ctx->pf, sizeof(*entry) + len + 1);
     while (!alloc) {
         entry = cephsan_pagefrag_get_ptr_from_tail(&ctx->pf);
+        BUG_ON(entry->debug_poison != CEPH_SAN_LOG_ENTRY_POISON);
         cephsan_pagefrag_free(&ctx->pf, entry->len);
         alloc = cephsan_pagefrag_alloc(&ctx->pf, sizeof(*entry) + len + 1);
     }
@@ -144,6 +145,7 @@ void ceph_san_log(const char *file, unsigned int line, const char *fmt, ...)
     entry->buffer[len] = '\0';
 
     /* Fill in entry details */
+    entry->debug_poison = CEPH_SAN_LOG_ENTRY_POISON;
     entry->ts = jiffies;
     entry->line = line;
     entry->file = file;