From 967e90e5ef728aa9cd5d680ef8f14f1e1d0be2ba Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 8 Dec 2016 23:35:52 -0800 Subject: [PATCH] Fix kvec overlapping comparison The comparisons were a bit wrong when comparing overlaping kvec endpoints. We want to compare the starts and ends with the ends and starts, respectively. Signed-off-by: Zach Brown --- kmod/src/kvec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kmod/src/kvec.c b/kmod/src/kvec.c index 0e0b1f84..0db41c87 100644 --- a/kmod/src/kvec.c +++ b/kmod/src/kvec.c @@ -71,8 +71,8 @@ int scoutfs_kvec_memcmp(struct kvec *a, struct kvec *b) int scoutfs_kvec_cmp_overlap(struct kvec *a, struct kvec *b, struct kvec *c, struct kvec *d) { - return scoutfs_kvec_memcmp(a, c) < 0 ? -1 : - scoutfs_kvec_memcmp(b, d) > 0 ? 1 : 0; + return scoutfs_kvec_memcmp(b, c) < 0 ? -1 : + scoutfs_kvec_memcmp(a, d) > 0 ? 1 : 0; } /*