Project

General

Profile

Bug #3739 » 3739.patch

Martin Matuška, 2013-04-22 10:39 PM

View differences:

usr/src/uts/common/fs/zfs/dsl_dir.c Wed Apr 17 20:25:52 2013 -0400 → usr/src/uts/common/fs/zfs/dsl_dir.c Tue Apr 23 00:37:20 2013 +0200
967 967

  
968 968
	VERIFY0(dsl_dataset_hold(dp, ddsqra->ddsqra_name, FTAG, &ds));
969 969

  
970
	dsl_prop_set_sync_impl(ds, zfs_prop_to_name(ZFS_PROP_QUOTA),
971
	    ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1,
972
	    &ddsqra->ddsqra_value, tx);
970
	if (spa_version(dp->dp_spa) >= SPA_VERSION_RECVD_PROPS) {
971
		dsl_prop_set_sync_impl(ds, zfs_prop_to_name(ZFS_PROP_QUOTA),
972
		    ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1,
973
		    &ddsqra->ddsqra_value, tx);
973 974

  
974
	VERIFY0(dsl_prop_get_int_ds(ds,
975
	    zfs_prop_to_name(ZFS_PROP_QUOTA), &newval));
975
		VERIFY0(dsl_prop_get_int_ds(ds,
976
		    zfs_prop_to_name(ZFS_PROP_QUOTA), &newval));
977
	} else {
978
		newval = ddsqra->ddsqra_value;
979
		spa_history_log_internal_ds(ds, "set", tx, "%s=%lld",
980
		    zfs_prop_to_name(ZFS_PROP_QUOTA), (longlong_t)newval);
981
	}
976 982

  
977 983
	dmu_buf_will_dirty(ds->ds_dir->dd_dbuf, tx);
978 984
	mutex_enter(&ds->ds_dir->dd_lock);
......
1083 1089

  
1084 1090
	VERIFY0(dsl_dataset_hold(dp, ddsqra->ddsqra_name, FTAG, &ds));
1085 1091

  
1086
	dsl_prop_set_sync_impl(ds, zfs_prop_to_name(ZFS_PROP_RESERVATION),
1087
	    ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1,
1088
	    &ddsqra->ddsqra_value, tx);
1092
	if (spa_version(dp->dp_spa) >= SPA_VERSION_RECVD_PROPS) {
1093
		dsl_prop_set_sync_impl(ds,
1094
		    zfs_prop_to_name(ZFS_PROP_RESERVATION),
1095
		    ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1,
1096
		    &ddsqra->ddsqra_value, tx);
1089 1097

  
1090
	VERIFY0(dsl_prop_get_int_ds(ds,
1091
	    zfs_prop_to_name(ZFS_PROP_RESERVATION), &newval));
1098
		VERIFY0(dsl_prop_get_int_ds(ds,
1099
		    zfs_prop_to_name(ZFS_PROP_RESERVATION), &newval));
1100
	} else {
1101
		newval = ddsqra->ddsqra_value;
1102
		spa_history_log_internal_ds(ds, "set", tx, "%s=%lld",
1103
		    zfs_prop_to_name(ZFS_PROP_RESERVATION),
1104
		    (longlong_t)newval);
1105
	}
1092 1106

  
1093 1107
	dsl_dir_set_reservation_sync_impl(ds->ds_dir, newval, tx);
1094 1108
	dsl_dataset_rele(ds, FTAG);
usr/src/uts/common/fs/zfs/dsl_prop.c Wed Apr 17 20:25:52 2013 -0400 → usr/src/uts/common/fs/zfs/dsl_prop.c Tue Apr 23 00:37:20 2013 +0200
557 557
	}
558 558

  
559 559
	if (version < SPA_VERSION_RECVD_PROPS) {
560
		zfs_prop_t prop = zfs_name_to_prop(propname);
561
		if (prop == ZFS_PROP_QUOTA || prop == ZFS_PROP_RESERVATION)
562
			return;
563

  
564 560
		if (source & ZPROP_SRC_NONE)
565 561
			source = ZPROP_SRC_NONE;
566 562
		else if (source & ZPROP_SRC_RECEIVED)
(3-3/3)