summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-12-29 12:45:11 +0000
committerkib <kib@FreeBSD.org>2008-12-29 12:45:11 +0000
commitbd5d614be80b38952e55e5516853af28f99d108d (patch)
tree3e48d98f96707e37fafe396ec8c27fa0b15ef680 /sys
parent76cd718eec26d0dbb71704e2a179ab96d9c6527d (diff)
downloadFreeBSD-src-bd5d614be80b38952e55e5516853af28f99d108d.zip
FreeBSD-src-bd5d614be80b38952e55e5516853af28f99d108d.tar.gz
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
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/linprocfs/linprocfs.c2
-rw-r--r--sys/fs/procfs/procfs_map.c2
-rw-r--r--sys/kern/kern_proc.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 09c22e3..fc2eacb 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -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,
diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c
index 2d3c17e..ed04d38 100644
--- a/sys/fs/procfs/procfs_map.c
+++ b/sys/fs/procfs/procfs_map.c
@@ -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,
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 9c6225f..3d994ba 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -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;
}
OpenPOWER on IntegriCloud