summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorVratislav Bendel <vbendel@redhat.com>2018-03-07 04:07:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-06 14:09:25 +0300
commit22668f45d6adb55d8632c7fa999360a7d873ca0a (patch)
treed8571cf2c0131e27ccfced9e09ebadb1a1b57e6d /fs
parent90edf68180bf9fa03a26d1fa59fc92915e4018e3 (diff)
downloadlinux-22668f45d6adb55d8632c7fa999360a7d873ca0a.tar.xz
xfs: Correctly invert xfs_buftarg LRU isolation logic
commit 19957a181608d25c8f4136652d0ea00b3738972d upstream. 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: Vratislav Bendel <vbendel@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Alex Lyakas <alex@zadara.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_buf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index dcb70969ff1c..44d65939ed18 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1584,7 +1584,7 @@ xfs_buftarg_isolate(
* zero. If the value is already zero, we need to reclaim the
* 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);
return LRU_ROTATE;
}