diff options
author | dyson <dyson@FreeBSD.org> | 1996-10-30 03:52:57 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-10-30 03:52:57 +0000 |
commit | 89da5daba54bd5531e14afb288106143061bc3a9 (patch) | |
tree | 29252ce9994c467ca4d69ae1a38deba45aac4229 | |
parent | 0cadb84d6a23fa9bc6b249c3d33338bb2abe4ef8 (diff) | |
download | FreeBSD-src-89da5daba54bd5531e14afb288106143061bc3a9.zip FreeBSD-src-89da5daba54bd5531e14afb288106143061bc3a9.tar.gz |
Fix a potential deadlock from the previous commit.
-rw-r--r-- | sys/fs/procfs/procfs_map.c | 6 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_map.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index 889f6b1..b3d6c9b 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -103,7 +103,8 @@ procfs_domap(curp, p, pfs, uio) return (0); error = 0; - vm_map_lock(map); + if (map != &curproc->p_vmspace->vm_map) + vm_map_lock(map); for (entry = map->header.next; ((uio->uio_resid > 0) && (entry != &map->header)); entry = entry->next) { @@ -174,7 +175,8 @@ case OBJT_DEVICE: if (error) break; } - vm_map_unlock(map); + if (map != &curproc->p_vmspace->vm_map) + vm_map_unlock(map); return error; } diff --git a/sys/miscfs/procfs/procfs_map.c b/sys/miscfs/procfs/procfs_map.c index 889f6b1..b3d6c9b 100644 --- a/sys/miscfs/procfs/procfs_map.c +++ b/sys/miscfs/procfs/procfs_map.c @@ -103,7 +103,8 @@ procfs_domap(curp, p, pfs, uio) return (0); error = 0; - vm_map_lock(map); + if (map != &curproc->p_vmspace->vm_map) + vm_map_lock(map); for (entry = map->header.next; ((uio->uio_resid > 0) && (entry != &map->header)); entry = entry->next) { @@ -174,7 +175,8 @@ case OBJT_DEVICE: if (error) break; } - vm_map_unlock(map); + if (map != &curproc->p_vmspace->vm_map) + vm_map_unlock(map); return error; } |