diff options
author | Roger A. Faulkner <Roger.Faulkner@Sun.COM> | 2009-03-27 17:03:06 -0700 |
---|---|---|
committer | Roger A. Faulkner <Roger.Faulkner@Sun.COM> | 2009-03-27 17:03:06 -0700 |
commit | 783f4f5ea8eca977bbca103e012c60a3fc1b3210 (patch) | |
tree | 972a19185839ae2652725908e8128359bf1de4d9 | |
parent | 77860f660864f69b119aa2590aeb7c58ef5754a9 (diff) | |
download | illumos-gate-783f4f5ea8eca977bbca103e012c60a3fc1b3210.tar.gz |
6821681 process robust mutexes must cope with mmap MAP_FIXED
-rw-r--r-- | usr/src/uts/common/os/grow.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/src/uts/common/os/grow.c b/usr/src/uts/common/os/grow.c index 2b82aaba0d..07181a23b5 100644 --- a/usr/src/uts/common/os/grow.c +++ b/usr/src/uts/common/os/grow.c @@ -18,17 +18,15 @@ * * CDDL HEADER END */ + /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/inttypes.h> #include <sys/param.h> @@ -652,6 +650,9 @@ smmap_common(caddr_t *addrp, size_t len, if (fp == NULL) { ASSERT(flags & MAP_ANON); + /* discard lwpchan mappings, like munmap() */ + if ((flags & MAP_FIXED) && curproc->p_lcp != NULL) + lwpchan_delete_mapping(curproc, *addrp, *addrp + len); as_rangelock(as); error = zmap(as, addrp, len, uprot, flags, pos); as_rangeunlock(as); @@ -755,6 +756,10 @@ smmap_common(caddr_t *addrp, size_t len, } } + /* discard lwpchan mappings, like munmap() */ + if ((flags & MAP_FIXED) && curproc->p_lcp != NULL) + lwpchan_delete_mapping(curproc, *addrp, *addrp + len); + /* * Ok, now let the vnode map routine do its thing to set things up. */ |