From 9bab9107fd8c18b2e8d2657c2fa81b50eaa502e5 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Mon, 11 Feb 2013 10:08:21 -0500 Subject: [PATCH] --- yaml --- r: 352942 b: refs/heads/master c: 5337fe9b108d602c483fe9d62ffef9227acf3a74 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/xfs/xfs_buf_item.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index c2a29f76a289..83ba0533db62 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a1e16c26660b301cc8423185924cf1b0b16ea92b +refs/heads/master: 5337fe9b108d602c483fe9d62ffef9227acf3a74 diff --git a/trunk/fs/xfs/xfs_buf_item.c b/trunk/fs/xfs/xfs_buf_item.c index 9c4c050e4270..cf263476d6b4 100644 --- a/trunk/fs/xfs/xfs_buf_item.c +++ b/trunk/fs/xfs/xfs_buf_item.c @@ -469,8 +469,18 @@ xfs_buf_item_push( if (xfs_buf_ispinned(bp)) return XFS_ITEM_PINNED; - if (!xfs_buf_trylock(bp)) + if (!xfs_buf_trylock(bp)) { + /* + * If we have just raced with a buffer being pinned and it has + * been marked stale, we could end up stalling until someone else + * issues a log force to unpin the stale buffer. Check for the + * race condition here so xfsaild recognizes the buffer is pinned + * and queues a log force to move it along. + */ + if (xfs_buf_ispinned(bp)) + return XFS_ITEM_PINNED; return XFS_ITEM_LOCKED; + } ASSERT(!(bip->bli_flags & XFS_BLI_STALE));