diff options
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 9c4c050e4270..cf263476d6b4 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -469,8 +469,18 @@ xfs_buf_item_push( | |||
469 | 469 | ||
470 | if (xfs_buf_ispinned(bp)) | 470 | if (xfs_buf_ispinned(bp)) |
471 | return XFS_ITEM_PINNED; | 471 | return XFS_ITEM_PINNED; |
472 | if (!xfs_buf_trylock(bp)) | 472 | if (!xfs_buf_trylock(bp)) { |
473 | /* | ||
474 | * If we have just raced with a buffer being pinned and it has | ||
475 | * been marked stale, we could end up stalling until someone else | ||
476 | * issues a log force to unpin the stale buffer. Check for the | ||
477 | * race condition here so xfsaild recognizes the buffer is pinned | ||
478 | * and queues a log force to move it along. | ||
479 | */ | ||
480 | if (xfs_buf_ispinned(bp)) | ||
481 | return XFS_ITEM_PINNED; | ||
473 | return XFS_ITEM_LOCKED; | 482 | return XFS_ITEM_LOCKED; |
483 | } | ||
474 | 484 | ||
475 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); | 485 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); |
476 | 486 | ||