🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.mh
Article #1900

Re: inc loses mail when file system full (FIX)

#1900
From: Steve Dempsey
Date: Sat, 27 May 1989 20:15
94 lines
2936 bytes

I posted some weeks ago about my problem with inc on a full file system.
I've since determined that the real problem is with a less than perfect
implementation of NFS.  It seems that a full file system is not caught
until a buffer is flushed or the file is closed.  Here is my solution.

        
        Steve Dempsey,  Center for Computer Assisted Engineering
  Colorado State University, Fort Collins, CO  80523    +1 303 491 0630
INET: steved@longs.LANCE.ColoState.Edu, dempsey@handel.CS.ColoState.Edu
UUCP: boulder!ccncsu!longs.LANCE.ColoState.Edu!steved, ...!ncar!handel!dempsey

-----------------------------------------------------------------------------

MH-Version: 6.6

mh-6.6/conf/MH:
    bin	/usr/new/mh
    debug	off
    bboards	off
    etc	/usr/new/lib/mh
    mail	/usr/spool/mail
    mandir	/usr/man
    manuals	new
    chown	/etc/chown
    mts	sendmail/smtp
    options	BSD42 BSD43 BERK TTYD DUMB
    options	MHE NETWORK BIND RPATHS ATZ
    options	SBACKUP='"\\043"'
    options DPOP MHRC RPOP OVERHEAD WHATNOW SENDMTS SMTP POP BPOP
    ldoptions -ns -O
    ccoptions -O -20
    mf	off
    pop	on
    popbboards	off

System: VAX780,VAX730,MtXinu 4.3BSD;  VAX3600,VS2000,Ultrix2.2,Ultrix3.0
        (at least :-)

Index: mh-6.6/uip/inc.c

Descripton:
	Inc may fail to detect a full file system, proceed to create empty
	messages, and delete the messages from the mail drop.  This occurs
	primarily on NFS mounted folders.

Repeat-By:
	Place home directory, or MH-Path on an NFS mounted file system.
	Fill the file system to capacity.  Run inc.

Fix:
	Check for error on file close.  Also check the file size before
	and after the close.


*** inc.c.orig	Sat May 27 12:59:12 1989
--- inc.c	Sat May 27 13:03:48 1989
***************
*** 562,568
  			    noisy);
  	    }
  	    else {
! 		(void) fclose (pf);
  		free (cp);
  	    }
  

--- 562,586 -----
  			    noisy);
  	    }
  	    else {
! 
! 		int beforesize;
! 		struct stat pfsb;
! 
! 		if (fstat(fileno(pf),&pfsb))
! 		    adios(cp,"pre_fstat on");
! 
! 		beforesize=pfsb.st_size;
! 
! 		if (fclose (pf) == EOF) {
! 		    adios (cp, "close error on");
! 		}
! 
! 		if (stat(cp,&pfsb))
! 		    adios(cp,"post_stat on");
! 
! 		if (beforesize != pfsb.st_size)
! 		    adios(cp,"file size changed after close on");
! 
  		free (cp);
  	    }
  
Technical Details
Message-ID: <1959@ccncsu.ColoState.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!rochester!uhura.cc.rochester.edu!sunybcs!boulder!ccncsu!longs.LANCE.ColoState.Edu!steved

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!rochester!uhura.cc.rochester.edu!sunybcs!boulder!ccncsu!longs.LANCE.ColoState.Edu!steved
From: steved@longs.LANCE.ColoState.Edu (Steve Dempsey)
Newsgroups: comp.mail.mh
Subject: Re: inc loses mail when file system full (FIX)
Keywords: inc NFS patch
Message-ID: <1959@ccncsu.ColoState.EDU>
Date: 27 May 89 20:15:49 GMT
Sender: news@ccncsu.ColoState.EDU
Followup-To: comp.mail.mh
Organization: Colorado State University, Fort Collins, CO  80523
Lines: 94