ZFS_DEBUG + enable ZFS ASSERTS with INVARIANTS any objections?

Andriy Gapon avg at FreeBSD.org
Fri Jul 26 15:01:40 UTC 2013


on 26/07/2013 17:46 Steven Hartland said the following:
> ----- Original Message ----- From: "Andriy Gapon" <avg at FreeBSD.org>
> 
> 
>> on 26/07/2013 17:09 Steven Hartland said the following:
>>> I tried an alternative version (attached) based on Justin's feedback,
>>> which but enables DEBUG in all opensolaris modules when INVARIANTS is in
>>> effect.
>>>
>>> Unfortunately it results in all the LOR being printed so I'm not a fan
>>> TBH, I prefer the option to enable ASSERTS ony by changing debug.h
>>
>> Hmm, I am not sure what exactly is the problem...
>> LOR detection and reporting is controlled by WITNESS, as I understand, and
>> WITNESS is orthogonal to INVARIANTS.
> 
> I believe theirs a connection between DEBUG and LOR reporting, specificaly
> in rwlock.h when not under DEBUG RW_FLAGS includes SX_NOWITNESS.

( I guessed that you mean sys/cddl/compat/opensolaris/sys/rwlock.h of all
rwlock.h files under sys/)

Yes.  But I mean that if you don't have WITNESS in the first place, then you
don't get any LOR reports.  And if you have WITNESS you should expect that ZFS
is covered too.

On the other hand, I also think that DEBUG should not have grown any new
meanings during porting.  E.g. in your example it should have been something
like ZFS_WITNESS or OPENSOLARIS_WITNESS, but not DEBUG, because DEBUG already
had specific meaning for osol code.  I think that this should be fixed as well.

-- 
Andriy Gapon


More information about the zfs-devel mailing list