martymac commented on this pull request.
> + if (pread64(fd, &label, sizeof (vdev_label_t),
+ label_offset(size, l)) != sizeof (vdev_label_t))
+ return (-1);
+
+ if (!force) {
+ nvlist_t *config = NULL;
+ if (nvlist_unpack(buf, buflen, &config, 0) != 0)
+ return (-1);
+ nvlist_free(config);
+ }
+ }
+
+ if (wipe) {
+ (void) memset(&label, 0, sizeof (vdev_label_t));
+ } else {
+ if (nvlist_invalidate(buf, buflen) != 0)
The main goal of the patch is to allow wiping a single label with *minimal*
changes.
Acting on nvs encoding type (introducing a new type "invalid") allows touching
a single byte, which is great because it minimizes the risks of damaging
another FS that would have been created over the label. Acting on txg would
touch 8 bytes and greatly improve the chances to break something. Also, as a
side effect, acting on nvs encoding type keeps last txg value available for
debugging.
--
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/424#discussion_r166851737
------------------------------------------
openzfs-developer
Archives:
https://openzfs.topicbox.com/groups/developer/discussions/T59e810f5492df392-Mead329a69c4ddfb84cbab979
Powered by Topicbox: https://topicbox.com