Print this page
cstyle fixes
dsl_dataset_set_fsid_guid should use ZFS_SPACE_CHECK_RESERVED
dsl_dataset_set_fsid_guid _check and _sync func declared static,
removed from dsl_dataset.h
rewrite unique_valid
6333 ZFS should let the user specify or modify the fsid_guid of a dataset

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzfs/common/libzfs_dataset.c
          +++ new/usr/src/lib/libzfs/common/libzfs_dataset.c
↓ open down ↓ 1476 lines elided ↑ open up ↑
1477 1477                  break;
1478 1478  
1479 1479          case EINVAL:
1480 1480                  if (prop == ZPROP_INVAL) {
1481 1481                          (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
1482 1482                  } else {
1483 1483                          (void) zfs_standard_error(hdl, err, errbuf);
1484 1484                  }
1485 1485                  break;
1486 1486  
     1487 +        case EEXIST:
     1488 +                zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
     1489 +                    "fsid_guid is invalid or already in use"));
     1490 +                (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
     1491 +                break;
     1492 +
1487 1493          case EOVERFLOW:
1488 1494                  /*
1489 1495                   * This platform can't address a volume this big.
1490 1496                   */
1491 1497  #ifdef _ILP32
1492 1498                  if (prop == ZFS_PROP_VOLSIZE) {
1493 1499                          (void) zfs_error(hdl, EZFS_VOLTOOBIG, errbuf);
1494 1500                          break;
1495 1501                  }
1496 1502  #endif
↓ open down ↓ 989 lines elided ↑ open up ↑
2486 2492                                  break;
2487 2493                          }
2488 2494                          m_label_free(new_sl);
2489 2495  
2490 2496                          (void) strlcpy(propbuf, ascii, proplen);
2491 2497                          free(ascii);
2492 2498                  }
2493 2499                  break;
2494 2500  
2495 2501          case ZFS_PROP_GUID:
     2502 +        case ZFS_PROP_FSID_GUID:
2496 2503                  /*
2497 2504                   * GUIDs are stored as numbers, but they are identifiers.
2498 2505                   * We don't want them to be pretty printed, because pretty
2499 2506                   * printing mangles the ID into a truncated and useless value.
2500 2507                   */
2501 2508                  if (get_numeric_property(zhp, prop, src, &source, &val) != 0)
2502 2509                          return (-1);
2503 2510                  (void) snprintf(propbuf, proplen, "%llu", (u_longlong_t)val);
2504 2511                  break;
2505 2512  
↓ open down ↓ 765 lines elided ↑ open up ↑
3271 3278                  case EINVAL:
3272 3279                          zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
3273 3280                              "parent '%s' is not a filesystem"), parent);
3274 3281                          return (zfs_error(hdl, EZFS_BADTYPE, errbuf));
3275 3282  
3276 3283                  case ENOTSUP:
3277 3284                          zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
3278 3285                              "pool must be upgraded to set this "
3279 3286                              "property or value"));
3280 3287                          return (zfs_error(hdl, EZFS_BADVERSION, errbuf));
     3288 +
     3289 +                case EEXIST:
     3290 +                        zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
     3291 +                            "fsid_guid is invalid or already in use"));
     3292 +                        return (zfs_error(hdl, EZFS_BADPROP, errbuf));
3281 3293  #ifdef _ILP32
3282 3294                  case EOVERFLOW:
3283 3295                          /*
3284 3296                           * This platform can't address a volume this big.
3285 3297                           */
3286 3298                          if (type == ZFS_TYPE_VOLUME)
3287 3299                                  return (zfs_error(hdl, EZFS_VOLTOOBIG,
3288 3300                                      errbuf));
3289 3301  #endif
3290 3302                          /* FALLTHROUGH */
↓ open down ↓ 1464 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX