From 1384c58687fc765ca3d9a998204826d3dd0ce419 Mon Sep 17 00:00:00 2001 From: Deepak Honnalli Date: Thu, 25 Sep 2008 11:52:01 +0530 Subject: 6503547 deadlock between utilities accessing /proc and processes using nfs --- usr/src/uts/common/nfs/rnode.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'usr/src/uts/common/nfs/rnode.h') diff --git a/usr/src/uts/common/nfs/rnode.h b/usr/src/uts/common/nfs/rnode.h index f2a956040c..3df90d8ffb 100644 --- a/usr/src/uts/common/nfs/rnode.h +++ b/usr/src/uts/common/nfs/rnode.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -29,8 +29,6 @@ #ifndef _NFS_RNODE_H #define _NFS_RNODE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -221,6 +219,16 @@ typedef struct rhashq { * set r_modaddr and release r_statelock as long as the r_rwlock * writer lock is held. * + * r_inmap informs nfsX_read()/write() that there is a call to nfsX_map() + * in progress. nfsX_read()/write() check r_inmap to decide whether + * to perform directio on the file or not. r_inmap is atomically + * incremented in nfsX_map() before the address space routines are + * called and atomically decremented just before nfsX_map() exits. + * r_inmap is not protected by any lock. + * + * r_mapcnt tells that the rnode has mapped pages. r_inmap can be 0 + * while the rnode has mapped pages. + * * 64-bit offsets: the code formerly assumed that atomic reads of * r_size were safe and reliable; on 32-bit architectures, this is * not true since an intervening bus cycle from another processor @@ -283,6 +291,7 @@ typedef struct rnode { acache_t *r_acache; /* list of access cache entries */ kthread_t *r_serial; /* id of purging thread */ list_t r_indelmap; /* list of delmap callers */ + uint_t r_inmap; /* to serialize read/write and mmap */ } rnode_t; #endif /* _KERNEL */ -- cgit v1.2.3