xfs
[Top] [All Lists]

Re: [PATCH 4/7] xfs: lockdep annotations for xfs_dqlock2

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 4/7] xfs: lockdep annotations for xfs_dqlock2
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 13 Jan 2009 10:09:33 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20090112151544.GA25507@xxxxxxxxxxxxx>
Mail-followup-to: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
References: <20090109221104.237540000@xxxxxxxxxxxxxxxxxxxxxx> <20090109221300.520949000@xxxxxxxxxxxxxxxxxxxxxx> <20090111230637.GE8071@disturbed> <20090112151544.GA25507@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Mon, Jan 12, 2009 at 10:15:44AM -0500, Christoph Hellwig wrote:
> On Mon, Jan 12, 2009 at 10:06:37AM +1100, Dave Chinner wrote:
> > This looks a bit wierd.
> > 
> > Yes, xfs_dqlock() is just a wrapper around mutex_lock, but we should
> > be consistent here. Can you add a xfs_dqlock_nested() wrapper to do
> > this?
> 
> I don't think we should add more of the silly wrappers.  What about
> the version below that always uses plain mutex_lock* in xfs_dqlock2?

Fair enough.

> ---
> 
> Subject: xfs: lockdep annotations for xfs_dqlock2
> From: Christoph Hellwig <hch@xxxxxx>
> 
> xfs_dqlock2 locks two xfs_dquots, which is fine as it always locks the
> dquot with the lower id first.  Use mutex_lock_nested to tell lockdep 
> about this fact.  Also clean up xfs_dqlock2 a bit by rationalizing
> the conditionals and always using the mutex_lock family of functions
> directly.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Reviewed-by: Dave Chinner <david@xxxxxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>