On Thu, Feb 20, 2020 at 08:32:32AM -0800, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 05:30:35PM +0100, Pavel Reichl wrote: > > OK, thanks for the comments. > > > > Eric in the following code is WARN_ONCE() used as you suggested or did > > you have something else in mind? > > > > static inline bool > > __xfs_rwsem_islocked( > > struct rw_semaphore *rwsem, > > bool excl) > > { > > if (!rwsem_is_locked(rwsem)) { > > return false; > > } > > > > if (excl) { > > if (debug_locks) { > > return lockdep_is_held_type(rwsem, 1); > > } > > WARN_ONCE(1, > > "xfs rwsem lock testing coverage has been reduced\n"); > > } > > Yikes, hell no. This means every debug xfs build without lockdep > will be full of warnings all the time. Well... once per module load, but if you /were/ going to go down this route I'd at least gate the warning on IS_ENABLED(CONFIG_LOCKDEP) so that we only get this one-time warning when lockdep is enabled but dies anyway, so that we'll know that we're running with half a brain. --D