Subject: kern/1309: [dM] nullfs & maybe others break mmap()
To: None <>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: netbsd-bugs
Date: 08/02/1995 17:56:49
>Number:         1309
>Category:       kern
>Synopsis:       [dM] nullfs & maybe others break mmap()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug  2 18:05:02 1995
>Originator:     der Mouse
>Release:        -current as of a couple of weeks ago
	SPARC IPC, but it doesn't matter
	The mechanisms (such as vnode_pager_setsize()) to keep the VM
	subsystem in sync with the filesystem do not work in the
	presence of nullfs.  This is because the ufs/ffs code is making
	all the correct callbacks into the VM subsystem, but it's
	making them with the underneath-nullfs vnodes, and the VM
	subsystem is using the nullfs-wrapped vnodes, so the VM
	subsystem ignores the calls and gets out of sync.

	The potential exists for similar things to happen with any
	filesystem layer that passes operations on to some other piece
	of code - it must make the VM subsystem callbacks itself, with
	the correct vnodes.
	See recent discussion on tech-kern.  Briefly:
	# mount -t null /some/path /foo
	# cd /foo
	# sh -c 'while :; do echo foo; sleep 1; done' > file &
	# tail -f file > /dev/null &
	...wait a few seconds...
	# vi file
	...notice the ^@s at the end of the file, between where EOF was
	when tail started and where EOF is now...

	More convincingly, turn on the VDB_SIZE bit in vpagerdebug, do
	the above, and notice the complete lack of _any_ reports of
	calls to vnode_pager_setsize ('cause they're all made with
	vnodes to which no pagers are attached).
	(1) Don't use nullfs :-(
	(2) Fix nullfs :-)

					der Mouse