Skip to content

Commit 295304b

Browse files
grwilsonbehlendorf
authored andcommitted
Illumos #3422, #3425
3422 zpool create/syseventd race yield non-importable pool 3425 first write to a new zvol can fail with EFBIG Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Garrett D'Amore <garrett@damore.org> References: illumos/illumos-gate@bda8819 https://www.illumos.org/issues/3422 https://www.illumos.org/issues/3425 Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1390
1 parent 9d248f7 commit 295304b

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

lib/libzfs/libzfs_import.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,12 @@ get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
523523
* version
524524
* pool guid
525525
* name
526-
* pool txg (if available)
527526
* comment (if available)
528527
* pool state
529528
* hostid (if available)
530529
* hostname (if available)
531530
*/
532-
uint64_t state, version, pool_txg;
531+
uint64_t state, version;
533532
char *comment = NULL;
534533

535534
version = fnvlist_lookup_uint64(tmp,
@@ -545,11 +544,6 @@ get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
545544
fnvlist_add_string(config,
546545
ZPOOL_CONFIG_POOL_NAME, name);
547546

548-
if (nvlist_lookup_uint64(tmp,
549-
ZPOOL_CONFIG_POOL_TXG, &pool_txg) == 0)
550-
fnvlist_add_uint64(config,
551-
ZPOOL_CONFIG_POOL_TXG, pool_txg);
552-
553547
if (nvlist_lookup_string(tmp,
554548
ZPOOL_CONFIG_COMMENT, &comment) == 0)
555549
fnvlist_add_string(config,

module/zfs/dmu_tx.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/*
2222
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2323
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24-
* Copyright (c) 2012 by Delphix. All rights reserved.
24+
* Copyright (c) 2013 by Delphix. All rights reserved.
2525
*/
2626

2727
#include <sys/dmu.h>
@@ -301,20 +301,14 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, uint64_t off, uint64_t len)
301301
delta = P2NPHASE(off, dn->dn_datablksz);
302302
}
303303

304+
min_ibs = max_ibs = dn->dn_indblkshift;
304305
if (dn->dn_maxblkid > 0) {
305306
/*
306307
* The blocksize can't change,
307308
* so we can make a more precise estimate.
308309
*/
309310
ASSERT(dn->dn_datablkshift != 0);
310311
min_bs = max_bs = dn->dn_datablkshift;
311-
min_ibs = max_ibs = dn->dn_indblkshift;
312-
} else if (dn->dn_indblkshift > max_ibs) {
313-
/*
314-
* This ensures that if we reduce DN_MAX_INDBLKSHIFT,
315-
* the code will still work correctly on older pools.
316-
*/
317-
min_ibs = max_ibs = dn->dn_indblkshift;
318312
}
319313

320314
/*

module/zfs/vdev.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,8 @@ vdev_validate(vdev_t *vd, boolean_t strict)
13481348
if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) {
13491349
uint64_t aux_guid = 0;
13501350
nvlist_t *nvl;
1351-
uint64_t txg = strict ? spa->spa_config_txg : -1ULL;
1351+
uint64_t txg = spa_last_synced_txg(spa) != 0 ?
1352+
spa_last_synced_txg(spa) : -1ULL;
13521353

13531354
if ((label = vdev_label_read_config(vd, txg)) == NULL) {
13541355
vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN,
@@ -1533,7 +1534,7 @@ vdev_reopen(vdev_t *vd)
15331534
!l2arc_vdev_present(vd))
15341535
l2arc_add_vdev(spa, vd);
15351536
} else {
1536-
(void) vdev_validate(vd, spa_last_synced_txg(spa));
1537+
(void) vdev_validate(vd, B_TRUE);
15371538
}
15381539

15391540
/*

0 commit comments

Comments
 (0)