Print this page
OS-20 share_nfs(1m) charset handling is unreliable
OS-22 Page fault at nfscmd_dropped_entrysize+0x1e()
OS-23 NFSv2/3/4: READDIR responses are inconsistent when charset conversion fails
OS-24 rfs3_readdir(): Issues related to nfscmd_convdirent()
Reviewed by: Jan Kryl <jan.kryl@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
re #13613 rb4516 Tunables needs volatile keyword

@@ -18,10 +18,11 @@
  *
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  *
  *      Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
  *      All rights reserved.
  */
 

@@ -1457,11 +1458,11 @@
 
         return (secpolicy_vnode_access2(cr, vp, va.va_uid,
             va.va_mode << shift, mode));
 }
 
-static int nfs_do_symlink_cache = 1;
+volatile int nfs_do_symlink_cache = 1;
 
 /* ARGSUSED */
 static int
 nfs_readlink(vnode_t *vp, struct uio *uiop, cred_t *cr, caller_context_t *ct)
 {

@@ -1760,11 +1761,11 @@
                 VN_RELE(avp);
 
         return (error);
 }
 
-static int nfs_lookup_neg_cache = 1;
+volatile int nfs_lookup_neg_cache = 1;
 
 #ifdef DEBUG
 static int nfs_lookup_dnlc_hits = 0;
 static int nfs_lookup_dnlc_misses = 0;
 static int nfs_lookup_dnlc_neg_hits = 0;

@@ -2951,11 +2952,11 @@
 static int nfs_readdir_cache_waits = 0;
 static int nfs_readdir_cache_misses = 0;
 static int nfs_readdir_readahead = 0;
 #endif
 
-static int nfs_shrinkreaddir = 0;
+volatile int nfs_shrinkreaddir = 0;
 
 /*
  * Read directory entries.
  * There are some weird things to look out for here.  The uio_offset
  * field is either 0 or it is the offset returned from a previous

@@ -3284,11 +3285,11 @@
                 fip = &fi;
         } else {
                 fip = NULL;
         }
 
-        rd.rd_entries = kmem_alloc(rdc->buflen, KM_SLEEP);
+        rd.rd_dirents = kmem_alloc(rdc->buflen, KM_SLEEP);
         rd.rd_size = count;
         rd.rd_offset = rda.rda_offset;
 
         douprintf = 1;
 

@@ -3334,11 +3335,11 @@
                         rdc->entries = rddir_cache_buf_alloc(rdc->buflen,
                             KM_SLEEP);
 #else
                         rdc->entries = kmem_alloc(rdc->buflen, KM_SLEEP);
 #endif
-                        bcopy(rd.rd_entries, rdc->entries, rdc->entlen);
+                        bcopy(rd.rd_dirents, rdc->entries, rdc->entlen);
                         rdc->error = 0;
                         if (mi->mi_io_kstats) {
                                 mutex_enter(&mi->mi_lock);
                                 KSTAT_IO_PTR(mi->mi_io_kstats)->reads++;
                                 KSTAT_IO_PTR(mi->mi_io_kstats)->nread +=

@@ -3351,11 +3352,11 @@
         }
         if (error) {
                 rdc->entries = NULL;
                 rdc->error = error;
         }
-        kmem_free(rd.rd_entries, rdc->buflen);
+        kmem_free(rd.rd_dirents, rdc->buflen);
 
         mutex_enter(&rp->r_statelock);
         rdc->flags &= ~RDDIR;
         if (rdc->flags & RDDIRWAIT) {
                 rdc->flags &= ~RDDIRWAIT;

@@ -3611,11 +3612,11 @@
 
 /*
  * number of NFS_MAXDATA blocks to read ahead
  * optimized for 100 base-T.
  */
-static int nfs_nra = 4;
+volatile int nfs_nra = 4;
 
 #ifdef DEBUG
 static int nfs_lostpage = 0;    /* number of times we lost original page */
 #endif