From owner-svn-src-all@FreeBSD.ORG Mon Dec 29 12:45:11 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A9F61065674; Mon, 29 Dec 2008 12:45:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 704508FC13; Mon, 29 Dec 2008 12:45:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBTCjBuT057538; Mon, 29 Dec 2008 12:45:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBTCjBUn057535; Mon, 29 Dec 2008 12:45:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812291245.mBTCjBUn057535@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 29 Dec 2008 12:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186563 - in head/sys: compat/linprocfs fs/procfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2008 12:45:11 -0000 Author: kib Date: Mon Dec 29 12:45:11 2008 New Revision: 186563 URL: http://svn.freebsd.org/changeset/base/186563 Log: 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 Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/fs/procfs/procfs_map.c head/sys/kern/kern_proc.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Dec 29 12:41:32 2008 (r186562) +++ head/sys/compat/linprocfs/linprocfs.c Mon Dec 29 12:45:11 2008 (r186563) @@ -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, Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Mon Dec 29 12:41:32 2008 (r186562) +++ head/sys/fs/procfs/procfs_map.c Mon Dec 29 12:45:11 2008 (r186563) @@ -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, Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Dec 29 12:41:32 2008 (r186562) +++ head/sys/kern/kern_proc.c Mon Dec 29 12:45:11 2008 (r186563) @@ -1500,7 +1500,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; } @@ -1677,7 +1677,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; }