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:
parent
5304310452
commit
f1bb53c690
1 changed files with 3 additions and 3 deletions
|
@ -239,6 +239,9 @@ virtio_disk_rw(struct buf *b, int write)
|
||||||
sleep(b, &vdisk_lock);
|
sleep(b, &vdisk_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info[idx[0]].b = 0;
|
||||||
|
free_chain(idx[0]);
|
||||||
|
|
||||||
release(&vdisk_lock);
|
release(&vdisk_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,9 +259,6 @@ virtio_disk_intr()
|
||||||
info[id].status = 1;
|
info[id].status = 1;
|
||||||
wakeup(info[id].b);
|
wakeup(info[id].b);
|
||||||
|
|
||||||
info[id].b = 0;
|
|
||||||
free_chain(id);
|
|
||||||
|
|
||||||
used_idx = (used_idx + 1) % NUM;
|
used_idx = (used_idx + 1) % NUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue