diff options
Diffstat (limited to 'usr/src/uts/common/fs/nfs/nfs4_client.c')
-rw-r--r-- | usr/src/uts/common/fs/nfs/nfs4_client.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr/src/uts/common/fs/nfs/nfs4_client.c b/usr/src/uts/common/fs/nfs/nfs4_client.c index 5438038105..65ccce1c05 100644 --- a/usr/src/uts/common/fs/nfs/nfs4_client.c +++ b/usr/src/uts/common/fs/nfs/nfs4_client.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017 by Delphix. All rights reserved. */ /* @@ -3198,10 +3199,15 @@ nfs4_clnt_init(void) nfs4_mi_destroy); /* - * Initialise the reference count of the notsupp xattr cache vnode to 1 - * so that it never goes away (VOP_INACTIVE isn't called on it). + * Initialize the reference count of the notsupp xattr cache vnode to 1 + * so that it never goes away (VOP_INACTIVE isn't called on it). The + * mutex_enter() isn't necessary for correctness, but VN_HOLD_LOCK() + * asserts that it's held, so we oblige. */ - nfs4_xattr_notsupp_vnode.v_count = 1; + mutex_enter(&nfs4_xattr_notsupp_vnode.v_lock); + nfs4_xattr_notsupp_vnode.v_count = 0; + VN_HOLD_LOCKED(&nfs4_xattr_notsupp_vnode); + mutex_exit(&nfs4_xattr_notsupp_vnode.v_lock); } void |