Re: [PATCH 3/4] xfs: fix stray dquot unlock when reclaiming dquots

Christoph Hellwig
2012-11-28T13:26:40Z

On Wed, Nov 28, 2012 at 01:01:02PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> When we fail to get a dquot lock during reclaim, we jump to an error
> handler that unlocks the dquot. This is wrong as we didn't lock the
> dquot, and unlocking it means who-ever is holding the lock has had
> it silently taken away, and hence it results in a lock imbalance.
>
> Found by inspection while modifying the code for the numa-lru
> patchset. This fixes a random hang I've been seeing on xfstest 232
> for the past several months.

Ooops. I'm kinda surprise the mutex code never cought the double unlock.
Beeing able to detect this was on of the sellings points for it vs the
old semaphores.

Reviewed-by: Christoph Hellwig <hch@lst.de>