nvlist_t *match = NULL;
char *name = NULL;
char *sepp = NULL;
- char sep;
+ char sep = 0;
int count = 0;
importargs_t args = { 0 };
{
zfs_type_t type = ZFS_TYPE_FILESYSTEM;
zfs_handle_t *zhp = NULL;
- uint64_t volsize;
+ uint64_t volsize = 0;
int c;
boolean_t noreserve = B_FALSE;
boolean_t bflag = B_FALSE;
main(int argc, char **argv)
{
int ret;
- int i;
+ int i = 0;
char *progname;
char *cmdname;
(void) fprintf(stderr, gettext("unrecognized "
"command '%s'\n"), cmdname);
usage(B_FALSE);
+ ret = 1;
}
libzfs_mnttab_cache(g_zfs, B_FALSE);
}
*/
if (ps->pss_state == DSS_FINISHED) {
uint64_t minutes_taken = (end - start) / 60;
- char *fmt;
+ char *fmt = NULL;
if (ps->pss_func == POOL_SCAN_SCRUB) {
fmt = gettext("scrub repaired %s in %lluh%um with "
main(int argc, char **argv)
{
int ret;
- int i;
+ int i = 0;
char *cmdname;
(void) setlocale(LC_ALL, "");
(void) fprintf(stderr, gettext("unrecognized "
"command '%s'\n"), cmdname);
usage(B_FALSE);
+ ret = 1;
}
libzfs_fini(g_zfs);
uint_t c, children;
nvlist_t *nv;
char *type;
- replication_level_t lastrep, rep, *ret;
+ replication_level_t lastrep = { 0 }, rep, *ret;
boolean_t dontreport;
ret = safe_malloc(sizeof (replication_level_t));
zfs_prop_t prop;
boolean_t do_prefix;
uint64_t idx;
- int added_resv;
+ int added_resv = 0;
(void) snprintf(errbuf, sizeof (errbuf),
dgettext(TEXT_DOMAIN, "cannot set property for '%s'"),
{
int prefix;
char *path_copy;
- int rc;
+ int rc = 0;
if (check_parents(hdl, path, NULL, B_TRUE, &prefix) != 0)
return (-1);
int err;
zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
boolean_t restore_resv = 0;
- uint64_t old_volsize, new_volsize;
- zfs_prop_t resv_prop;
+ uint64_t old_volsize = 0, new_volsize;
+ zfs_prop_t resv_prop = { 0 };
assert(zhp->zfs_type == ZFS_TYPE_FILESYSTEM ||
zhp->zfs_type == ZFS_TYPE_VOLUME);
"child dataset with inherited mountpoint is used "
"in a non-global zone"));
(void) zfs_error(hdl, EZFS_ZONED, errbuf);
+ ret = -1;
goto error;
}
pool_entry_t *pe;
vdev_entry_t *ve;
config_entry_t *ce;
- nvlist_t *ret = NULL, *config = NULL, *tmp, *nvtop, *nvroot;
+ nvlist_t *ret = NULL, *config = NULL, *tmp = NULL, *nvtop, *nvroot;
nvlist_t **spares, **l2cache;
uint_t i, nspares, nl2cache;
boolean_t config_seen;
const char *source, const char *recvd_value)
{
int i;
- const char *str;
+ const char *str = NULL;
char buf[128];
/*
{
nvpair_t *nvp;
const char *np;
- char *sepp;
+ char *sepp=NULL;
char *idxp, *idxep;
nvlist_t **nva;
- long idx;
+ long idx = 0;
int n;
if (ip)
uint32_t *arc_flags, const zbookmark_t *zb)
{
arc_buf_hdr_t *hdr;
- arc_buf_t *buf;
+ arc_buf_t *buf = NULL;
kmutex_t *hash_lock;
zio_t *rzio;
uint64_t guid = spa_guid(spa);
uint64_t size = BP_GET_LSIZE(bp);
arc_callback_t *acb;
vdev_t *vd = NULL;
- uint64_t addr;
+ daddr_t addr = -1;
boolean_t devw = B_FALSE;
if (hdr == NULL) {
arc_buf_hdr_t *hdr;
kmutex_t *hash_lock = NULL;
l2arc_buf_hdr_t *l2hdr;
- uint64_t buf_size;
+ uint64_t buf_size = 0;
/*
* It would be nice to assert that if it's DMU metadata (level >
static list_t *
l2arc_list_locked(int list_num, kmutex_t **lock)
{
- list_t *list;
+ list_t *list = NULL;
ASSERT(list_num >= 0 && list_num <= 3);
list_t *list;
uint64_t passed_sz, write_sz, buf_sz, headroom;
void *buf_data;
- kmutex_t *hash_lock, *list_lock;
+ kmutex_t *hash_lock, *list_lock = NULL;
boolean_t have_lock, full;
l2arc_write_callback_t *cb;
zio_t *pio, *wzio;
uint32_t dbuf_flags;
int err;
zio_t *zio;
- hrtime_t start;
+ hrtime_t start = 0;
ASSERT(length <= DMU_MAX_ACCESS);
objset_t *os = dn->dn_objset;
void *data = NULL;
dmu_buf_impl_t *db = NULL;
- uint64_t *user, *group;
+ uint64_t *user = NULL, *group = NULL;
int flags = dn->dn_id_flags;
int error;
boolean_t have_spill = B_FALSE;
ds = dmu_buf_get_user(dbuf);
if (ds == NULL) {
- dsl_dataset_t *winner;
+ dsl_dataset_t *winner = NULL;
ds = kmem_zalloc(sizeof (dsl_dataset_t), KM_SLEEP);
ds->ds_dbuf = dbuf;
{
uchar_t *src = s_start;
uchar_t *dst = d_start;
- uchar_t *cpy, *copymap;
+ uchar_t *cpy, *copymap = NULL;
int copymask = 1 << (NBBY - 1);
int mlen, offset, hash;
uint16_t *hp;
uchar_t *src = s_start;
uchar_t *dst = d_start;
uchar_t *d_end = (uchar_t *)d_start + d_len;
- uchar_t *cpy, copymap;
+ uchar_t *cpy, copymap = 0;
int copymask = 1 << (NBBY - 1);
while (dst < d_end) {
int64_t
refcount_add_many(refcount_t *rc, uint64_t number, void *holder)
{
- reference_t *ref;
+ reference_t *ref = NULL;
int64_t count;
if (reference_tracking_enable) {
int buf_space;
sa_attr_type_t *attrs, *attrs_start;
int i, lot_count;
- int hdrsize, spillhdrsize;
+ int hdrsize, spillhdrsize = 0;
int used;
dmu_object_type_t bonustype;
sa_lot_t *lot;
{
sa_os_t *sa = os->os_sa;
uint64_t sa_attr_count = 0;
- uint64_t sa_reg_count;
+ uint64_t sa_reg_count = 0;
int error = 0;
uint64_t attr_value;
sa_attr_table_t *tb;
sa_bulk_attr_t *attr_desc;
void *old_data[2];
int bonus_attr_count = 0;
- int bonus_data_size, spill_data_size;
+ int bonus_data_size = 0, spill_data_size = 0;
int spill_attr_count = 0;
int error;
uint16_t length;
{
nvpair_t *elem;
int error = 0, reset_bootfs = 0;
- uint64_t objnum;
+ uint64_t objnum = 0;
elem = NULL;
while ((elem = nvlist_next_nvpair(props, elem)) != NULL) {
uint_t nl2cache;
int i, j, oldnvdevs;
uint64_t guid;
- vdev_t *vd, **oldvdevs, **newvdevs;
+ vdev_t *vd, **oldvdevs, **newvdevs = NULL;
spa_aux_vdev_t *sav = &spa->spa_l2cache;
ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL);
ASSERTV(vdev_t *rvd = spa->spa_root_vdev;)
vdev_t *vd, *pvd, *cvd, *tvd;
boolean_t unspare = B_FALSE;
- uint64_t unspare_guid;
+ uint64_t unspare_guid = 0;
char *vdpath;
int c, t;
static spa_t search; /* spa_t is large; don't allocate on stack */
spa_t *spa;
avl_index_t where;
- char c;
+ char c = 0;
char *cp;
ASSERT(MUTEX_HELD(&spa_namespace_lock));
{
vdev_t *vd = zio->io_vd;
vdev_file_t *vf = vd->vdev_tsd;
- ssize_t resid;
+ ssize_t resid = 0;
if (zio->io_type == ZIO_TYPE_IOCTL) {
/* XXPOLICY */
char *buf;
size_t buflen;
int error;
- uint64_t spare_guid, l2cache_guid;
+ uint64_t spare_guid = 0, l2cache_guid = 0;
int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL;
int c, l;
vdev_t *pvd;
uint64_t ccount;
uint8_t *dst[VDEV_RAIDZ_MAXPARITY];
uint64_t dcount[VDEV_RAIDZ_MAXPARITY];
- uint8_t log, val;
+ uint8_t log = 0, val;
int ll;
uint8_t *invlog[VDEV_RAIDZ_MAXPARITY];
uint8_t *p, *pp;
{
zio_bad_cksum_t zbc;
raidz_map_t *rm = zio->io_vsd;
+ int ret;
- int ret = zio_checksum_error(zio, &zbc);
+ bzero(&zbc, sizeof (zio_bad_cksum_t));
+
+ ret = zio_checksum_error(zio, &zbc);
if (ret != 0 && zbc.zbc_injected != 0)
rm->rm_ecksuminjected = 1;
vdev_t *vd = zio->io_vd;
vdev_t *cvd;
raidz_map_t *rm = zio->io_vsd;
- raidz_col_t *rc;
+ raidz_col_t *rc = NULL;
int unexpected_errors = 0;
int parity_errors = 0;
int parity_untried = 0;
uint16_t chunk_head;
uint16_t *chunkp = &chunk_head;
int byten = 0;
- uint64_t value;
+ uint64_t value = 0;
int shift = (integer_size-1)*8;
int len = num_integers;
{
caddr_t end;
caddr_t ptr;
- zfs_ace_t *zacep;
+ zfs_ace_t *zacep = NULL;
ace_t *acep;
uint16_t entry_type;
size_t entry_size;
zfs_range_unlock_reader(znode_t *zp, rl_t *remove)
{
avl_tree_t *tree = &zp->z_range_avl;
- rl_t *rl, *next;
+ rl_t *rl, *next = NULL;
uint64_t len;
/*
char *lrbuf, *lrp;
int error = 0;
+ bzero(&next_blk, sizeof(blkptr_t));
+
/*
* Old logs didn't record the maximum zh_claim_lr_seq.
*/
for (blk = zh->zh_log; !BP_IS_HOLE(&blk); blk = next_blk) {
uint64_t blk_seq = blk.blk_cksum.zc_word[ZIL_ZC_SEQ];
int reclen;
- char *end;
+ char *end = NULL;
if (blk_seq > claim_blk_seq)
break;