diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 5cfda1377e..c80b3b773b 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -1235,7 +1235,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap, if (flags.dedup) { featureflags |= (DMU_BACKUP_FEATURE_DEDUP | DMU_BACKUP_FEATURE_DEDUPPROPS); - if (err = pipe(pipefd)) { + if ((err = pipe(pipefd))) { zfs_error_aux(zhp->zfs_hdl, strerror(errno)); return (zfs_error(zhp->zfs_hdl, EZFS_PIPEFAILED, errbuf)); @@ -1243,7 +1243,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap, dda.outputfd = outfd; dda.inputfd = pipefd[1]; dda.dedup_hdl = zhp->zfs_hdl; - if (err = pthread_create(&tid, NULL, cksummer, &dda)) { + if ((err = pthread_create(&tid, NULL, cksummer, &dda))) { (void) close(pipefd[0]); (void) close(pipefd[1]); zfs_error_aux(zhp->zfs_hdl, strerror(errno)); diff --git a/module/zfs/bplist.c b/module/zfs/bplist.c index 066ccc6b1e..5d1cf7e763 100644 --- a/module/zfs/bplist.c +++ b/module/zfs/bplist.c @@ -58,7 +58,7 @@ bplist_iterate(bplist_t *bpl, bplist_itor_t *func, void *arg, dmu_tx_t *tx) bplist_entry_t *bpe; mutex_enter(&bpl->bpl_lock); - while (bpe = list_head(&bpl->bpl_list)) { + while ((bpe = list_head(&bpl->bpl_list))) { list_remove(&bpl->bpl_list, bpe); mutex_exit(&bpl->bpl_lock); func(arg, &bpe->bpe_blk, tx); diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c index c817b8d9e5..6f313e6c37 100644 --- a/module/zfs/dmu_send.c +++ b/module/zfs/dmu_send.c @@ -1185,8 +1185,9 @@ restore_write_byref(struct restorearg *ra, objset_t *os, ref_os = os; } - if (err = dmu_buf_hold(ref_os, drrwbr->drr_refobject, - drrwbr->drr_refoffset, FTAG, &dbp, DMU_READ_PREFETCH)) + err = dmu_buf_hold(ref_os, drrwbr->drr_refobject, + drrwbr->drr_refoffset, FTAG, &dbp, DMU_READ_PREFETCH); + if (err) return (err); tx = dmu_tx_create(os); @@ -1443,7 +1444,7 @@ out: if (featureflags & DMU_BACKUP_FEATURE_DEDUP) { void *cookie = NULL; - while (gmep = avl_destroy_nodes(&ra.guid_to_ds_map, &cookie)) { + while ((gmep = avl_destroy_nodes(&ra.guid_to_ds_map, &cookie))) { dsl_dataset_rele(gmep->gme_ds, &ra.guid_to_ds_map); kmem_free(gmep, sizeof (guid_map_entry_t)); } diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c index a270061388..719315d624 100644 --- a/module/zfs/dmu_tx.c +++ b/module/zfs/dmu_tx.c @@ -1218,7 +1218,7 @@ dmu_tx_do_callbacks(list_t *cb_list, int error) { dmu_tx_callback_t *dcb; - while (dcb = list_head(cb_list)) { + while ((dcb = list_head(cb_list))) { list_remove(cb_list, dcb); dcb->dcb_func(dcb->dcb_data, error); kmem_free(dcb, sizeof (dmu_tx_callback_t)); diff --git a/module/zfs/dmu_zfetch.c b/module/zfs/dmu_zfetch.c index 37037c30f6..4a1b1f4a7f 100644 --- a/module/zfs/dmu_zfetch.c +++ b/module/zfs/dmu_zfetch.c @@ -665,7 +665,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset, uint64_t size, int prefetched) ZFETCHSTAT_BUMP(zfetchstat_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_misses); - if (fetched = dmu_zfetch_colinear(zf, &zst)) { + if ((fetched = dmu_zfetch_colinear(zf, &zst))) { ZFETCHSTAT_BUMP(zfetchstat_colinear_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_colinear_misses); diff --git a/module/zfs/sa.c b/module/zfs/sa.c index d238475da7..231e637432 100644 --- a/module/zfs/sa.c +++ b/module/zfs/sa.c @@ -1022,16 +1022,16 @@ sa_tear_down(objset_t *os) sizeof (sa_attr_table_t) * sa->sa_num_attrs); cookie = NULL; - while (layout = avl_destroy_nodes(&sa->sa_layout_hash_tree, &cookie)) { + while ((layout = avl_destroy_nodes(&sa->sa_layout_hash_tree, &cookie))){ sa_idx_tab_t *tab; - while (tab = list_head(&layout->lot_idx_tab)) { + while ((tab = list_head(&layout->lot_idx_tab))) { ASSERT(refcount_count(&tab->sa_refcount)); sa_idx_tab_rele(os, tab); } } cookie = NULL; - while (layout = avl_destroy_nodes(&sa->sa_layout_num_tree, &cookie)) { + while ((layout = avl_destroy_nodes(&sa->sa_layout_num_tree, &cookie))){ kmem_free(layout->lot_attrs, sizeof (sa_attr_type_t) * layout->lot_attr_count); kmem_free(layout, sizeof (sa_lot_t)); @@ -1304,7 +1304,7 @@ sa_handle_get(objset_t *objset, uint64_t objid, void *userp, dmu_buf_t *db; int error; - if (error = dmu_bonus_hold(objset, objid, NULL, &db)) + if ((error = dmu_bonus_hold(objset, objid, NULL, &db))) return (error); return (sa_handle_get_from_db(objset, db, userp, hdl_type, diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 8274a90826..6b90cc2309 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -5382,7 +5382,7 @@ spa_sync(spa_t *spa, uint64_t txg) ddt_sync(spa, txg); dsl_scan_sync(dp, tx); - while (vd = txg_list_remove(&spa->spa_vdev_txg_list, txg)) + while ((vd = txg_list_remove(&spa->spa_vdev_txg_list, txg))) vdev_sync(vd, txg); if (pass == 1) diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 79e29b3021..acb6777883 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -1521,8 +1521,8 @@ zfs_ioc_vdev_split(zfs_cmd_t *zc) if ((error = spa_open(zc->zc_name, &spa, FTAG)) != 0) return (error); - if (error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size, - zc->zc_iflags, &config)) { + if ((error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size, + zc->zc_iflags, &config))) { spa_close(spa, FTAG); return (error); } @@ -1637,13 +1637,13 @@ zfs_ioc_objset_stats(zfs_cmd_t *zc) * local property values. */ static int -zfs_ioc_objset_recvd_props(zfs_cmd_t *zc) +zfs_ioc_objset_recvd_props(struct file *filp, zfs_cmd_t *zc) { objset_t *os = NULL; int error; nvlist_t *nv; - if (error = dmu_objset_hold(zc->zc_name, FTAG, &os)) + if ((error = dmu_objset_hold(zc->zc_name, FTAG, &os))) return (error); /* @@ -2368,8 +2368,8 @@ zfs_ioc_pool_set_props(zfs_cmd_t *zc) int error; nvpair_t *pair; - if (error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size, - zc->zc_iflags, &props)) + if ((error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size, + zc->zc_iflags, &props))) return (error); /* @@ -3090,8 +3090,8 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr) if (prop == ZPROP_INVAL) { if (zfs_prop_user(propname)) { - if (err = zfs_secpolicy_write_perms(dsname, - ZFS_DELEG_PERM_USERPROP, cr)) + if ((err = zfs_secpolicy_write_perms(dsname, + ZFS_DELEG_PERM_USERPROP, cr))) return (err); return (0); } @@ -3114,7 +3114,7 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr) return (EINVAL); } - if (err = zfs_secpolicy_write_perms(dsname, perm, cr)) + if ((err = zfs_secpolicy_write_perms(dsname, perm, cr))) return (err); return (0); }