Print this page
OS-5343 dockerinit gets stuck in zfd_ready, zfd devices not showing up after > 1 hour
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/dev/sdev_vnops.c
          +++ new/usr/src/uts/common/fs/dev/sdev_vnops.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  /*
  25      - * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
       25 + * Copyright 2016, Joyent, Inc.
  26   26   */
  27   27  
  28   28  /*
  29   29   * vnode ops for the /dev filesystem
  30   30   *
  31   31   * - VDIR, VCHR, CBLK, and VLNK are considered must supported files
  32   32   * - VREG and VDOOR are used for some internal implementations in
  33   33   *    the global zone, e.g. devname and devfsadm communication
  34   34   * - other file types are unusual in this namespace and
  35   35   *    not supported for now
↓ open down ↓ 821 lines elided ↑ open up ↑
 857  857                   * when the last ref count on the sdev_node is
 858  858                   * released.
 859  859                   */
 860  860                  if (error == EBUSY) {
 861  861                          sdcmn_err2(("sdev_remove: device %s is still on"
 862  862                              "disk %s\n", nm, parent->sdev_path));
 863  863                          error = 0;
 864  864                  }
 865  865          }
 866  866  
      867 +        if (error == 0)
      868 +                i_ddi_di_cache_invalidate();
      869 +
 867  870          return (error);
 868  871  }
 869  872  
 870  873  /*
 871  874   * Some restrictions for this file system:
 872  875   *  - both oldnm and newnm are in the scope of /dev file system,
 873  876   *    to simply the namespace management model.
 874  877   */
 875  878  /*ARGSUSED6*/
 876  879  static int
↓ open down ↓ 304 lines elided ↑ open up ↑
1181 1184          }
1182 1185          ASSERT(self && (self->sdev_state == SDEV_READY));
1183 1186          rw_exit(&parent->sdev_contents);
1184 1187  
1185 1188          /* take care the timestamps for the node and its parent */
1186 1189          sdev_update_timestamps(SDEVTOV(self), kcred,
1187 1190              AT_CTIME|AT_MTIME|AT_ATIME);
1188 1191          sdev_update_timestamps(dvp, kcred, AT_MTIME|AT_ATIME);
1189 1192          if (SDEV_IS_GLOBAL(parent))
1190 1193                  atomic_inc_ulong(&parent->sdev_gdir_gen);
     1194 +        i_ddi_di_cache_invalidate();
1191 1195  
1192 1196          /* wake up other threads blocked on looking up this node */
1193 1197          mutex_enter(&self->sdev_lookup_lock);
1194 1198          SDEV_UNBLOCK_OTHERS(self, SDEV_LOOKUP);
1195 1199          mutex_exit(&self->sdev_lookup_lock);
1196 1200          SDEV_RELE(self);        /* don't return with vnode held */
1197 1201          return (0);
1198 1202  }
1199 1203  
1200 1204  /*ARGSUSED6*/
↓ open down ↓ 52 lines elided ↑ open up ↑
1253 1257          }
1254 1258          ASSERT(self && (self->sdev_state == SDEV_READY));
1255 1259          rw_exit(&parent->sdev_contents);
1256 1260  
1257 1261          /* take care the timestamps for the node and its parent */
1258 1262          sdev_update_timestamps(SDEVTOV(self), kcred,
1259 1263              AT_CTIME|AT_MTIME|AT_ATIME);
1260 1264          sdev_update_timestamps(dvp, kcred, AT_MTIME|AT_ATIME);
1261 1265          if (SDEV_IS_GLOBAL(parent))
1262 1266                  atomic_inc_ulong(&parent->sdev_gdir_gen);
     1267 +        i_ddi_di_cache_invalidate();
1263 1268  
1264 1269          /* wake up other threads blocked on looking up this node */
1265 1270          mutex_enter(&self->sdev_lookup_lock);
1266 1271          SDEV_UNBLOCK_OTHERS(self, SDEV_LOOKUP);
1267 1272          mutex_exit(&self->sdev_lookup_lock);
1268 1273          *vpp = SDEVTOV(self);
1269 1274          return (0);
1270 1275  }
1271 1276  
1272 1277  /*
↓ open down ↓ 95 lines elided ↑ open up ↑
1368 1373                      parent->sdev_attrvp, kcred, ct, flags);
1369 1374  
1370 1375                  if (error)
1371 1376                          sdcmn_err2(("sdev_rmdir: cleaning device %s is on"
1372 1377                              " disk error %d\n", parent->sdev_path, error));
1373 1378                  if (error == EBUSY)
1374 1379                          error = 0;
1375 1380  
1376 1381          }
1377 1382  
     1383 +        if (error == 0)
     1384 +                i_ddi_di_cache_invalidate();
     1385 +
1378 1386          return (error);
1379 1387  }
1380 1388  
1381 1389  /*
1382 1390   * read the contents of a symbolic link
1383 1391   */
1384 1392  static int
1385 1393  sdev_readlink(struct vnode *vp, struct uio *uiop, struct cred *cred,
1386 1394      caller_context_t *ct)
1387 1395  {
↓ open down ↓ 182 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX