Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jan 2009 11:13:03 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r187889 - in stable/7/sys: . compat/linprocfs contrib/pf dev/cxgb fs/procfs kern
Message-ID:  <200901291113.n0TBD32e052506@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Jan 29 11:13:03 2009
New Revision: 187889
URL: http://svn.freebsd.org/changeset/base/187889

Log:
  MFC r186563:
  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.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/compat/linprocfs/linprocfs.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/fs/procfs/procfs_map.c
  stable/7/sys/kern/kern_proc.c

Modified: stable/7/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- stable/7/sys/compat/linprocfs/linprocfs.c	Thu Jan 29 11:08:56 2009	(r187888)
+++ stable/7/sys/compat/linprocfs/linprocfs.c	Thu Jan 29 11:13:03 2009	(r187889)
@@ -976,7 +976,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,

Modified: stable/7/sys/fs/procfs/procfs_map.c
==============================================================================
--- stable/7/sys/fs/procfs/procfs_map.c	Thu Jan 29 11:08:56 2009	(r187888)
+++ stable/7/sys/fs/procfs/procfs_map.c	Thu Jan 29 11:13:03 2009	(r187889)
@@ -231,7 +231,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,

Modified: stable/7/sys/kern/kern_proc.c
==============================================================================
--- stable/7/sys/kern/kern_proc.c	Thu Jan 29 11:08:56 2009	(r187888)
+++ stable/7/sys/kern/kern_proc.c	Thu Jan 29 11:13:03 2009	(r187889)
@@ -1502,7 +1502,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A
 		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;
 		}
@@ -1679,7 +1679,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
 		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;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901291113.n0TBD32e052506>