Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jan 1998 13:50:21 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-current@FreeBSD.ORG, pb@fasterix.freenix.org
Subject:   Re: funny ETXTBSY problem
Message-ID:  <199801070250.NAA20779@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>$ cp /bin/sh /tmp
>$ echo echo hello there | /tmp/sh
>hello there
>$ cp /bin/sh /tmp
>cp: /tmp/sh: Text file busy
>
>I noticed this after applying the patches John Dyson committed
>today but that's apparently not where the problem comes from, as
>this works with yesterday's kernel too... I can't say if it
>works with a kernel older than last 20 December.

It was broken by the Dec 28 vm/vnode changes.  The VTEXT flag was
cleared in vnode_object_deallocate() and vnode_pager_dealloc(), but
the changes stopped the vnode's object being from being deallocated
when the last references to the vnode went away, so it didn't go away
until the object cache thrashed enough.  I reported this to John,
so it should be fixed now.

Hmmm, it wasn't quite right before either.  A reference not related
to exec keeps the VTEXT flag set after the exec image is no longer
in use:

	# od /usr/bin/gdb | more
	^Z
	# gdb </dev/null
	# rm /usr/bin/gdb
	override r-xr-xr-x  bin/bin for /usr/bin/gdb?

I saw this running lmbench.  lmbench copies a program to /tmp and
attempts to remove it using plain rm (no -f) after running it.
Interactive rm's considered harmful.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801070250.NAA20779>