Date: Tue, 6 Feb 2001 11:20:39 -0800 (PST) From: Matt Dillon <dillon@earth.backplane.com> To: Mike Silbersack <silby@silby.com> Cc: Andre Oppermann <oppermann@monzoon.net>, Poul-Henning Kamp <phk@critter.freebsd.dk>, Charles Randall <crandall@matchlogic.com>, Dan Phoenix <dphoenix@bravenet.com>, Alfred Perlstein <bright@wintelcom.net>, Jos Backus <josb@cncdsl.com>, <freebsd-hackers@FreeBSD.ORG> Subject: Re: soft updates and qmail (RE: qmail IO problems) Message-ID: <200102061920.f16JKdN64467@earth.backplane.com> References: <Pine.BSF.4.31.0102061305430.15212-100000@achilles.silby.com>
next in thread | previous in thread | raw e-mail | index | archive | help
:On Tue, 6 Feb 2001, Matt Dillon wrote: : :> I did a quick search of the qmail site but couldn't find an email :> address to report the FAQ issue to. If QMail calls fsync() in a :> reasonable manner, then softupdates is perfectly safe and the QMail :> FAQ needs to be updated to recommend softupdates rather then :> disrecommend it. :> :> -Matt : :The question still reamins about link/unlink/rename. Is a fsync of the :directory necessary to ensure that they completed properly? As they take :filenames instead of fds, an fsync after the operation seems :non-intuitive. The rename manpage seems to imply that the operation is :synchronous - the other two are ambiguous. : :Mike "Silby" Silbersack If you rename a file and then fsync() the file's descriptor, you will guarentee the directory structure. Same with link. If you you unlink a file and still have an open descriptor you can fsync() the descriptor to guarentee the directory unlink. It might be a good idea to ftruncate() the file to 0-length in addition to unlinking it, prior to calling fsync(), to avoid unnecessary data block writes. I've never tried fsync()ing a directory descriptor so I don't know if that would work or not. No other filesystem makes guarentees for these operations either. Not even normal UFS mounts. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102061920.f16JKdN64467>