avg-I commented on this pull request.


> +             /* Check if the target snapshot exists at all. */
+               error = dsl_dataset_hold(dp, ddra->ddra_tosnap, FTAG, &snapds);
+               if (error != 0) {
+                       /* Distinguish between missing dataset and snapshot. */
+                       if (error == ENOENT || error == EXDEV)
+                               error = SET_ERROR(ESRCH);
+                       dsl_dataset_rele(ds, FTAG);
+                       return (error);
+               }
+               ASSERT(snapds->ds_is_snapshot);
+
+               /* Check if the snapshot is the latest snapshot indeed. */
+               if (snapds != ds->ds_prev) {
+                       /*
+                        * See if the snapshot is a snapshot of the filesystem
+                        * or the snapshot is an origin of the filesystem.

Thank you for the suggestion!

-- 
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/434#discussion_r138098948
------------------------------------------
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/T5032507ba3c52b88-M648a4549862d3c656537048a
Powered by Topicbox: https://topicbox.com

Reply via email to