Infinite loop with d_write_t

From: Goran Mekić <meka_at_tilda.center>
Date: Sun, 19 Mar 2023 11:14:04 UTC
Hello,

I'm trying to assemble a minimal kernel module and user space program as
a skeleton, and no matter what I do I get infinite loop. The code for
kernel is https://github.com/mekanix/freebsd-project/blob/master/kernel/main.c.
The way to test:
# make
# sudo kldload ./hello.ko
# echo "something" >/dev/hello
Write done.
Write done.
...

What am I doing wrong and where does that infinite loop comes from?

Regards,
meka