There are too many false positive LORs reported by WITNESS, so when ZFS

debug is turned off, initialize locks with NOWITNESS flag.
At some point I'll get back to them, we would probably need BLESSING
functionality, which is currently turned off by default.
This commit is contained in:
pjd 2007-05-26 21:37:14 +00:00
parent cbfe2577e0
commit 88c31e8d66
4 changed files with 28 additions and 4 deletions

View File

@ -46,12 +46,18 @@ typedef enum {
typedef struct sx kmutex_t;
#ifndef DEBUG
#define MUTEX_FLAGS (SX_DUPOK | SX_NOWITNESS)
#else
#define MUTEX_FLAGS (SX_DUPOK)
#endif
#define mutex_init(lock, desc, type, arg) do { \
ASSERT((type) == MUTEX_DEFAULT); \
KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \
LO_EXPECTED, ("lock %s already initialized", #lock)); \
bzero((lock), sizeof(struct sx)); \
sx_init_flags((lock), "zfs:" #lock, SX_DUPOK); \
sx_init_flags((lock), "zfs:" #lock, MUTEX_FLAGS); \
} while (0)
#define mutex_destroy(lock) sx_destroy(lock)
#define mutex_enter(lock) sx_xlock(lock)

View File

@ -48,6 +48,12 @@ typedef enum {
typedef struct sx krwlock_t;
#ifndef DEBUG
#define RW_FLAGS (SX_DUPOK | SX_NOWITNESS)
#else
#define RW_FLAGS (SX_DUPOK)
#endif
#define RW_READ_HELD(x) (rw_read_held((x)))
#define RW_WRITE_HELD(x) (rw_write_held((x)))
#define RW_LOCK_HELD(x) (rw_lock_held((x)))
@ -57,7 +63,7 @@ typedef struct sx krwlock_t;
KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \
LO_EXPECTED, ("lock %s already initialized", #lock)); \
bzero((lock), sizeof(struct sx)); \
sx_init_flags((lock), "zfs:" #lock, SX_DUPOK); \
sx_init_flags((lock), "zfs:" #lock, RW_FLAGS); \
} while (0)
#define rw_destroy(lock) sx_destroy(lock)
#define rw_enter(lock, how) do { \

View File

@ -46,12 +46,18 @@ typedef enum {
typedef struct sx kmutex_t;
#ifndef DEBUG
#define MUTEX_FLAGS (SX_DUPOK | SX_NOWITNESS)
#else
#define MUTEX_FLAGS (SX_DUPOK)
#endif
#define mutex_init(lock, desc, type, arg) do { \
ASSERT((type) == MUTEX_DEFAULT); \
KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \
LO_EXPECTED, ("lock %s already initialized", #lock)); \
bzero((lock), sizeof(struct sx)); \
sx_init_flags((lock), "zfs:" #lock, SX_DUPOK); \
sx_init_flags((lock), "zfs:" #lock, MUTEX_FLAGS); \
} while (0)
#define mutex_destroy(lock) sx_destroy(lock)
#define mutex_enter(lock) sx_xlock(lock)

View File

@ -48,6 +48,12 @@ typedef enum {
typedef struct sx krwlock_t;
#ifndef DEBUG
#define RW_FLAGS (SX_DUPOK | SX_NOWITNESS)
#else
#define RW_FLAGS (SX_DUPOK)
#endif
#define RW_READ_HELD(x) (rw_read_held((x)))
#define RW_WRITE_HELD(x) (rw_write_held((x)))
#define RW_LOCK_HELD(x) (rw_lock_held((x)))
@ -57,7 +63,7 @@ typedef struct sx krwlock_t;
KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \
LO_EXPECTED, ("lock %s already initialized", #lock)); \
bzero((lock), sizeof(struct sx)); \
sx_init_flags((lock), "zfs:" #lock, SX_DUPOK); \
sx_init_flags((lock), "zfs:" #lock, RW_FLAGS); \
} while (0)
#define rw_destroy(lock) sx_destroy(lock)
#define rw_enter(lock, how) do { \