Skip to content

Commit

Permalink
Attempt work around for zfs log write issue
Browse files Browse the repository at this point in the history
while(resid) {
gets stuck as it picks len==0 due to blocksize==0
due to zblksz==0.

Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Nov 4, 2023
1 parent 9754bbd commit fc741be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion module/os/windows/zfs/zfs_vnops_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions module/os/windows/zfs/zfs_znode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions module/zfs/zfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fc741be

Please sign in to comment.