Commit f4e73727 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 96b16e82
...@@ -264,6 +264,15 @@ error _Conn::__pin1(PinReq *req) { ...@@ -264,6 +264,15 @@ error _Conn::__pin1(PinReq *req) {
error err; error err;
if (mmap->vma != nil) { if (mmap->vma != nil) {
mmap->_assertVMAOk(); mmap->_assertVMAOk();
// XXX recheck wrt Mapping.unmap: there it locks:
// 1. virt_lock
// 2. f.mu
//
// -> if here we do
// 1. f.mu
// 2. virt_lock
//
// -> deadlock
virt_lock(); virt_lock();
BigFileH *virt_fileh = mmap->vma->fileh; BigFileH *virt_fileh = mmap->vma->fileh;
TODO (mmap->fileh->blksize != virt_fileh->ramh->ram->pagesize); TODO (mmap->fileh->blksize != virt_fileh->ramh->ram->pagesize);
...@@ -504,9 +513,8 @@ error _Mapping::unmap() { ...@@ -504,9 +513,8 @@ error _Mapping::unmap() {
mmap->mem_stop = nil; mmap->mem_stop = nil;
// XXX clear other fields? // XXX clear other fields?
// XXX do it first? (to avoid pinner going through f.mmaps and hitting unmapped memory)
//f->_mmaps.remove(mmap); //f->_mmaps.remove(mmap);
// FIXME keep mmaps sorted
f->_mmaps.erase( f->_mmaps.erase(
std::remove(f->_mmaps.begin(), f->_mmaps.end(), mmap), std::remove(f->_mmaps.begin(), f->_mmaps.end(), mmap),
f->_mmaps.end()); f->_mmaps.end());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment