Ramzec commented on this pull request.


> @@ -1000,6 +1000,16 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, 
> uint32_t flags)
                return;
        }
 
+       if (BP_IS_REDACTED(db->db_blkptr)) {

Could you please add a comment, that explains the meaning of this 
condition-block

> +}
+
+static int
+recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds,
+    uint64_t fromguid)
+{
+       uint64_t val;
+       int error;
+       dsl_pool_t *dp = ds->ds_dir->dd_pool;
+
+       /* temporary clone name must not exist */
+       error = zap_lookup(dp->dp_meta_objset,
+           dsl_dir_phys(ds->ds_dir)->dd_child_dir_zapobj, recv_clone_name,
+           8, 1, &val);
+       if (error != ENOENT)
+               return (error == 0 ? EBUSY : error);

return (error == 0 ? SET_ERROR(EBUSY) : error);

> +     int error;
+       dsl_pool_t *dp = ds->ds_dir->dd_pool;
+
+       /* temporary clone name must not exist */
+       error = zap_lookup(dp->dp_meta_objset,
+           dsl_dir_phys(ds->ds_dir)->dd_child_dir_zapobj, recv_clone_name,
+           8, 1, &val);
+       if (error != ENOENT)
+               return (error == 0 ? EBUSY : error);
+
+       /* new snapshot name must not exist */
+       error = zap_lookup(dp->dp_meta_objset,
+           dsl_dataset_phys(ds)->ds_snapnames_zapobj,
+           drba->drba_cookie->drc_tosnap, 8, 1, &val);
+       if (error != ENOENT)
+               return (error == 0 ? EEXIST : error);

return (error == 0 ? SET_ERROR(EEXIST) : error);

> +
+       /* See comment in restore_write. */
+       save_resume_state(rwa, drrwbr->drr_object, drrwbr->drr_offset, tx);
+       dmu_tx_commit(tx);
+       return (0);
+}
+
+static int
+receive_write_embedded(struct receive_writer_arg *rwa,
+    struct drr_write_embedded *drrwe, void *data)
+{
+       dmu_tx_t *tx;
+       int err;
+
+       if (drrwe->drr_offset + drrwe->drr_length < drrwe->drr_offset)
+               return (EINVAL);

SET_ERROR()

> +     dmu_tx_commit(tx);
+       return (0);
+}
+
+static int
+receive_write_embedded(struct receive_writer_arg *rwa,
+    struct drr_write_embedded *drrwe, void *data)
+{
+       dmu_tx_t *tx;
+       int err;
+
+       if (drrwe->drr_offset + drrwe->drr_length < drrwe->drr_offset)
+               return (EINVAL);
+
+       if (drrwe->drr_psize > BPE_PAYLOAD_SIZE)
+               return (EINVAL);

SET_ERROR()

> +
+static int
+receive_write_embedded(struct receive_writer_arg *rwa,
+    struct drr_write_embedded *drrwe, void *data)
+{
+       dmu_tx_t *tx;
+       int err;
+
+       if (drrwe->drr_offset + drrwe->drr_length < drrwe->drr_offset)
+               return (EINVAL);
+
+       if (drrwe->drr_psize > BPE_PAYLOAD_SIZE)
+               return (EINVAL);
+
+       if (drrwe->drr_etype >= NUM_BP_EMBEDDED_TYPES)
+               return (EINVAL);

SET_ERROR()

> +receive_write_embedded(struct receive_writer_arg *rwa,
+    struct drr_write_embedded *drrwe, void *data)
+{
+       dmu_tx_t *tx;
+       int err;
+
+       if (drrwe->drr_offset + drrwe->drr_length < drrwe->drr_offset)
+               return (EINVAL);
+
+       if (drrwe->drr_psize > BPE_PAYLOAD_SIZE)
+               return (EINVAL);
+
+       if (drrwe->drr_etype >= NUM_BP_EMBEDDED_TYPES)
+               return (EINVAL);
+       if (drrwe->drr_compression >= ZIO_COMPRESS_FUNCTIONS)
+               return (EINVAL);

SET_ERROR()

> +                             nvlist_free(nvl);
+                       }
+                       dsl_redaction_list_rele(rl, FTAG);
+               }
+       }
+}
+
+int
+dsl_get_bookmarks_impl(dsl_dataset_t *ds, nvlist_t *props, nvlist_t *outnvl)
+{
+       dsl_pool_t *dp = ds->ds_dir->dd_pool;
+
+       ASSERT(dsl_pool_config_held(dp));
+
+       if (dsl_dataset_is_snapshot(ds))
+               return (EINVAL);

SET_ERROR()

> @@ -384,6 +862,20 @@ dsl_bookmark_destroy_check(void *arg, dmu_tx_t *tx)
                                 */
                                continue;
                        }
