From b31c53455ef092c156d53643429d942370932684 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 20 Nov 2008 14:04:07 -0800 Subject: [PATCH] Add gcc-missing-case branch --- .topdeps | 1 + .topmsg | 8 ++++++++ zfs/lib/libdmu-ctl/zfs_ioctl.c | 4 ++++ zfs/lib/libzfs/libzfs_changelist.c | 4 ++++ zfs/lib/libzfs/libzfs_dataset.c | 18 ++++++++++++++++++ zfs/lib/libzpool/spa.c | 2 ++ zfs/lib/libzpool/vdev_label.c | 2 ++ 7 files changed, 39 insertions(+) create mode 100644 .topdeps create mode 100644 .topmsg diff --git a/.topdeps b/.topdeps new file mode 100644 index 0000000000..1f7391f92b --- /dev/null +++ b/.topdeps @@ -0,0 +1 @@ +master diff --git a/.topmsg b/.topmsg new file mode 100644 index 0000000000..c0773e3eac --- /dev/null +++ b/.topmsg @@ -0,0 +1,8 @@ +From: Brian Behlendorf +Subject: [PATCH] gcc warning missing case + +Gcc ASSERT() missing cases are impossible + +Signed-off-by: Brian Behlendorf + +--- diff --git a/zfs/lib/libdmu-ctl/zfs_ioctl.c b/zfs/lib/libdmu-ctl/zfs_ioctl.c index e4d2534746..9c9dab5e91 100644 --- a/zfs/lib/libdmu-ctl/zfs_ioctl.c +++ b/zfs/lib/libdmu-ctl/zfs_ioctl.c @@ -325,6 +325,8 @@ zfs_secpolicy_setprop(const char *name, zfs_prop_t prop, cred_t *cr) return (EPERM); } break; + default: + break; } return (zfs_secpolicy_write_perms(name, zfs_prop_to_name(prop), cr)); @@ -1418,6 +1420,8 @@ zfs_set_prop_nvlist(const char *name, nvlist_t *nvl) if (zpl_check_version(name, ZPL_VERSION_FUID)) return (ENOTSUP); break; + default: + break; } if ((error = zfs_secpolicy_setprop(name, prop, CRED())) != 0) return (error); diff --git a/zfs/lib/libzfs/libzfs_changelist.c b/zfs/lib/libzfs/libzfs_changelist.c index a75b34df27..07865fe4ba 100644 --- a/zfs/lib/libzfs/libzfs_changelist.c +++ b/zfs/lib/libzfs/libzfs_changelist.c @@ -141,6 +141,8 @@ changelist_prefix(prop_changelist_t *clp) */ (void) zfs_unshare_iscsi(cn->cn_handle); break; + default: + break; } } else { /* @@ -157,6 +159,8 @@ changelist_prefix(prop_changelist_t *clp) case ZFS_PROP_SHARESMB: (void) zfs_unshare_smb(cn->cn_handle, NULL); break; + default: + break; } } } diff --git a/zfs/lib/libzfs/libzfs_dataset.c b/zfs/lib/libzfs/libzfs_dataset.c index 5b8119209c..9fff683df5 100644 --- a/zfs/lib/libzfs/libzfs_dataset.c +++ b/zfs/lib/libzfs/libzfs_dataset.c @@ -74,6 +74,8 @@ zfs_type_to_name(zfs_type_t type) return (dgettext(TEXT_DOMAIN, "snapshot")); case ZFS_TYPE_VOLUME: return (dgettext(TEXT_DOMAIN, "volume")); + default: + break; } return (NULL); @@ -183,6 +185,8 @@ zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type, zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "reserved disk name")); break; + default: + break; } } @@ -676,6 +680,8 @@ zfs_validate_properties(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, "component of '%s' is too long"), propname); break; + default: + break; } (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; @@ -800,6 +806,8 @@ zfs_validate_properties(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, case ZFS_PROP_NORMALIZE: chosen_normal = (int)intval; break; + default: + break; } /* @@ -848,6 +856,8 @@ zfs_validate_properties(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, goto error; } break; + default: + break; } } } @@ -1090,6 +1100,8 @@ zfs_build_perms(zfs_handle_t *zhp, char *whostr, char *perms, dgettext(TEXT_DOMAIN, "set definition must begin with an '@' " "character")); + default: + break; } return (zfs_error(zhp->zfs_hdl, EZFS_BADPERMSET, whostr)); @@ -1519,6 +1531,8 @@ zfs_perm_get(zfs_handle_t *zhp, zfs_allow_t **zfs_perms) &nvpair_name(who_pair)[3]); tree = &zallowp->z_sets; break; + default: + break; } /* @@ -1671,6 +1685,8 @@ zfs_deleg_perm_type_str(zfs_deleg_perm_type_t type) return (dgettext(TEXT_DOMAIN, "property")); case ZFS_DELEG_OTHER: return (dgettext(TEXT_DOMAIN, "other")); + default: + break; } return (""); } @@ -2053,6 +2069,8 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src, mntopt_on = MNTOPT_NBMAND; mntopt_off = MNTOPT_NONBMAND; break; + default: + break; } /* diff --git a/zfs/lib/libzpool/spa.c b/zfs/lib/libzpool/spa.c index f59db06db7..0a91cae671 100644 --- a/zfs/lib/libzpool/spa.c +++ b/zfs/lib/libzpool/spa.c @@ -386,6 +386,8 @@ spa_prop_validate(spa_t *spa, nvlist_t *props) strcmp(slash, "/..") == 0) error = EINVAL; break; + default: + break; } if (error) diff --git a/zfs/lib/libzpool/vdev_label.c b/zfs/lib/libzpool/vdev_label.c index 7dcf1facdb..b3b6fde5b7 100644 --- a/zfs/lib/libzpool/vdev_label.c +++ b/zfs/lib/libzpool/vdev_label.c @@ -441,6 +441,8 @@ vdev_inuse(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason, case VDEV_LABEL_SPARE: return (spa_has_spare(spa, device_guid)); + default: + break; } }