[8701] in Athena Bugs

home help back first fref pref prev next nref lref last post

Re: [daemon@ATHENA.MIT.EDU : vax 7.3P: afs and movemail]

daemon@ATHENA.MIT.EDU (Bill Sommerfeld)
Mon Dec 2 18:59:11 1991

Date: Mon, 2 Dec 91 18:49:30 EST
From: sommerfeld@apollo.com (Bill Sommerfeld)
To: ckclark@Athena.MIT.EDU
Cc: bugs@Athena.MIT.EDU, dkk@Athena.MIT.EDU, mar@Athena.MIT.EDU,
In-Reply-To: [8684]

From auditing this patch, it appears that one thing you should add is
a call to fsync() before the call to close().

fsync() "should" guarantee that all of the file pages, the inode, and
the directory containing it are all written all the way to disk
wherever the file's "home" is; this is a stronger guarantee than
"close()" (which merely assures that there are disk pages reserved for
the file).  In theory (if everything is working right), this should
eliminate any chance of lost mail, regardless of the order in which
people trip over the power cords of the file server, workstation, and
post office.

Adding something along the lines of:

	if (fsync(mbfi) < 0) {
	    error("Error in fsync: %s", get_errmsg());
	    return(1);
	}

immediately before the call to close(mbfi) should fix this.

				- Bill Sommerfeld '88
                                  Athena Alumnus.

home help back first fref pref prev next nref lref last post