ZFS missing typecast

Peter pmc at citylink.dinoex.sub.org
Tue Feb 11 23:13:20 UTC 2020


$ sysctl -a | grep abd
vfs.zfs.abd_chunk_size: 4096
vfs.zfs.abd_scatter_enabled: 1
kstat.zfs.misc.abdstats.linear_data_size: 0
kstat.zfs.misc.abdstats.linear_cnt: 0
kstat.zfs.misc.abdstats.scatter_chunk_waste: 64521468332612608   !!!!
kstat.zfs.misc.abdstats.scatter_data_size: 488805376
kstat.zfs.misc.abdstats.scatter_cnt: 18458
kstat.zfs.misc.abdstats.struct_size: 999940

This is Rel. 11.3, and this is certainly bogus. Fix:

Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c        (revision 357643)
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c        (working copy)
@@ -335,7 +335,7 @@
        ABDSTAT_BUMPDOWN(abdstat_scatter_cnt);
        ABDSTAT_INCR(abdstat_scatter_data_size, -(int)abd->abd_size);
        ABDSTAT_INCR(abdstat_scatter_chunk_waste,
-           abd->abd_size - n * zfs_abd_chunk_size);
+           (int)(abd->abd_size - n * zfs_abd_chunk_size));
 
        abd_free_struct(abd);
 }


BTW, let me mention another thing: in-kernel ZFS does currently NOT
COMPILE; I get these errors:
--- kernel.full ---
atomic.o: In function `atomic_add_64':
/usr/src/sys/i386/compile/E1R11V2/./machine/atomic.h:629: multiple definition of `atomic_add_64'
opensolaris_atomic.o:/usr/src/sys/i386/compile/E1R11V2/../../../cddl/contrib/ope
nsolaris/common/atomic/i386/opensolaris_atomic.S:71: first defined here

I reported this already in these messages
https://lists.freebsd.org/pipermail/freebsd-stable/2019-July/091389.html
but tha matter ended up in nothingness, and I do not know if anybody
finally bothered to fix it.
I for my part hate plugins, so I do not use kernel loadable modules, and
want my ZFS (and dtrace, for that) compiled in the kernel.

(This comes back to my mind, because I had to temporally remove my
local fix for that to make certain that the bogus stats are not
actually introduced by my own hacks - would be great to eventually
get rid of some of them.)


cheers,
PMc


More information about the freebsd-fs mailing list