Print this page
4220 beadm mount of old BE with zones fails "Read only filesystem"
4235 beadm(1M) mount options undocumented in man page

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libbe/common/be_mount.c
          +++ new/usr/src/lib/libbe/common/be_mount.c
↓ open down ↓ 374 lines elided ↑ open up ↑
 375  375                  /* TODO: Mount all non-ZFS file systems - Not supported yet */
 376  376          }
 377  377  
 378  378          /*
 379  379           * If we're in the global zone and the global zone has a valid uuid,
 380  380           * mount all supported non-global zones.
 381  381           */
 382  382          if (getzoneid() == GLOBAL_ZONEID &&
 383  383              !(flags & BE_MOUNT_FLAG_NO_ZONES) &&
 384  384              be_get_uuid(bt.obe_root_ds, &uu) == BE_SUCCESS) {
 385      -                if ((ret = be_mount_zones(zhp, &md)) != BE_SUCCESS) {
 386      -                        (void) _be_unmount(bt.obe_name, 0);
 387      -                        if (gen_tmp_altroot)
 388      -                                free(tmp_altroot);
 389      -                        ZFS_CLOSE(zhp);
 390      -                        return (ret);
      385 +                if (be_mount_zones(zhp, &md) != BE_SUCCESS) {
      386 +                        ret = BE_ERR_NO_MOUNTED_ZONE;
 391  387                  }
 392  388          }
 393  389  
 394  390          ZFS_CLOSE(zhp);
 395  391  
 396  392          /*
 397  393           * If a NULL altroot was passed in, pass the generated altroot
 398  394           * back to the caller in altroot.
 399  395           */
 400      -        if (gen_tmp_altroot)
 401      -                *altroot = tmp_altroot;
      396 +        if (gen_tmp_altroot) {
      397 +                if (ret == BE_SUCCESS || ret == BE_ERR_NO_MOUNTED_ZONE)
      398 +                        *altroot = tmp_altroot;
      399 +                else
      400 +                        free(tmp_altroot);
      401 +        }
 402  402  
 403      -        return (BE_SUCCESS);
      403 +        return (ret);
 404  404  }
 405  405  
 406  406  /*
 407  407   * Function:    _be_unmount
 408  408   * Description: Unmount a BE.
 409  409   * Parameters:
 410  410   *              be_name - pointer to name of BE to unmount.
 411  411   *              flags - flags for unmounting the BE.
 412  412   * Returns:
 413  413   *              BE_SUCCESS - Success
↓ open down ↓ 1291 lines elided ↑ open up ↑
1705 1705                          return (BE_ERR_MOUNT);
1706 1706                  }
1707 1707          }
1708 1708  
1709 1709          return (BE_SUCCESS);
1710 1710  }
1711 1711  
1712 1712  /*
1713 1713   * Function:    loopback_mount_zonepath
1714 1714   * Description: This function loopback mounts a zonepath into the altroot
1715      - *              area of the BE being mounted.  Since these are shared file
1716      - *              systems, they are expected to be already mounted for the
1717      - *              current BE, and this function just loopback mounts them into
1718      - *              the BE mountpoint.
     1715 + *              area of the BE being mounted.
1719 1716   * Parameters:
1720 1717   *              zonepath - pointer to zone path in the current BE
1721 1718   *              md - be_mount_data_t pointer
1722 1719   * Returns:
1723 1720   *              BE_SUCCESS - Success
1724 1721   *              be_errno_t - Failure
1725 1722   * Scope:
1726 1723   *              Private
1727 1724   */
1728 1725  static int
↓ open down ↓ 1005 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX