vm_map_lock_read() does not increment map->timestamp, so we should

compare map->timestamp with saved timestamp after map read lock is
reacquired, not with saved timestamp + 1. The only consequence of the +1
was unconditional lookup of the next map entry, though.

Tested by:	pho
Approved by:	des
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2008-12-29 12:45:11 +00:00
parent c990bf0896
commit 22a448c4d9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=186563
3 changed files with 4 additions and 4 deletions

View File

@ -980,7 +980,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
error = 0;
break;
}
if (last_timestamp + 1 != map->timestamp) {
if (last_timestamp != map->timestamp) {
/*
* Look again for the entry because the map was
* modified while it was unlocked. Specifically,

View File

@ -224,7 +224,7 @@ procfs_doprocmap(PFS_FILL_ARGS)
error = 0;
break;
}
if (last_timestamp + 1 != map->timestamp) {
if (last_timestamp != map->timestamp) {
/*
* Look again for the entry because the map was
* modified while it was unlocked. Specifically,

View File

@ -1500,7 +1500,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS)
vm_map_lock_read(map);
if (error)
break;
if (last_timestamp + 1 != map->timestamp) {
if (last_timestamp != map->timestamp) {
vm_map_lookup_entry(map, addr - 1, &tmp_entry);
entry = tmp_entry;
}
@ -1677,7 +1677,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS)
vm_map_lock_read(map);
if (error)
break;
if (last_timestamp + 1 != map->timestamp) {
if (last_timestamp != map->timestamp) {
vm_map_lookup_entry(map, addr - 1, &tmp_entry);
entry = tmp_entry;
}