Don't look at the block after calling qbypass
authorRonald G. Minnich <rminnich@gmail.com>
Thu, 28 Apr 2016 06:10:41 +0000 (23:10 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 28 Apr 2016 19:48:48 +0000 (15:48 -0400)
The bypass functions call bpfree. There's no guarantee
about the block pointer after calling the function.

This is probably why, in the original, the bypass functions
returned the data consumed. For now, realistically, it's all
consumed.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/ns/qio.c

index f1ddf6a..9bf7764 100644 (file)
@@ -1492,8 +1492,9 @@ static ssize_t __qbwrite(struct queue *q, struct block *b, int qio_flags)
        bool was_empty;
 
        if (q->bypass) {
+               ret = blocklen(b);
                (*q->bypass) (q->arg, b);
-               return blocklen(b);
+               return ret;
        }
        spin_lock_irqsave(&q->lock);
        was_empty = q->len == 0;