summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/arc.c9
-rw-r--r--module/zfs/dmu_traverse.c5
-rw-r--r--module/zfs/dsl_dataset.c2
-rw-r--r--module/zfs/lzjb.c4
-rw-r--r--module/zfs/refcount.c2
-rw-r--r--module/zfs/spa.c6
-rw-r--r--module/zfs/vdev_raidz.c2
-rw-r--r--module/zfs/zap_leaf.c2
-rw-r--r--module/zfs/zfs_byteswap.c2
9 files changed, 19 insertions, 15 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 3a9598a92..444ca863d 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -2524,7 +2524,7 @@ arc_read_nolock(zio_t *pio, spa_t *spa, blkptr_t *bp,
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);
@@ -2922,7 +2922,7 @@ arc_release(arc_buf_t *buf, void *tag)
arc_buf_hdr_t *hdr;
kmutex_t *hash_lock;
l2arc_buf_hdr_t *l2hdr;
- uint64_t buf_size;
+ uint64_t buf_size = 0;
rw_enter(&buf->b_lock, RW_WRITER);
hdr = buf->b_hdr;
@@ -4042,7 +4042,7 @@ l2arc_read_done(zio_t *zio)
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);
@@ -4215,11 +4215,12 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
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;
uint64_t guid = spa_guid(spa);
+ int try;
ASSERT(dev->l2ad_vdev != NULL);
diff --git a/module/zfs/dmu_traverse.c b/module/zfs/dmu_traverse.c
index 197284e1e..e4cb35bd1 100644
--- a/module/zfs/dmu_traverse.c
+++ b/module/zfs/dmu_traverse.c
@@ -309,7 +309,7 @@ traverse_impl(spa_t *spa, uint64_t objset, blkptr_t *rootbp,
uint64_t txg_start, int flags, blkptr_cb_t func, void *arg)
{
struct traverse_data td;
- struct prefetch_data pd = { 0 };
+ struct prefetch_data pd;
zbookmark_t czb;
int err;
@@ -323,7 +323,10 @@ traverse_impl(spa_t *spa, uint64_t objset, blkptr_t *rootbp,
td.td_flags = flags;
pd.pd_blks_max = 100;
+ pd.pd_blks_fetched = 0;
pd.pd_flags = flags;
+ pd.pd_cancel = B_FALSE;
+ pd.pd_exited = B_FALSE;
mutex_init(&pd.pd_mtx, NULL, MUTEX_DEFAULT, NULL);
cv_init(&pd.pd_cv, NULL, CV_DEFAULT, NULL);
diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c
index a68b12d33..24962ea0f 100644
--- a/module/zfs/dsl_dataset.c
+++ b/module/zfs/dsl_dataset.c
@@ -351,7 +351,7 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint64_t dsobj, void *tag,
return (err);
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;
diff --git a/module/zfs/lzjb.c b/module/zfs/lzjb.c
index 7fcde8475..4132406bd 100644
--- a/module/zfs/lzjb.c
+++ b/module/zfs/lzjb.c
@@ -51,7 +51,7 @@ lzjb_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
{
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;
uint16_t *hp;
@@ -104,7 +104,7 @@ lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
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) {
diff --git a/module/zfs/refcount.c b/module/zfs/refcount.c
index f1b3b23fe..c0700db56 100644
--- a/module/zfs/refcount.c
+++ b/module/zfs/refcount.c
@@ -113,7 +113,7 @@ refcount_count(refcount_t *rc)
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) {
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index df1b7e125..8137043d9 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -278,7 +278,7 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
{
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) {
@@ -870,7 +870,7 @@ spa_load_l2cache(spa_t *spa)
uint_t nl2cache;
int i, j, oldnvdevs;
uint64_t guid, size;
- 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);
@@ -3088,7 +3088,7 @@ spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done)
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;
size_t len;
txg = spa_vdev_enter(spa);
diff --git a/module/zfs/vdev_raidz.c b/module/zfs/vdev_raidz.c
index ad997f528..f02a83cbb 100644
--- a/module/zfs/vdev_raidz.c
+++ b/module/zfs/vdev_raidz.c
@@ -789,7 +789,7 @@ vdev_raidz_io_done(zio_t *zio)
vdev_t *vd = zio->io_vd;
vdev_t *cvd;
raidz_map_t *rm = zio->io_vsd;
- raidz_col_t *rc, *rc1;
+ raidz_col_t *rc = NULL, *rc1;
int unexpected_errors = 0;
int parity_errors = 0;
int parity_untried = 0;
diff --git a/module/zfs/zap_leaf.c b/module/zfs/zap_leaf.c
index da498b6bc..267f296fb 100644
--- a/module/zfs/zap_leaf.c
+++ b/module/zfs/zap_leaf.c
@@ -220,7 +220,7 @@ zap_leaf_array_create(zap_leaf_t *l, const char *buf,
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;
diff --git a/module/zfs/zfs_byteswap.c b/module/zfs/zfs_byteswap.c
index cd36696f9..d5f3013df 100644
--- a/module/zfs/zfs_byteswap.c
+++ b/module/zfs/zfs_byteswap.c
@@ -50,7 +50,7 @@ zfs_ace_byteswap(void *buf, size_t size, boolean_t zfs_layout)
{
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;