From 02ff05a9110e19d8d0bbe707064f193f4a40065a Mon Sep 17 00:00:00 2001 From: vsakar Date: Thu, 27 Apr 2006 20:09:43 -0700 Subject: 4339897 system hangs in ufs_check_lockfs(). 4889187 ufs_quiesce()/ufs_readdir()/ufs_create() - 3 way deadlock --- usr/src/uts/common/vm/vm_as.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'usr/src/uts/common/vm/vm_as.c') diff --git a/usr/src/uts/common/vm/vm_as.c b/usr/src/uts/common/vm/vm_as.c index b03d712069..f7533f56a6 100644 --- a/usr/src/uts/common/vm/vm_as.c +++ b/usr/src/uts/common/vm/vm_as.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -77,6 +76,7 @@ static struct kmem_cache *as_cache; static void as_setwatchprot(struct as *, caddr_t, size_t, uint_t); static void as_clearwatchprot(struct as *, caddr_t, size_t); +int as_map_locked(struct as *, caddr_t, size_t, int ((*)()), void *); /* @@ -1597,6 +1597,14 @@ again: int as_map(struct as *as, caddr_t addr, size_t size, int (*crfp)(), void *argsp) +{ + AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER); + return (as_map_locked(as, addr, size, crfp, argsp)); +} + +int +as_map_locked(struct as *as, caddr_t addr, size_t size, int (*crfp)(), + void *argsp) { struct seg *seg = NULL; caddr_t raddr; /* rounded down addr */ @@ -1608,8 +1616,6 @@ as_map(struct as *as, caddr_t addr, size_t size, int (*crfp)(), void *argsp) rsize = (((size_t)(addr + size) + PAGEOFFSET) & PAGEMASK) - (size_t)raddr; - AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER); - /* * check for wrap around */ -- cgit v1.2.3