+                       if (error == 0 && bm.zbm_redaction_obj != 0) {
+                               redaction_list_t *rl = NULL;
+                               error = dsl_redaction_list_hold_obj(tx->tx_pool,
+                                   bm.zbm_redaction_obj, FTAG, &rl);
+                               if (error == ENOENT) {
+                                       error = 0;
+                               } else if (error == 0 &&
+                                   dsl_redaction_list_long_held(rl)) {
+                                       error = EBUSY;

SET_ERROR()

> +     objset_t *mos = rl->rl_mos;
+       redact_block_phys_t *buf;
+       unsigned int bufsize = SPA_OLD_MAXBLOCKSIZE;
+       int err = 0;
+
+       if (rl->rl_phys->rlp_last_object != UINT64_MAX ||
+           rl->rl_phys->rlp_last_blkid != UINT64_MAX) {
+               /*
+                * When we finish a send, we update the last object and offset
+                * to UINT64_MAX.  If a send fails partway through, the last
+                * object and offset will have some other value, indicating how
+                * far the send got. The redaction list must be complete before
+                * it can be traversed, so return EINVAL if the last object and
+                * blkid are not set to UINT64_MAX.
+                */
+               return (EINVAL);

SET_ERROR()

>       return (err);
 }
 
+/*
+ * Return (in *usedp) the amount of space written in new that was not
+ * present at the time the bookmark corresponds to.  New may be a
+ * snapshot or the head.  Old must be a bookmark before new, in
+ * new's filesystem (or its origin) -- caller verifies this.
+ */
+int
+dsl_dataset_space_written_bookmark(zfs_bookmark_phys_t *bmp,
+    dsl_dataset_t *new, uint64_t *usedp, uint64_t *compp, uint64_t *uncompp)
+{
+       if (!(bmp->zbm_flags & ZBM_FLAG_HAS_FBN))
+               return (ENOTSUP);

SET_ERROR()

> + * outnvl: {
+ *     property 1, property 2, ...
+ * }
+ *
+ */
+/* ARGSUSED */
+static int
+zfs_ioc_get_bookmark_props(const char *bookmark, nvlist_t *innvl,
+    nvlist_t *outnvl)
+{
+       char fsname[ZFS_MAX_DATASET_NAME_LEN];
+       char *bmname;
+
+       bmname = strchr(bookmark, '#');
+       if (bmname == NULL)
+               return (EINVAL);

SET_ERROR()

> @@ -2082,6 +2086,38 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, dsl_dataset_t *ds)
        return (err);
 }
 
+/*
+ * Release VOPs and unmount a suspended filesystem.
+ */
+int
+zfs_end_fs(zfsvfs_t *zfsvfs, dsl_dataset_t *ds)

I see no this function in your branches (5.1 or 5.2).

-       return (0);
+       switch (new_type) {
+       case HOLE:
+               pending->sru.hole.datablksz = datablksz;
+               break;
+       case DATA:
+               pending->sru.data.datablksz = datablksz;
+               pending->sru.data.obj_type = dn->dn_type;
+               pending->sru.data.bp = *bp;
+               if (spta->issue_prefetches) {
+                       zbookmark_phys_t zb = {0};
+                       zb.zb_objset = dmu_objset_id(dn->dn_objset);
+                       zb.zb_object = dn->dn_obj

SET_ERROR()

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/484#pullrequestreview-87986470
------------------------------------------
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/T1fcfd4fc81bcdfff-Mbe1c8a29781e5c735188aabe
Powered by Topicbox: https://topicbox.com

Reply via email to