mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
2619 asynchronous destruction of ZFS file systems 2747 SPA versioning with zfs feature flags Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed by: George Wilson <gwilson@delphix.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com> Approved by: Eric Schrock <Eric.Schrock@delphix.com> References: illumos/illumos-gate@53089ab7c8 illumos/illumos-gate@ad135b5d64 illumos changeset: 13700:2889e2596bd6 https://www.illumos.org/issues/2619 https://www.illumos.org/issues/2747 NOTE: The grub specific changes were not ported. This change must be made to the Linux grub packages. Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
committed by
Brian Behlendorf
parent
15313c5e18
commit
9ae529ec5d
+11
-6
@@ -1077,8 +1077,8 @@ restore_object(struct restorearg *ra, objset_t *os, struct drr_object *drro)
|
||||
void *data = NULL;
|
||||
|
||||
if (drro->drr_type == DMU_OT_NONE ||
|
||||
drro->drr_type >= DMU_OT_NUMTYPES ||
|
||||
drro->drr_bonustype >= DMU_OT_NUMTYPES ||
|
||||
!DMU_OT_IS_VALID(drro->drr_type) ||
|
||||
!DMU_OT_IS_VALID(drro->drr_bonustype) ||
|
||||
drro->drr_checksumtype >= ZIO_CHECKSUM_FUNCTIONS ||
|
||||
drro->drr_compress >= ZIO_COMPRESS_FUNCTIONS ||
|
||||
P2PHASE(drro->drr_blksz, SPA_MINBLOCKSIZE) ||
|
||||
@@ -1143,7 +1143,9 @@ restore_object(struct restorearg *ra, objset_t *os, struct drr_object *drro)
|
||||
ASSERT3U(db->db_size, >=, drro->drr_bonuslen);
|
||||
bcopy(data, db->db_data, drro->drr_bonuslen);
|
||||
if (ra->byteswap) {
|
||||
dmu_ot[drro->drr_bonustype].ot_byteswap(db->db_data,
|
||||
dmu_object_byteswap_t byteswap =
|
||||
DMU_OT_BYTESWAP(drro->drr_bonustype);
|
||||
dmu_ot_byteswap[byteswap].ob_func(db->db_data,
|
||||
drro->drr_bonuslen);
|
||||
}
|
||||
dmu_buf_rele(db, FTAG);
|
||||
@@ -1186,7 +1188,7 @@ restore_write(struct restorearg *ra, objset_t *os,
|
||||
int err;
|
||||
|
||||
if (drrw->drr_offset + drrw->drr_length < drrw->drr_offset ||
|
||||
drrw->drr_type >= DMU_OT_NUMTYPES)
|
||||
!DMU_OT_IS_VALID(drrw->drr_type))
|
||||
return (EINVAL);
|
||||
|
||||
data = restore_read(ra, drrw->drr_length);
|
||||
@@ -1205,8 +1207,11 @@ restore_write(struct restorearg *ra, objset_t *os,
|
||||
dmu_tx_abort(tx);
|
||||
return (err);
|
||||
}
|
||||
if (ra->byteswap)
|
||||
dmu_ot[drrw->drr_type].ot_byteswap(data, drrw->drr_length);
|
||||
if (ra->byteswap) {
|
||||
dmu_object_byteswap_t byteswap =
|
||||
DMU_OT_BYTESWAP(drrw->drr_type);
|
||||
dmu_ot_byteswap[byteswap].ob_func(data, drrw->drr_length);
|
||||
}
|
||||
dmu_write(os, drrw->drr_object,
|
||||
drrw->drr_offset, drrw->drr_length, data, tx);
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
Reference in New Issue
Block a user