xfs
[Top] [All Lists]

Re: [PATCH v4 1/2] xfs: recheck buffer pinned status after push trylock

To: Brian Foster <bfoster@xxxxxxxxxx>
Subject: Re: [PATCH v4 1/2] xfs: recheck buffer pinned status after push trylock failure
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 12 Feb 2013 08:53:05 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1360595302-15865-2-git-send-email-bfoster@xxxxxxxxxx>
References: <1360595302-15865-1-git-send-email-bfoster@xxxxxxxxxx> <1360595302-15865-2-git-send-email-bfoster@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Feb 11, 2013 at 10:08:21AM -0500, Brian Foster wrote:
> The buffer pinned check and trylock sequence in xfs_buf_item_push()
> can race with an active transaction on marking the buffer pinned.
> This can result in the buffer becoming pinned and stale after the
> initial check and the trylock failure, but before the check in
> xfs_buf_trylock() that issues a log force. If the log force is
> issued from this context, a spinlock recursion occurs on xa_lock.
> 
> Prepare xfs_buf_item_push() to handle the race by detecting a
> pinned buffer after the trylock failure so xfsaild issues a log
> force from a safe context. This, along with various previous fixes,
> renders the log force in xfs_buf_trylock() redundant.
> 
> Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>

Looks good, doesn't seem to cause any problems I can see here.

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx

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