提交 19957a18 编写于 作者: V Vratislav Bendel 提交者: Darrick J. Wong

xfs: Correctly invert xfs_buftarg LRU isolation logic

Due to an inverted logic mistake in xfs_buftarg_isolate()
the xfs_buffers with zero b_lru_ref will take another trip
around LRU, while isolating buffers with non-zero b_lru_ref.

Additionally those isolated buffers end up right back on the LRU
once they are released, because b_lru_ref remains elevated.

Fix that circuitous route by leaving them on the LRU
as originally intended.
Signed-off-by: NVratislav Bendel <vbendel@redhat.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 4df0f7f1
...@@ -1708,7 +1708,7 @@ xfs_buftarg_isolate( ...@@ -1708,7 +1708,7 @@ xfs_buftarg_isolate(
* zero. If the value is already zero, we need to reclaim the * zero. If the value is already zero, we need to reclaim the
* buffer, otherwise it gets another trip through the LRU. * buffer, otherwise it gets another trip through the LRU.
*/ */
if (!atomic_add_unless(&bp->b_lru_ref, -1, 0)) { if (atomic_add_unless(&bp->b_lru_ref, -1, 0)) {
spin_unlock(&bp->b_lock); spin_unlock(&bp->b_lock);
return LRU_ROTATE; return LRU_ROTATE;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册