From: Jens Axboe Date: Mon, 21 Jun 2010 07:01:33 +0000 (+0200) Subject: Fix a bug with multiple files in the same io_piece rbtree X-Git-Tag: fio-1.41.1~1 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=968b605460eb4912bdb0b7bc9ace79694865386f;p=fio.git Fix a bug with multiple files in the same io_piece rbtree Sort by file first, then sort by offset. This avoids false positives on IO aliases, when it's really for a different file. Signed-off-by: Jens Axboe --- diff --git a/log.c b/log.c index 6a99c661..5fc8f64b 100644 --- a/log.c +++ b/log.c @@ -219,7 +219,11 @@ restart: parent = *p; __ipo = rb_entry(parent, struct io_piece, rb_node); - if (ipo->offset < __ipo->offset) + if (ipo->file < __ipo->file) + p = &(*p)->rb_left; + else if (ipo->file > __ipo->file) + p = &(*p)->rb_right; + else if (ipo->offset < __ipo->offset) p = &(*p)->rb_left; else if (ipo->offset > __ipo->offset) p = &(*p)->rb_right;