*BSD News Article 24476


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!gatech!udel!newsserv.cs.sunysb.edu!stark.UUCP!cs.sunysb.edu!newsserv!stark!gene
From: newsserv!stark!gene@cs.sunysb.edu (Gene Stark)
Newsgroups: comp.os.386bsd.bugs
Subject: "strip -x 386bsd" hangs over NFS (FIX)
Date: 27 Nov 93 17:56:14
Organization: Gene Stark's home system
Lines: 54
Distribution: world
Message-ID: <NEWSSERV!STARK!GENE.93Nov27175614@stark.uucp>
NNTP-Posting-Host: stark.uucp

I sent the following bug report to "FreeBSD-bugfiler@freefall.cdrom.com",
but am posting it here in case anyone wants it fast.

							- Gene Stark

------------------------------------------------------
Subject: strip -x 386bsd hangs over NFS
Index: sys/nfs/nfs_bio.c FreeBSD-1.0.2

Description:
	Running "strip -x 386bsd" (the last step in building a kernel)
	over NFS hangs in uninterruptible sleep.

Repeat-By:
	Copy an unstripped kernel to an NFS-mounted directory and
	run "strip -x" on it.

Fix:
	Apply the patch below to /sys/nfs/nfs_bio.c.  The problem is
	that vnode_pager_io sets up a uio structure with a null
	process pointer, and then nfs_write uses that pointer to
	check whether the file size resource limit is exceeded.
	If so, nfs_write returns EFBIG, which is ultimately voided
	by the call to vm_pager_put in vm_object_page_clean.
	The process thus hangs forever waiting for pageout to complete.
	The code for nfs_write was evidently cribbed from ufs_write
	in ufs_vnops.c.  The check for vp->v_type == VREG is actually
	already done earlier in nfs_write, but why not be a little
	defensive?  The problem evidently does not exist in isofs
	(no writing), or pcfs (done correctly).

*** /sys/nfs/nfs_bio.c	Wed Oct  6 07:06:20 1993
--- nfs_bio.c	Wed Nov 24 20:00:56 1993
***************
*** 244,250 ****
  	 * Maybe this should be above the vnode op call, but so long as
  	 * file servers have no limits, i don't think it matters
  	 */
! 	if (uio->uio_offset + uio->uio_resid >
  	      p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
  		psignal(p, SIGXFSZ);
  		return (EFBIG);
--- 244,251 ----
  	 * Maybe this should be above the vnode op call, but so long as
  	 * file servers have no limits, i don't think it matters
  	 */
! 	if (vp->v_type == VREG && p &&
! 	    uio->uio_offset + uio->uio_resid >
  	      p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
  		psignal(p, SIGXFSZ);
  		return (EFBIG);


--