]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-inline-bug-for-linux-20060831
authorChas Williams <chas@cmf.nrl.navy.mil>
Thu, 31 Aug 2006 05:52:15 +0000 (05:52 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 31 Aug 2006 05:52:15 +0000 (05:52 +0000)
FIXES 38854

inline bug so we get sane oopses

(cherry picked from commit d86f0c44d3c5910a6b54895484dc0286eac9bc73)

src/afs/afs_osi.h
src/rx/rx_kcommon.c
src/rx/rx_prototypes.h

index 771c12214e037d83d1fedb2e5b0e2bf9312d6999..36b4c579ccd877a2a0735bc7fbdcddaf976664b4 100644 (file)
@@ -220,7 +220,7 @@ typedef struct timeval osi_timeval_t;
 
 #ifdef AFS_GLOBAL_SUNLOCK
 #define AFS_ASSERT_GLOCK() \
-    (ISAFS_GLOCK() || (osi_Panic("afs global lock not held at %s:%d\n", __FILE__, __LINE__), 0))
+    do { if (!ISAFS_GLOCK()) osi_Panic("afs global lock not held at %s:%d\n", __FILE__, __LINE__); } while (0)
 #endif /* AFS_GLOBAL_SUNLOCK */
 
 #ifdef RX_ENABLE_LOCKS
index 5cb65cc525cecdb8b30461d288a9f55b98460edc..2fdda16457e6aeae8a0ee0d028a68ae0cf7ab35a 100644 (file)
@@ -124,6 +124,7 @@ rxi_GetUDPSocket(u_short port)
     return rxi_GetHostUDPSocket(htonl(INADDR_ANY), port);
 }
 
+#if !defined(AFS_LINUX26_ENV)
 void
 osi_Panic(msg, a1, a2, a3)
      char *msg;
@@ -132,7 +133,7 @@ osi_Panic(msg, a1, a2, a3)
        msg = "Unknown AFS panic";
 
     printf(msg, a1, a2, a3);
-#ifdef AFS_LINUX24_ENV
+#ifdef AFS_LINUX20_ENV
     * ((char *) 0) = 0; 
 #else
     panic(msg);
@@ -261,6 +262,13 @@ osi_AssertFailK(const char *expr, const char *file, int line)
 
     osi_Panic(buf);
 }
+#else
+void
+osi_AssertFailK(const char *expr, const char *file, int line)
+{
+    printk(KERN_CRIT "assertion failed: %s, file: %s, line: %d\n", expr, file, line);
+}
+#endif
 
 #ifndef UKERNEL
 /* This is the server process request loop. Kernel server
index a36928384fe84af0402bf98786d66562ad9e22b1..45beca463c7301be0511743df7e256ee53b2276a 100644 (file)
@@ -337,7 +337,14 @@ extern int rxk_DelPort(u_short aport);
 extern void rxk_shutdownPorts(void);
 extern osi_socket rxi_GetUDPSocket(u_short port);
 extern osi_socket rxi_GetHostUDPSocket(u_int host, u_short port);
-extern void osi_Panic();
+#if defined(KERNEL) && defined(AFS_LINUX26_ENV)
+#define osi_Panic(msg...) do { printk(KERN_CRIT "openafs: " msg); BUG(); } while (0)
+#undef osi_Assert
+#define osi_Assert(expr) \
+    do { if (!(expr)) { osi_AssertFailK(#expr, __FILE__, __LINE__); BUG(); } } while (0)
+#else
+extern void osi_Panic();       /* leave without args till stdarg rewrite */
+#endif
 extern int osi_utoa(char *buf, size_t len, unsigned long val);
 extern void rxi_InitPeerParams(register struct rx_peer *pp);
 extern void shutdown_rxkernel(void);
@@ -568,7 +575,6 @@ extern pthread_mutex_t rx_if_mutex;
 extern osi_socket rxi_GetUDPSocket(u_short port);
 extern void osi_AssertFailU(const char *expr, const char *file, int line);
 extern int rx_getAllAddr(afs_int32 * buffer, int maxSize);
-extern void osi_Panic();       /* leave without args till stdarg rewrite */
 extern void rxi_InitPeerParams(struct rx_peer *pp);
 
 #if defined(AFS_AIX32_ENV) && !defined(KERNEL)