NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/60286 (zfs sparse zvol reports wrong volume size)
Em sex, 2026-05-22 às 16:47 +0000, riastradh%NetBSD.org@localhost escreveu:
Synopsis: zfs sparse zvol reports wrong volume size
Responsible-Changed-From-To: kern-bug-people->mlelstv
Responsible-Changed-By: riastradh%NetBSD.org@localhost
Responsible-Changed-When: Fri, 22 May 2026 16:47:19 +0000
Responsible-Changed-Why:
Can you take a look? Looks like you added the original dkw_size =
dg_secperunit assignment.
this is the patch... for me it looks like it removes the dkw->dwk_size and recompute it with new value... 6 lines later...
Unless the code I put on the bug report is messed I think this is correct
17 --- usr/src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c.orig 2026-05-22 11:10:15.900492779 -0300
18 +++ usr/src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c 2026-05-22 11:10:28.101264922 -0300
19 @@ -3621,7 +3621,13 @@
20 strlcpy(dkw->dkw_parent, "ZFS", sizeof(dkw->dkw_parent));
21
22 dkw->dkw_offset = 0;
23 - dkw->dkw_size = dg->dg_secperunit;
24 + /*
25 + * dkw_size is in DEV_BSIZE (512) blocks, but dg_secperunit
26 + * counts in dg_secsize blocks (which may be 4096 or larger
27 + * depending on the pool's ashift). Convert to DEV_BSIZE.
28 + */
29 + dkw->dkw_size = dg->dg_secperunit *
30 + (dg->dg_secsize / DEV_BSIZE);
31 strcpy(dkw->dkw_ptype, DKW_PTYPE_FFS);
Home |
Main Index |
Thread Index |
Old Index