diff --git a/module/os/windows/zfs/zfs_vnops_windows.c b/module/os/windows/zfs/zfs_vnops_windows.c index 2394031d9eb2..24f435940a50 100644 --- a/module/os/windows/zfs/zfs_vnops_windows.c +++ b/module/os/windows/zfs/zfs_vnops_windows.c @@ -5026,7 +5026,7 @@ zfs_write_wrap(PDEVICE_OBJECT DeviceObject, PIRP Irp, (uint64_t)vp->FileHeader.AllocationSize.QuadPart) { Status = zfs_freesp(zp, - newlength, 0, FWRITE, B_TRUE); + newlength, 0, FWRITE, B_FALSE); if (!NT_SUCCESS(Status)) { dprintf("extend_file returned %08lx\n", Status); diff --git a/module/os/windows/zfs/zfs_znode.c b/module/os/windows/zfs/zfs_znode.c index eff94188fffb..bfa2e41b3bc3 100644 --- a/module/os/windows/zfs/zfs_znode.c +++ b/module/os/windows/zfs/zfs_znode.c @@ -550,6 +550,9 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, ASSERT(zp->z_dirlocks == NULL); ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); + if (blksz == 0) + blksz = 0x200; + /* * Defer setting z_zfsvfs until the znode is ready to be a candidate for * the zfs_znode_move() callback. diff --git a/module/zfs/zfs_log.c b/module/zfs/zfs_log.c index ee973d40f701..613fcdb2327a 100644 --- a/module/zfs/zfs_log.c +++ b/module/zfs/zfs_log.c @@ -676,6 +676,8 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, else if (wr_state == WR_INDIRECT) len = MIN(blocksize - P2PHASE(off, blocksize), resid); + ASSERT3U(len, >, 0); + itx = zil_itx_create(txtype, sizeof (*lr) + (wr_state == WR_COPIED ? len : 0)); lr = (lr_write_t *)&itx->itx_lr;