MFC r208472, r208474:
MFC r208472: Fix zfs receive temporarily changing unchanged stream properties. Fix possible panic with zfs_enable_datasets. OpenSolaris onnv revision: 8536:33bd5de3260e [1] MFC r208474: Remove kstat.zfs.arcstats.l2_write_bytes_written The arcstats.l2_write_bytes_written kstat counter introduced in r205231 was duplicite with vendor's arcstats.l2_write_bytes counter imported in r208373 (OpenSolaris revision 8582:df9361868dbe) Approved by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID 6748561, 6757075) [1]
This commit is contained in:
parent
53d0fa3558
commit
a3b69608b2
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
@ -1209,10 +1209,12 @@ zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int flags)
|
||||
|
||||
/*
|
||||
* And mount all the datasets, keeping track of which ones
|
||||
* succeeded or failed. By using zfs_alloc(), the good pointer
|
||||
* will always be non-NULL.
|
||||
* succeeded or failed.
|
||||
*/
|
||||
good = zfs_alloc(zhp->zpool_hdl, cb.cb_used * sizeof (int));
|
||||
if ((good = zfs_alloc(zhp->zpool_hdl,
|
||||
cb.cb_used * sizeof (int))) == NULL)
|
||||
goto out;
|
||||
|
||||
ret = 0;
|
||||
for (i = 0; i < cb.cb_used; i++) {
|
||||
if (zfs_mount(cb.cb_datasets[i], mntopts, flags) != 0)
|
||||
|
@ -325,7 +325,6 @@ typedef struct arc_stats {
|
||||
kstat_named_t arcstat_l2_write_full;
|
||||
kstat_named_t arcstat_l2_write_buffer_iter;
|
||||
kstat_named_t arcstat_l2_write_pios;
|
||||
kstat_named_t arcstat_l2_write_bytes_written;
|
||||
kstat_named_t arcstat_l2_write_buffer_bytes_scanned;
|
||||
kstat_named_t arcstat_l2_write_buffer_list_iter;
|
||||
kstat_named_t arcstat_l2_write_buffer_list_null_iter;
|
||||
@ -396,7 +395,6 @@ static arc_stats_t arc_stats = {
|
||||
{ "l2_write_full", KSTAT_DATA_UINT64 },
|
||||
{ "l2_write_buffer_iter", KSTAT_DATA_UINT64 },
|
||||
{ "l2_write_pios", KSTAT_DATA_UINT64 },
|
||||
{ "l2_write_bytes_written", KSTAT_DATA_UINT64 },
|
||||
{ "l2_write_buffer_bytes_scanned", KSTAT_DATA_UINT64 },
|
||||
{ "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 },
|
||||
{ "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 }
|
||||
@ -4692,7 +4690,6 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
|
||||
ARCSTAT_BUMP(arcstat_l2_write_pios);
|
||||
}
|
||||
|
||||
ARCSTAT_INCR(arcstat_l2_write_bytes_written, ab->b_size);
|
||||
/*
|
||||
* Create and add a new L2ARC header.
|
||||
*/
|
||||
|
@ -92,7 +92,7 @@ typedef struct zfs_ioc_vec {
|
||||
boolean_t zvec_his_log;
|
||||
} zfs_ioc_vec_t;
|
||||
|
||||
static void clear_props(char *dataset, nvlist_t *props);
|
||||
static void clear_props(char *dataset, nvlist_t *props, nvlist_t *newprops);
|
||||
static int zfs_fill_zplprops_root(uint64_t, nvlist_t *, nvlist_t *,
|
||||
boolean_t *);
|
||||
int zfs_set_prop_nvlist(const char *, nvlist_t *);
|
||||
@ -1645,7 +1645,7 @@ zfs_ioc_set_prop(zfs_cmd_t *zc)
|
||||
if (dmu_objset_open(zc->zc_name, DMU_OST_ANY,
|
||||
DS_MODE_USER | DS_MODE_READONLY, &os) == 0) {
|
||||
if (dsl_prop_get_all(os, &origprops, TRUE) == 0) {
|
||||
clear_props(zc->zc_name, origprops);
|
||||
clear_props(zc->zc_name, origprops, nvl);
|
||||
nvlist_free(origprops);
|
||||
}
|
||||
dmu_objset_close(os);
|
||||
@ -2425,7 +2425,7 @@ zfs_ioc_rename(zfs_cmd_t *zc)
|
||||
}
|
||||
|
||||
static void
|
||||
clear_props(char *dataset, nvlist_t *props)
|
||||
clear_props(char *dataset, nvlist_t *props, nvlist_t *newprops)
|
||||
{
|
||||
zfs_cmd_t *zc;
|
||||
nvpair_t *prop;
|
||||
@ -2436,6 +2436,9 @@ clear_props(char *dataset, nvlist_t *props)
|
||||
(void) strcpy(zc->zc_name, dataset);
|
||||
for (prop = nvlist_next_nvpair(props, NULL); prop;
|
||||
prop = nvlist_next_nvpair(props, prop)) {
|
||||
if (newprops != NULL &&
|
||||
nvlist_exists(newprops, nvpair_name(prop)))
|
||||
continue;
|
||||
(void) strcpy(zc->zc_value, nvpair_name(prop));
|
||||
if (zfs_secpolicy_inherit(zc, CRED()) == 0)
|
||||
(void) zfs_ioc_inherit_prop(zc);
|
||||
@ -2543,7 +2546,7 @@ zfs_ioc_recv(zfs_cmd_t *zc)
|
||||
* so that the properties are applied to the new data.
|
||||
*/
|
||||
if (props) {
|
||||
clear_props(tofs, origprops);
|
||||
clear_props(tofs, origprops, props);
|
||||
/*
|
||||
* XXX - Note, this is all-or-nothing; should be best-effort.
|
||||
*/
|
||||
@ -2582,7 +2585,7 @@ zfs_ioc_recv(zfs_cmd_t *zc)
|
||||
* On error, restore the original props.
|
||||
*/
|
||||
if (error && props) {
|
||||
clear_props(tofs, props);
|
||||
clear_props(tofs, props, NULL);
|
||||
(void) zfs_set_prop_nvlist(tofs, origprops);
|
||||
}
|
||||
out:
|
||||
|
Loading…
x
Reference in New Issue
Block a user