diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-09-23 16:08:14 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-09-23 16:08:14 +0000 |
commit | 802c0a5a10c4dafff8d9647562722a5bf0997802 (patch) | |
tree | 08f6152ff72cceb70edd2aa64778bb0a0e41cdd8 | |
parent | 0702468eedf9b4641b4359df530337857b0b65c1 (diff) | |
parent | c79df70e7f04e3742087189b820b431059193dfe (diff) | |
download | illumos-joyent-802c0a5a10c4dafff8d9647562722a5bf0997802.tar.gz |
[illumos-gate merge]
commit c79df70e7f04e3742087189b820b431059193dfe
11588 loader: isapnp.c: this statement may fall through
commit c8caaf7af609cac86df1d624c8b8fdf0edbb3c7f
11704 loader.efi: filter out very large blocksize in efipart
11703 loader.efi: add vendor devicepath nodes as disks
commit 2d37a1a3f6b9fa33de5a877c84711ec1231fa21b
11713 zdb should not output binary data on terminal
commit c00285d6d6301f5c240936788f77b9ad548fc934
11718 gptzfsboot: exit() should call __exit()
commit 46d70dced0faeb87f53b7bd42d46bba4f37737e9
11712 installboot: ignore the case of missing loader64.efi or loader32.efi
commit fb05b94a37411cdc9e6c5cc10b833e410fbf7b79
11714 temporarily disable ZFS TRIM support
Conflicts:
usr/src/cmd/mdb/common/modules/genunix/genunix.c
-rw-r--r-- | usr/src/boot/Makefile.version | 2 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/common/isapnp.c | 5 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/efi/libefi/efipart.c | 6 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c | 3 | ||||
-rw-r--r-- | usr/src/cmd/boot/installboot/i386/installboot.c | 52 | ||||
-rw-r--r-- | usr/src/cmd/zdb/zdb.c | 15 | ||||
-rw-r--r-- | usr/src/uts/common/fs/zfs/vdev_disk.c | 10 |
7 files changed, 71 insertions, 22 deletions
diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version index aa8ad08c91..faf491c1af 100644 --- a/usr/src/boot/Makefile.version +++ b/usr/src/boot/Makefile.version @@ -33,4 +33,4 @@ LOADER_VERSION = 1.1 # Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes. # The version is processed from left to right, the version number can only # be increased. -BOOT_VERSION = $(LOADER_VERSION)-2019.09.12.1 +BOOT_VERSION = $(LOADER_VERSION)-2019.09.20.1 diff --git a/usr/src/boot/sys/boot/common/isapnp.c b/usr/src/boot/sys/boot/common/isapnp.c index a8efb28c7e..25a421d053 100644 --- a/usr/src/boot/sys/boot/common/isapnp.c +++ b/usr/src/boot/sys/boot/common/isapnp.c @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 1998, Michael Smith * Copyright (c) 1996, Sujal M. Patel * All rights reserved. @@ -26,7 +26,6 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); /* * Machine-independant ISA PnP enumerator implementing a subset of the @@ -175,10 +174,10 @@ isapnp_scan_resdata(struct pnpinfo *pi) if (isapnp_get_resource_info(resinfo, PNP_SRES_LEN(tag))) return(1); pnp_addident(pi, pnp_eisaformat(resinfo)); + return(0); case END_TAG: return(0); - break; default: /* Skip this resource */ diff --git a/usr/src/boot/sys/boot/efi/libefi/efipart.c b/usr/src/boot/sys/boot/efi/libefi/efipart.c index e51f4b5d0b..9f2a431fab 100644 --- a/usr/src/boot/sys/boot/efi/libefi/efipart.c +++ b/usr/src/boot/sys/boot/efi/libefi/efipart.c @@ -241,10 +241,13 @@ efipart_inithandles(void) /* * We assume the block size 512 or greater power of 2. + * Also skip devices with block size > 64k (16 is max + * ashift supported by zfs). * iPXE is known to insert stub BLOCK IO device with * BlockSize 1. */ if (blkio->Media->BlockSize < 512 || + blkio->Media->BlockSize > (1 << 16) || !powerof2(blkio->Media->BlockSize)) { continue; } @@ -589,7 +592,8 @@ restart: continue; if (DevicePathType(node) == HARDWARE_DEVICE_PATH && - DevicePathSubType(node) == HW_PCI_DP) { + (DevicePathSubType(node) == HW_PCI_DP || + DevicePathSubType(node) == HW_VENDOR_DP)) { STAILQ_REMOVE(&pdinfo, hd, pdinfo, pd_link); efipart_hdinfo_add(hd, NULL); goto restart; diff --git a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c index 87ab980fc3..872ad3d3bc 100644 --- a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c +++ b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c @@ -274,8 +274,7 @@ main(void) void exit(int x) { - while (1) - ; + __exit(x); } static void diff --git a/usr/src/cmd/boot/installboot/i386/installboot.c b/usr/src/cmd/boot/installboot/i386/installboot.c index c6c2829f76..fd5430fde6 100644 --- a/usr/src/cmd/boot/installboot/i386/installboot.c +++ b/usr/src/cmd/boot/installboot/i386/installboot.c @@ -467,6 +467,10 @@ compare_einfo_cb(struct partlist *plist) bblk_hs_t bblock_hs; bool rv; + bblock_file = plist->pl_src_data; + if (bblock_file == NULL) + return (false); /* source is missing, cannot update */ + bblock = plist->pl_stage; if (bblock == NULL || bblock->extra == NULL || bblock->extra_size == 0) return (true); @@ -477,7 +481,6 @@ compare_einfo_cb(struct partlist *plist) return (true); } - bblock_file = plist->pl_src_data; einfo_file = find_einfo(bblock_file->extra, bblock_file->extra_size); if (einfo_file == NULL) { /* @@ -676,23 +679,39 @@ read_stage2_cb(struct partlist *plist) static bool read_einfo_file_cb(struct partlist *plist) { - plist->pl_stage = calloc(1, sizeof (ib_bootblock_t)); - if (plist->pl_stage == NULL) + int rc; + void *stage; + + stage = calloc(1, sizeof (ib_bootblock_t)); + if (stage == NULL) return (false); - return (read_bootblock_from_file(plist->pl_devname, - plist->pl_stage) == BC_SUCCESS); + rc = read_bootblock_from_file(plist->pl_devname, stage); + if (rc != BC_SUCCESS) { + free(stage); + stage = NULL; + } + plist->pl_stage = stage; + return (rc == BC_SUCCESS); } static bool read_stage2_file_cb(struct partlist *plist) { - plist->pl_src_data = calloc(1, sizeof (ib_bootblock_t)); - if (plist->pl_src_data == NULL) + int rc; + void *data; + + data = calloc(1, sizeof (ib_bootblock_t)); + if (data == NULL) return (false); - return (read_bootblock_from_file(plist->pl_src_name, - plist->pl_src_data) == BC_SUCCESS); + rc = read_bootblock_from_file(plist->pl_src_name, data); + if (rc != BC_SUCCESS) { + free(data); + data = NULL; + } + plist->pl_src_data = data; + return (rc == BC_SUCCESS); } /* @@ -1755,6 +1774,8 @@ read_bootblock_from_file(const char *file, ib_bootblock_t *bblock) /* loader bootblock has version built in */ buf_size = sb.st_size; + if (buf_size == 0) + goto outfd; bblock->buf_size = buf_size; BOOT_DEBUG("bootblock in-memory buffer size is %d\n", @@ -1897,6 +1918,8 @@ prepare_bootblock(ib_data_t *data, struct partlist *pl, char *updt_str) assert(pl != NULL); bblock = pl->pl_src_data; + if (bblock == NULL) + return; ptr = (uint64_t *)(&bblock->mboot->bss_end_addr); *ptr = data->target.start; @@ -2094,10 +2117,13 @@ handle_install(char *progname, int argc, char **argv) printf("\n"); } if (!pl->pl_cb.read_bbl(pl)) { - (void) fprintf(stderr, - gettext("Error reading %s\n"), - pl->pl_src_name); - goto cleanup; + /* + * We will ignore ESP updates in case of + * older system where we are missing + * loader64.efi and loader32.efi. + */ + if (pl->pl_type != IB_BBLK_EFI) + goto cleanup; } } diff --git a/usr/src/cmd/zdb/zdb.c b/usr/src/cmd/zdb/zdb.c index 7720a6cd0d..a936c361b5 100644 --- a/usr/src/cmd/zdb/zdb.c +++ b/usr/src/cmd/zdb/zdb.c @@ -443,7 +443,20 @@ dump_zap(objset_t *os, uint64_t object, void *data, size_t size) (void) zap_lookup(os, object, attr.za_name, attr.za_integer_length, attr.za_num_integers, prop); if (attr.za_integer_length == 1) { - (void) printf("%s", (char *)prop); + if (strcmp(attr.za_name, + DSL_CRYPTO_KEY_MASTER_KEY) == 0 || + strcmp(attr.za_name, + DSL_CRYPTO_KEY_HMAC_KEY) == 0 || + strcmp(attr.za_name, DSL_CRYPTO_KEY_IV) == 0 || + strcmp(attr.za_name, DSL_CRYPTO_KEY_MAC) == 0) { + uint8_t *u8 = prop; + + for (i = 0; i < attr.za_num_integers; i++) { + (void) printf("%02x", u8[i]); + } + } else { + (void) printf("%s", (char *)prop); + } } else { for (i = 0; i < attr.za_num_integers; i++) { switch (attr.za_integer_length) { diff --git a/usr/src/uts/common/fs/zfs/vdev_disk.c b/usr/src/uts/common/fs/zfs/vdev_disk.c index 4db87027bc..3c563e922d 100644 --- a/usr/src/uts/common/fs/zfs/vdev_disk.c +++ b/usr/src/uts/common/fs/zfs/vdev_disk.c @@ -40,6 +40,11 @@ #include <sys/fm/fs/zfs.h> /* + * Tunable to enable TRIM, which is temporarily disabled by default. + */ +uint_t zfs_no_trim = 1; + +/* * Tunable parameter for debugging or performance analysis. Setting this * will cause pool corruption on power loss if a volatile out-of-order * write cache is enabled. @@ -715,6 +720,9 @@ skip_open: vd->vdev_has_trim = B_FALSE; } + if (zfs_no_trim == 1) + vd->vdev_has_trim = B_FALSE; + /* Currently only supported for ZoL. */ vd->vdev_has_securetrim = B_FALSE; @@ -945,7 +953,7 @@ vdev_disk_io_start(zio_t *zio) return; case ZIO_TYPE_TRIM: - if (!vd->vdev_has_trim) { + if (zfs_no_trim == 1 || !vd->vdev_has_trim) { zio->io_error = SET_ERROR(ENOTSUP); zio_execute(zio); return; |