6599 kstat queues should assert on both platforms

Review Request #127 - Created Feb. 3, 2016 and submitted

Toomas Soome
6599 kstat queues should assert on both platforms

The issue was discovered with faulty kstat usage in my lofi experiment and I found the difference in sparc and x86 platform - sparcv9 did panic on the issue and x86 did not. The investigation conclusion is listed in bugreport.

sun4v non-debug build using first "good" lofi with correct kstat usage and then "bad" (after modunload and replacing lofi driver), no asserting:

Feb 13 13:34:10 sparc5 cmlb: [ID 107833 kern.warning] WARNING: /pseudo/lofi@1 (lofi1):
Feb 13 13:34:10 sparc5 Corrupt label; wrong magic number
Feb 13 13:34:37 sparc5 genunix: [ID 408114 kern.info] /pseudo/lofi@1 (lofi1) offline
Feb 13 13:36:29 sparc5 pseudo: [ID 129642 kern.info] pseudo-device: lofi0
Feb 13 13:36:29 sparc5 genunix: [ID 936769 kern.info] lofi0 is /pseudo/lofi@0
Feb 13 13:36:35 sparc5 pseudo: [ID 129642 kern.info] pseudo-device: lofi1
Feb 13 13:36:35 sparc5 genunix: [ID 936769 kern.info] lofi1 is /pseudo/lofi@1
Feb 13 13:36:35 sparc5 genunix: [ID 408114 kern.info] /pseudo/lofi@1 (lofi1) online
Feb 13 13:36:37 sparc5 cmlb: [ID 107833 kern.warning] WARNING: /pseudo/lofi@1 (lofi1):
Feb 13 13:36:37 sparc5 Corrupt label; wrong magic number

root@sparc5:~# uname -i

with DEBUG kernel, we get assertion with "bad" lofi just as expected:

DilOS (based on illumos) Version February 2016
sparc5 console login:
panic[cpu13]/thread=2a104ae1c80: kstat_q_exit: qlen == 0

000002a104ae17e0 unix:kstat_q_panic+8 (30071fb6770, 0, ffffffffffffffff, 19bac00, 0, 18b9bc0)
%l0-3: 000002a104ae1c80 000000000192a778 000003007924b3f0 0000000000000003
%l4-7: 0000000000000000 00000300652ac0e8 00000000ffff0000 0000000000000000
000002a104ae1890 lofi:lofi_strategy_task+4c (301008cbed8, 30065a69b98, dbabc50, 0, 320a500, 0)
%l0-3: 0000030083d66240 0000030083d66250 000a54132d52921e 0000000000000006
%l4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
000002a104ae19a0 genunix:taskq_thread+2dc (300831da8b0, 30065a69b98, fffeffff, 300831da8e2, 300831da8e0, 300831da8e4)
%l0-3: 00000300831da8d0 0000000000000001 0000000000000001 0000000000010000
%l4-7: 00000300831da8d8 00000300831da920 000002a104ae1a70 0000000000080000

panic: entering debugger (continue to save dump)

also here is the test result for non-debug kernel on sun4u:

igork: root@srv209:/# uname -a
[12:50pm] igork: SunOS srv209 5.11 sun4u sparc SUNW,Sun-Blade-2500

root@srv209:/# mkfile 1g /test
root@srv209:/# lofiadm -a /test
root@srv209:/# newfs /dev/rlofi/1
newfs: construct a new file system /dev/rlofi/1: (y/n)? y
/dev/rlofi/1: 2097000 sectors in 3495 cylinders of 1 tracks, 600 sectors
1023.9MB in 219 cyl groups (16 c/g, 4.69MB/g, 2240 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 9632, 19232, 28832, 38432, 48032, 57632, 67232, 76832, 86432,
2006432, 2016032, 2025632, 2035232, 2044832, 2054432, 2064032, 2073632,
2083232, 2092832
root@srv209:/# lofiadm
Block Device File Options
/dev/lofi/1 /test -

So the sun4u is also working ok, writing to lofi device with newfs does update kstat and therefore this code is all good.


  • 0
  • 0
  • 1
  • 1
Description From Last Updated
Richard Elling
Igor Kozhukhov
Hans Rosenfeld
Toomas Soome
Toomas Soome
Toomas Soome
Igor Kozhukhov
Toomas Soome
Hans Rosenfeld
Richard Elling
Rich Lowe
Toomas Soome
Review request changed

Status: Closed (submitted)