Re: tail -f is broken in recent CURRENT ( afd5bc630930 Sunday Jul 6 )

From: David Wolfskill <david_at_catwhisker.org>
Date: Mon, 07 Jul 2025 13:32:02 UTC
On Mon, Jul 07, 2025 at 03:51:00PM +0300, Konstantin Belousov wrote:
> ...
> Try this
> 
> diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
> index 3ed469bdce6d..2c6947103c94 100644
> --- a/sys/sys/vnode.h
> +++ b/sys/sys/vnode.h
> @@ -1032,7 +1032,7 @@ void	vop_rename_fail(struct vop_rename_args *ap);
>  #define VOP_WRITE_POST(ap, ret)						\
>  	noffset = (ap)->a_uio->uio_offset;				\
>  	if (noffset > ooffset) {					\
> -		if (VN_KNLIST_EMPTY((ap)->a_vp)) {			\
> +		if (!VN_KNLIST_EMPTY((ap)->a_vp)) {			\
>  			VFS_KNOTE_LOCKED((ap)->a_vp, NOTE_WRITE |	\
>  			    (noffset > osize ? NOTE_EXTEND : 0));	\
>  		}							\
> 

OK; did that, to sources as of main-n278527-07948e050808, then rebuilt
the kernel.

Seems to have done the job: this is a dedicated "build machine," so I
had a small challenge finding a suitable reproduction, but I saw that
/var/log/cron was getting updated every 5 minutes from atrun, so after
having booted:

freebeast(15.0-C)[5] uname -aUK
FreeBSD freebeast.catwhisker.org 15.0-CURRENT FreeBSD 15.0-CURRENT #264 main-n278527-07948e050808-dirty: Mon Jul  7 13:14:31 UTC 2025     root@freebeast.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/GENERIC amd64 1500051 1500051

I then:

freebeast(15.0-C)[5] sudo tail -F /var/log/cron

and after waiting a few minutes, I was gratified to see:

Jul  7 06:30:00 freebeast /usr/sbin/cron[2415]: (root) CMD (/usr/libexec/atrun)

show up.  Seems to be working. :-)

Thanks, Konstantin -- and Oleg! :-)

Peace,
david
-- 
David H. Wolfskill                              david@catwhisker.org
"The whole idea of reciprocal tariffs is if someone's punching me in the
face, I'm going to punch myself in the face." -- Warwick McKibbin

See https://www.catwhisker.org/~david/publickey.gpg for my public key.