From 6afd9210909a1a7f6ed5e5a15fc9d1cf815a555e Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Wed, 30 Jan 2019 17:24:50 +0000 Subject: [PATCH] Only sort requests of types that have concept of offset. Other types, such as BIO_FLUSH or BIO_ZONE, or especially new/unknown ones, may imply some degree of ordering even if strict ordering is not requested explicitly. MFC after: 2 weeks Sponsored by: iXsystems, Inc. --- sys/kern/subr_disk.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 328111337c93..ea364a2a1dfa 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -259,6 +259,17 @@ bioq_disksort(struct bio_queue_head *head, struct bio *bp) return; } + /* + * We should only sort requests of types that have concept of offset. + * Other types, such as BIO_FLUSH or BIO_ZONE, may imply some degree + * of ordering even if strict ordering is not requested explicitly. + */ + if (bp->bio_cmd != BIO_READ && bp->bio_cmd != BIO_WRITE && + bp->bio_cmd != BIO_DELETE) { + bioq_insert_tail(head, bp); + return; + } + if (bioq_batchsize > 0 && head->batched > bioq_batchsize) { bioq_insert_tail(head, bp); return;