The driver should free descriptors, not interrupt handler. This

avoids handler freeing descriptors before driver sees that the request
has completed.
This commit is contained in:
Frans Kaashoek 2019-07-30 08:13:03 -04:00
parent 5304310452
commit f1bb53c690

View file

@ -239,6 +239,9 @@ virtio_disk_rw(struct buf *b, int write)
sleep(b, &vdisk_lock);
}
info[idx[0]].b = 0;
free_chain(idx[0]);
release(&vdisk_lock);
}
@ -256,9 +259,6 @@ virtio_disk_intr()
info[id].status = 1;
wakeup(info[id].b);
info[id].b = 0;
free_chain(id);
used_idx = (used_idx + 1) % NUM;
}