Subject: Pine 3.91 + Check Quotas + Digital Unix

From: [email-masked] (Tim O'Connor)
Date: 20 Dec 1995 05:37:45 GMT

We are running Pine 3.91, compiled to check quotas, and compiled
separately on our Ultrix and OSF/1 (Digital Unix) systems.  (That is, 
we recompiled it separately for Digital Unix rather than use DEC's tool 
to mutate an Ultrix binary into an OSF/1 binary.) 

Pine is configured (in pine.conf.fixed) to automatically move read mail
from the /usr/spool/mail/USERNAME file to the user's "saved-messages"
folder when the user exits.

When we first deployed the 3.91 release, we tested how it behaved under
an out-of-space condition in the user's $HOME/mail directory.  As
expected, we found that it did not remove the mail from the INBOX when
the user had insufficient space on the device that held the 
"saved-messages" folder.  That is, the "check quota" mechanism worked
perfectly.

Since that initial series of tests, however, we have migrated a couple
of our systems from Ultrix to Digital Unix, with $HOME directories
living on DEC's advfs partitions rather than ufs.  We have found that 
Pine does not appear to properly check the disk quota when the user's 
home directory is in an advfs (Digital's Advanced Filesystem) 
partition.  The results appear to be as follows:

	* quit Pine, and attempt to move read mail to "saved-messages"
	* check quota on $HOME/mail device, but (apparently) ignore 
	  the results
	* delete mail from INBOX
	* try to write to "saved-messages"
	* if user is at or above quota on $HOME/mail device, vaporize 
	  mail

Has anyone seen this in action?  Is there some additional information I 
could provide that would make this report more clear?  I see the
following in pine/osdep:

	diskquot      diskquot.hpp  diskquot.ptx  diskquot.sun
	diskquot.a32  diskquot.non  diskquot.sgi  diskquot.sv4

None appears to be relevant to Digital's advfs, though.  Or is there
some other approach we might take?

Happy holidays from snowy New York, with all thanks in advance!

--tim o'connor

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Tim O'Connor                                           [email-masked]
NYU Academic Computing Facility                   Phone: (212) 998-3024
System & Network Security Manager                   Fax: (212) 995-4120
251 Mercer St., New York, NY 10012

---

From: Mark Crispin <[email-masked]>
Date: Wed, 20 Dec 1995 15:50:11 -0800

Hello.

We believe that this problem is fixed in Pine 3.92.

For the technically inclined:

This problem occurs only on UNIX variants that return "partial success"
from write() and writev() when a disk-full or quota-exceeded error is
encountered.  Digital Unix (OSF/1) and many System V systems are such
variants.

The mailbox writing code was written on (and originally ported to) UNIX
variants (BSD) that guarantee that write() and writev() would only return
partial success "when using non-blocking I/O on objects...that are subject
to flow control", and in particular return an ENOSPC or EDQUOT error for
disk-full or quota-exceeded conditions and leave the file pointer
unchanged.

The first System V port was done by someone who did not catch the
difference in write() semantics, and thus we weren't aware of the problem
until last May.  Thus, the fix did not make it into Pine 3.91, which had
been released half a year earlier.

The fix is that all write() and writev() calls are coerced through an
emulator (safe_write() and safe_writev()) which ensures the BSD semantics
of "win" or "lose" with no "win but it hurts"...  ;-)

-- Mark --

DoD #0105, R90/6 pilot, FAX: (206) 685-4045  ICBM: N 47 39'35" W 122 18'39"
Science does not emerge from voting, party politics, or public debate.