lkml.org 
[lkml]   [2012]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/11] XFS: Fix lock ASSERT on UP
On Fri, Mar 16, 2012 at 12:00:58PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> ASSERT(!spin_is_locked()) doesn't work on UP builds. Replace with a standard
> lockdep_assert_held()
>
> Cc: xfs-masters@oss.sgi.com
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
> fs/xfs/xfs_iget.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
> index 8c3e463..8654d78 100644
> --- a/fs/xfs/xfs_iget.c
> +++ b/fs/xfs/xfs_iget.c
> @@ -76,7 +76,7 @@ xfs_inode_alloc(
> }
>
> ASSERT(atomic_read(&ip->i_pincount) == 0);
> - ASSERT(!spin_is_locked(&ip->i_flags_lock));
> + lockdep_assert_held(&ip->i_flags_lock);
> ASSERT(!xfs_isiflocked(ip));
> ASSERT(ip->i_ino == 0);
>
> @@ -147,7 +147,7 @@ xfs_inode_free(
>
> /* asserts to verify all state is correct here */
> ASSERT(atomic_read(&ip->i_pincount) == 0);
> - ASSERT(!spin_is_locked(&ip->i_flags_lock));
> + lockdep_assert_held(&ip->i_flags_lock);
> ASSERT(!xfs_isiflocked(ip));

So this means we only ever check that the spinlock is held when
lockdep is turned on instead of whenever CONFIG_XFS_DEBUG is set?
That means it will rarely get checked during development instead of
all the time. That's not an improvement IMO....
Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com


\
 
 \ /
  Last update: 2012-03-19 23:51    [from the cache]
©2003-2011 Jasper Spaans