From owner-freebsd-fs@FreeBSD.ORG Mon May 17 10:18:24 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E844716A4CE for ; Mon, 17 May 2004 10:18:24 -0700 (PDT) Received: from corbulon.video-collage.com (corbulon.video-collage.com [64.35.99.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CE7C43D2D for ; Mon, 17 May 2004 10:18:24 -0700 (PDT) (envelope-from mi+mx@aldan.algebra.com) Received: from 250-217.customer.cloud9.net (195-11.customer.cloud9.net [168.100.195.11])i4HHIMxI095174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 May 2004 13:18:23 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from localhost (mteterin@localhost [127.0.0.1]) i4HHIF8k009241 for ; Mon, 17 May 2004 13:18:16 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) From: Mikhail Teterin Organization: Virtual Estates, Inc. To: freebsd-fs@freebsd.org Date: Mon, 17 May 2004 13:18:15 -0400 User-Agent: KMail/1.6.1 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200405171318.15200@misha-mx.virtual-estates.net> X-Scanned-By: MIMEDefang 2.39 Subject: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2004 17:18:25 -0000 The link at http://cr.yp.to/qmail/faq/reliability.html#filesystems claims, using SoftUpdates for mailqueue is dangerous. Is that still true? Thanks! -mi From owner-freebsd-fs@FreeBSD.ORG Mon May 17 10:49:35 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29A4016A4CE for ; Mon, 17 May 2004 10:49:35 -0700 (PDT) Received: from avgw.bjut.edu.cn (avgw.bjut.edu.cn [202.112.78.85]) by mx1.FreeBSD.org (Postfix) with SMTP id D7EC143D49 for ; Mon, 17 May 2004 10:49:33 -0700 (PDT) (envelope-from delphij@frontfree.net) Received: from beastie.frontfree.net ([218.107.145.7]) by avgw.bjut.edu.cn (SAVSMTP 3.1.5.43) with SMTP id M2004051801483107218 for ; Tue, 18 May 2004 01:48:31 +0800 Received: from localhost (localhost [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 9C8B611867; Tue, 18 May 2004 01:48:37 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00749-06; Tue, 18 May 2004 01:48:37 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 4EE0F11634; Tue, 18 May 2004 01:48:36 +0800 (CST) Date: Tue, 18 May 2004 01:48:36 +0800 From: Xin LI To: Mikhail Teterin Message-ID: <20040517174836.GA983@frontfree.net> References: <200405171318.15200@misha-mx.virtual-estates.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline In-Reply-To: <200405171318.15200@misha-mx.virtual-estates.net> User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.2-CURRENT FreeBSD 5.2-CURRENT #33: Mon Apr 26 15:10:21 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: by amavisd-new at frontfree.net cc: freebsd-fs@freebsd.org Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2004 17:49:35 -0000 --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 17, 2004 at 01:18:15PM -0400, Mikhail Teterin wrote: > The link at >=20 > http://cr.yp.to/qmail/faq/reliability.html#filesystems >=20 > claims, using SoftUpdates for mailqueue is dangerous. Is that still > true? Thanks! Yes, it is dangerous. Same is true for any journalling file systems, which essentially does the same thing: delayed write of data/metadata. Delayed write will make it possible for the Operating System to group several writes together and write them once, or at least, in a better order in order to improve performance. However, for the mail case, once it responds "250", then the remote peer is allowed to remove the message from its queue. If the system crashes, and the data was not written into disk, then your message is lost. Mounting your mailqueue slice with -noatime is a good idea, too. Please note that disabling SoftUpdates will drastically decrease write performance on that slice. Of course, if your system often encounter crash or power failure, it will be a good idea to disable it. Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --envbJBWh7q8WU6mo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAqPr0OfuToMruuMARAsqkAKCEOVLZKluaKhJS2c+LAssL5IbLkACcCvkt Xsois5bq9/IPn0RUrqUm5T4= =dbZD -----END PGP SIGNATURE----- --envbJBWh7q8WU6mo-- From owner-freebsd-fs@FreeBSD.ORG Mon May 17 10:56:17 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C6B6B16A4CE for ; Mon, 17 May 2004 10:56:17 -0700 (PDT) Received: from thebsh.namesys.com (thebsh.namesys.com [212.16.7.65]) by mx1.FreeBSD.org (Postfix) with SMTP id 809AA43D2F for ; Mon, 17 May 2004 10:56:16 -0700 (PDT) (envelope-from Nikita@Namesys.COM) Received: (qmail 24273 invoked from network); 17 May 2004 17:56:15 -0000 Received: from laputa.namesys.com (212.16.7.124) by thebsh.namesys.com with SMTP; 17 May 2004 17:56:15 -0000 Received: by laputa.namesys.com (Postfix on SuSE Linux 8.0 (i386), from userid 511) id 9942F12E68; Mon, 17 May 2004 21:56:09 +0400 (MSD) From: Nikita Danilov MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16552.64697.572176.262372@laputa.namesys.com> Date: Mon, 17 May 2004 21:56:09 +0400 To: Xin LI In-Reply-To: <20040517174836.GA983@frontfree.net> References: <200405171318.15200@misha-mx.virtual-estates.net> <20040517174836.GA983@frontfree.net> X-Mailer: VM 7.17 under 21.5 (patch 17) "chayote" (+CVS-20040321) XEmacs Lucid cc: freebsd-fs@freebsd.org cc: Mikhail Teterin Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2004 17:56:17 -0000 Xin LI writes: > On Mon, May 17, 2004 at 01:18:15PM -0400, Mikhail Teterin wrote: > > The link at > > > > http://cr.yp.to/qmail/faq/reliability.html#filesystems > > > > claims, using SoftUpdates for mailqueue is dangerous. Is that still > > true? Thanks! > > Yes, it is dangerous. Same is true for any journalling file systems, > which essentially does the same thing: delayed write of data/metadata. > > Delayed write will make it possible for the Operating System to group > several writes together and write them once, or at least, in a better > order in order to improve performance. However, for the mail case, once > it responds "250", then the remote peer is allowed to remove the message > from its queue. If the system crashes, and the data was not written into > disk, then your message is lost. Unless mail-server did fsync(2) which is guaranteed to return only after data reached stable storage. If file-system doesn't provide such guarantee it's broken, if mail server doesn't call fsync, or fdatasync---it is. Even without any journalling involved. Nikita. From owner-freebsd-fs@FreeBSD.ORG Mon May 17 13:21:32 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A348716A4CE for ; Mon, 17 May 2004 13:21:32 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3AE9843D2D for ; Mon, 17 May 2004 13:21:24 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc12) with ESMTP id <2004051720212101400es09pe>; Mon, 17 May 2004 20:21:23 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA28588; Mon, 17 May 2004 13:21:19 -0700 (PDT) Date: Mon, 17 May 2004 13:21:18 -0700 (PDT) From: Julian Elischer To: Mikhail Teterin In-Reply-To: <200405171318.15200@misha-mx.virtual-estates.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@freebsd.org Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2004 20:21:32 -0000 Assuming the appdoes an fsync() and the disks ar etelling the truth about the data being on the drive. then softupdates is no worse than FFS. The assumptions have to be checked though. On Mon, 17 May 2004, Mikhail Teterin wrote: > The link at > > http://cr.yp.to/qmail/faq/reliability.html#filesystems > > claims, using SoftUpdates for mailqueue is dangerous. Is that still > true? Thanks! > > -mi > > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > From owner-freebsd-fs@FreeBSD.ORG Mon May 17 13:25:17 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B060916A4CE for ; Mon, 17 May 2004 13:25:17 -0700 (PDT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14C2F43D31 for ; Mon, 17 May 2004 13:25:17 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc12) with ESMTP id <2004051720251001200kvlere>; Mon, 17 May 2004 20:25:16 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA28634; Mon, 17 May 2004 13:25:07 -0700 (PDT) Date: Mon, 17 May 2004 13:25:04 -0700 (PDT) From: Julian Elischer To: Xin LI In-Reply-To: <20040517174836.GA983@frontfree.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@freebsd.org cc: Mikhail Teterin Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2004 20:25:17 -0000 On Tue, 18 May 2004, Xin LI wrote: > On Mon, May 17, 2004 at 01:18:15PM -0400, Mikhail Teterin wrote: > > The link at > > > > http://cr.yp.to/qmail/faq/reliability.html#filesystems > > > > claims, using SoftUpdates for mailqueue is dangerous. Is that still > > true? Thanks! > > Yes, it is dangerous. Same is true for any journalling file systems, > which essentially does the same thing: delayed write of data/metadata. > > Delayed write will make it possible for the Operating System to group > several writes together and write them once, or at least, in a better > order in order to improve performance. However, for the mail case, once > it responds "250", then the remote peer is allowed to remove the message > from its queue. If the system crashes, and the data was not written into > disk, then your message is lost. > > Mounting your mailqueue slice with -noatime is a good idea, too. > > Please note that disabling SoftUpdates will drastically decrease write > performance on that slice. Of course, if your system often encounter > crash or power failure, it will be a good idea to disable it. Softupdates is NOT unsafe for this task IF the app does an fsync() before acknowldging the incoming mail. Fsync under Soft updates will not return until all data and metadata associated with the file has been written to disk. This will make the write as slow as a sync munted filesystem, but all other writes on the disk will proceeed at soft-updates speed. > > Cheers, > -- > Xin LI http://www.delphij.net/ > See complete headers for GPG key and other information. > > From owner-freebsd-fs@FreeBSD.ORG Mon May 17 19:14:45 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2AFC716A4CE for ; Mon, 17 May 2004 19:14:45 -0700 (PDT) Received: from avgw.bjut.edu.cn (avgw.bjut.edu.cn [202.112.78.85]) by mx1.FreeBSD.org (Postfix) with SMTP id 2832C43D53 for ; Mon, 17 May 2004 19:14:44 -0700 (PDT) (envelope-from delphij@frontfree.net) Received: from beastie.frontfree.net ([218.107.145.7]) by avgw.bjut.edu.cn (SAVSMTP 3.1.5.43) with SMTP id M2004051810143415064 for ; Tue, 18 May 2004 10:14:34 +0800 Received: from localhost (localhost [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 9208C11B2B; Tue, 18 May 2004 10:14:35 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00866-03; Tue, 18 May 2004 10:14:35 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 1267011C01; Tue, 18 May 2004 10:14:34 +0800 (CST) Date: Tue, 18 May 2004 10:14:33 +0800 From: Xin LI To: Julian Elischer Message-ID: <20040518021433.GA969@frontfree.net> References: <20040517174836.GA983@frontfree.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.2-CURRENT FreeBSD 5.2-CURRENT #33: Mon Apr 26 15:10:21 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: by amavisd-new at frontfree.net cc: freebsd-fs@freebsd.org cc: Mikhail Teterin Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 02:14:45 -0000 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 17, 2004 at 01:25:04PM -0700, Julian Elischer wrote: [...] > Softupdates is NOT unsafe for this task IF the app does an fsync() > before acknowldging the incoming mail. Fsync under Soft updates will not > return until all data and metadata associated with the file > has been written to disk. This will make the write as slow as a sync=20 > munted filesystem, but all other writes on the disk will proceeed at=20 > soft-updates speed. Oh... I missed this point, sorry. Your statement is more accurate, thanks for pointing this out :-) I think it should be noted that on ATA drives, the hardware writing cache (without an acknowledge back to the operating system when the data is actually written to the disk, like on a tagged queue enabled SCSI disk), is enabled by default. This will greatly disturb SoftUpdates' work and may lead to data loss even when the application is correctly doing fsync(), because with ATA hardware writing cache, the disk will "cheat" the opearting system - Before the data actually goes to disk, it tells that it is, and data is lost if crash occours here. Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --OXfL5xGRrasGEqWY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAqXGJOfuToMruuMARAmBRAKCBpWLq9SP/t+Lsot9Qs/ROEoTR+ACfWYC7 pO2JHcyfttpmHzlBSGTx1VU= =b0g2 -----END PGP SIGNATURE----- --OXfL5xGRrasGEqWY-- From owner-freebsd-fs@FreeBSD.ORG Mon May 17 19:26:09 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E08216A4CE for ; Mon, 17 May 2004 19:26:09 -0700 (PDT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B39843D48 for ; Mon, 17 May 2004 19:26:09 -0700 (PDT) (envelope-from garycor@comcast.net) Received: from comcast.net (pcp09118143pcs.union01.nj.comcast.net[69.142.234.88]) by comcast.net (sccrmhc11) with SMTP id <20040518022607011000pvpte> (Authid: garycor); Tue, 18 May 2004 02:26:08 +0000 Message-ID: <40A974DA.30704@comcast.net> Date: Mon, 17 May 2004 22:28:42 -0400 From: Gary Corcoran User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Xin LI References: <20040517174836.GA983@frontfree.net> <20040518021433.GA969@frontfree.net> In-Reply-To: <20040518021433.GA969@frontfree.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-fs@freebsd.org cc: Mikhail Teterin cc: Julian Elischer Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 02:26:09 -0000 Xin LI wrote: > On Mon, May 17, 2004 at 01:25:04PM -0700, Julian Elischer wrote: > [...] > >>Softupdates is NOT unsafe for this task IF the app does an fsync() >>before acknowldging the incoming mail. Fsync under Soft updates will not >>return until all data and metadata associated with the file >>has been written to disk. This will make the write as slow as a sync >>munted filesystem, but all other writes on the disk will proceeed at >>soft-updates speed. > > > Oh... I missed this point, sorry. Your statement is more accurate, thanks > for pointing this out :-) > > I think it should be noted that on ATA drives, the hardware writing > cache (without an acknowledge back to the operating system when the data > is actually written to the disk, like on a tagged queue enabled SCSI > disk), is enabled by default. This will greatly disturb SoftUpdates' > work and may lead to data loss even when the application is correctly > doing fsync(), because with ATA hardware writing cache, the disk will > "cheat" the opearting system - Before the data actually goes to disk, > it tells that it is, and data is lost if crash occours here. ^^^^^ Umm - shouldn't it be only if *power loss* occurs here? Even if the OS crashes, as long as power is supplied to the drive, its firmware should finish writing the data from its cache to the disk media, no? And therefore, as long as one has a stable power source, e.g. running off a UPS, there really isn't any great risk from on-drive write caches, is there? Gary From owner-freebsd-fs@FreeBSD.ORG Mon May 17 19:41:53 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A2B516A4CE for ; Mon, 17 May 2004 19:41:53 -0700 (PDT) Received: from avgw.bjut.edu.cn (avgw.bjut.edu.cn [202.112.78.85]) by mx1.FreeBSD.org (Postfix) with SMTP id 7C63E43D4C for ; Mon, 17 May 2004 19:41:52 -0700 (PDT) (envelope-from delphij@frontfree.net) Received: from beastie.frontfree.net ([218.107.145.7]) by avgw.bjut.edu.cn (SAVSMTP 3.1.5.43) with SMTP id M2004051810403415597 for ; Tue, 18 May 2004 10:40:34 +0800 Received: from localhost (localhost [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 36E5F116FC; Tue, 18 May 2004 10:40:22 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00083-05; Tue, 18 May 2004 10:40:21 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 918D01156F; Tue, 18 May 2004 10:40:20 +0800 (CST) Date: Tue, 18 May 2004 10:40:20 +0800 From: Xin LI To: Gary Corcoran Message-ID: <20040518024020.GA631@frontfree.net> References: <20040517174836.GA983@frontfree.net> <20040518021433.GA969@frontfree.net> <40A974DA.30704@comcast.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <40A974DA.30704@comcast.net> User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.2-CURRENT FreeBSD 5.2-CURRENT #33: Mon Apr 26 15:10:21 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: by amavisd-new at frontfree.net cc: freebsd-fs@freebsd.org cc: Mikhail Teterin cc: Julian Elischer Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 02:41:53 -0000 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 17, 2004 at 10:28:42PM -0400, Gary Corcoran wrote: > Xin LI wrote: [snip] > >doing fsync(), because with ATA hardware writing cache, the disk will > >"cheat" the opearting system - Before the data actually goes to disk, > >it tells that it is, and data is lost if crash occours here. > ^^^^^ > Umm - shouldn't it be only if *power loss* occurs here? > Even if the OS crashes, as long as power is supplied to the drive, > its firmware should finish writing the data from its cache to the > disk media, no? And therefore, as long as one has a stable power > source, e.g. running off a UPS, there really isn't any great risk > from on-drive write caches, is there? I don't think so. Personally I think it is still danger if a crash occours. Soft Updates rolls back buffers when necessary to guarantee the on-disk state is in a "recoverable consistency". With a drive cheating the operating system and reorder operating system write operations, there is a potential risk that, when operating system "thinks" that "this order is good and won't cause any problem", the disk "thinks" that "that order is better and I write in that order", and an "unexpected SoftUpdates inconsistency" occours. This is very likely to cause data loss, or even more worse problem because there might be wild pointers in i-nodes, or used blocks that are not marked "used" in the cylgroup bitmap. Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAqXeUOfuToMruuMARAjgqAJ90DK7u2CEeRi8ji3hGwWiOGR1XHQCfbaXk iLWHLLhAuaz4Rn5ja0IByYA= =o3IG -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb-- From owner-freebsd-fs@FreeBSD.ORG Mon May 17 21:28:42 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4029816A4CE for ; Mon, 17 May 2004 21:28:42 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABF5243D2F for ; Mon, 17 May 2004 21:28:40 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9p2/8.12.9) with ESMTP id i4I4SH7E019389; Mon, 17 May 2004 21:28:21 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200405180428.i4I4SH7E019389@gw.catspoiler.org> Date: Mon, 17 May 2004 21:28:17 -0700 (PDT) From: Don Lewis To: Nikita@Namesys.COM In-Reply-To: <16552.64697.572176.262372@laputa.namesys.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: freebsd-fs@FreeBSD.org cc: mi+mx@aldan.algebra.com Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 04:28:42 -0000 On 17 May, Nikita Danilov wrote: > Xin LI writes: > > On Mon, May 17, 2004 at 01:18:15PM -0400, Mikhail Teterin wrote: > > > The link at > > > > > > http://cr.yp.to/qmail/faq/reliability.html#filesystems > > > > > > claims, using SoftUpdates for mailqueue is dangerous. Is that still > > > true? Thanks! > > > > Yes, it is dangerous. Same is true for any journalling file systems, > > which essentially does the same thing: delayed write of data/metadata. > > > > Delayed write will make it possible for the Operating System to group > > several writes together and write them once, or at least, in a better > > order in order to improve performance. However, for the mail case, once > > it responds "250", then the remote peer is allowed to remove the message > > from its queue. If the system crashes, and the data was not written into > > disk, then your message is lost. > > Unless mail-server did fsync(2) which is guaranteed to return only after > data reached stable storage. If file-system doesn't provide such > guarantee it's broken, if mail server doesn't call fsync, or > fdatasync---it is. Even without any journalling involved. Based on the information I found using Google, it appears that qmail relies on link(2) being synchronous to let it know that a queued message is safely on the disk with a known file name before it issues the "250" response. I believe this was true without softupdates, but with softupdates enabled it is definitely not true. From owner-freebsd-fs@FreeBSD.ORG Tue May 18 03:13:40 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8572A16A4CE; Tue, 18 May 2004 03:13:40 -0700 (PDT) Received: from VARK.homeunix.com (adsl-68-122-7-9.dsl.pltn13.pacbell.net [68.122.7.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C41943D99; Tue, 18 May 2004 03:13:23 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.10/8.12.10) with ESMTP id i4IACaAd007680; Tue, 18 May 2004 03:12:36 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.10/8.12.10/Submit) id i4IACaYb007679; Tue, 18 May 2004 03:12:36 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 18 May 2004 03:12:36 -0700 From: David Schultz To: Don Lewis Message-ID: <20040518101236.GB7186@VARK.homeunix.com> Mail-Followup-To: Don Lewis , Nikita@Namesys.COM, freebsd-fs@FreeBSD.ORG, mi+mx@aldan.algebra.com References: <16552.64697.572176.262372@laputa.namesys.com> <200405180428.i4I4SH7E019389@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200405180428.i4I4SH7E019389@gw.catspoiler.org> cc: freebsd-fs@FreeBSD.ORG cc: Nikita@Namesys.COM cc: mi+mx@aldan.algebra.com Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 10:13:40 -0000 On Mon, May 17, 2004, Don Lewis wrote: > Based on the information I found using Google, it appears that qmail > relies on link(2) being synchronous to let it know that a queued message > is safely on the disk with a known file name before it issues the "250" > response. I believe this was true without softupdates, but with > softupdates enabled it is definitely not true. If this is true, it's a boog in qmail[1]. The link(2) syscall guarantees atomicity, but not durability. This is why fsync(2) exists. [1] I would call it a ``bug'', but then I would be uttering one of the magic phrases to invoke djb in a public forum. From owner-freebsd-fs@FreeBSD.ORG Tue May 18 08:05:48 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1033716A4CE; Tue, 18 May 2004 08:05:48 -0700 (PDT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9322743D8A; Tue, 18 May 2004 08:05:14 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc13) with ESMTP id <2004051815051301600nudhne>; Tue, 18 May 2004 15:05:13 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id IAA40000; Tue, 18 May 2004 08:05:08 -0700 (PDT) Date: Tue, 18 May 2004 08:05:03 -0700 (PDT) From: Julian Elischer To: Don Lewis In-Reply-To: <200405180428.i4I4SH7E019389@gw.catspoiler.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@FreeBSD.org cc: Nikita@Namesys.COM cc: mi+mx@aldan.algebra.com Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 15:05:48 -0000 On Mon, 17 May 2004, Don Lewis wrote: > On 17 May, Nikita Danilov wrote: > > Xin LI writes: > > > On Mon, May 17, 2004 at 01:18:15PM -0400, Mikhail Teterin wrote: > > > > The link at > > > > > > > > http://cr.yp.to/qmail/faq/reliability.html#filesystems > > > > > > > > claims, using SoftUpdates for mailqueue is dangerous. Is that still > > > > true? Thanks! > > > > > > Yes, it is dangerous. Same is true for any journalling file systems, > > > which essentially does the same thing: delayed write of data/metadata. > > > > > > Delayed write will make it possible for the Operating System to group > > > several writes together and write them once, or at least, in a better > > > order in order to improve performance. However, for the mail case, once > > > it responds "250", then the remote peer is allowed to remove the message > > > from its queue. If the system crashes, and the data was not written into > > > disk, then your message is lost. > > > > Unless mail-server did fsync(2) which is guaranteed to return only after > > data reached stable storage. If file-system doesn't provide such > > guarantee it's broken, if mail server doesn't call fsync, or > > fdatasync---it is. Even without any journalling involved. > > Based on the information I found using Google, it appears that qmail > relies on link(2) being synchronous to let it know that a queued message > is safely on the disk with a known file name before it issues the "250" > response. I believe this was true without softupdates, but with > softupdates enabled it is definitely not true. > An fsync will sync ALL directory entries pointing to the file > > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > From owner-freebsd-fs@FreeBSD.ORG Tue May 18 17:11:15 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89DDF16A4D0 for ; Tue, 18 May 2004 17:11:15 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F1DC43D2D for ; Tue, 18 May 2004 17:11:15 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9p2/8.12.9) with ESMTP id i4IN8L7E021763; Tue, 18 May 2004 16:08:26 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200405182308.i4IN8L7E021763@gw.catspoiler.org> Date: Tue, 18 May 2004 16:08:21 -0700 (PDT) From: Don Lewis To: julian@elischer.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: freebsd-fs@FreeBSD.org cc: Nikita@Namesys.COM cc: mi+mx@aldan.algebra.com Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 00:11:15 -0000 On 18 May, Julian Elischer wrote: > > > On Mon, 17 May 2004, Don Lewis wrote: > >> On 17 May, Nikita Danilov wrote: >> > Xin LI writes: >> > > On Mon, May 17, 2004 at 01:18:15PM -0400, Mikhail Teterin wrote: >> > > > The link at >> > > > >> > > > http://cr.yp.to/qmail/faq/reliability.html#filesystems >> > > > >> > > > claims, using SoftUpdates for mailqueue is dangerous. Is that still >> > > > true? Thanks! >> > > >> > > Yes, it is dangerous. Same is true for any journalling file systems, >> > > which essentially does the same thing: delayed write of data/metadata. >> > > >> > > Delayed write will make it possible for the Operating System to group >> > > several writes together and write them once, or at least, in a better >> > > order in order to improve performance. However, for the mail case, once >> > > it responds "250", then the remote peer is allowed to remove the message >> > > from its queue. If the system crashes, and the data was not written into >> > > disk, then your message is lost. >> > >> > Unless mail-server did fsync(2) which is guaranteed to return only after >> > data reached stable storage. If file-system doesn't provide such >> > guarantee it's broken, if mail server doesn't call fsync, or >> > fdatasync---it is. Even without any journalling involved. >> >> Based on the information I found using Google, it appears that qmail >> relies on link(2) being synchronous to let it know that a queued message >> is safely on the disk with a known file name before it issues the "250" >> response. I believe this was true without softupdates, but with >> softupdates enabled it is definitely not true. >> > > An fsync will sync ALL directory entries pointing to the file I haven't looked at how qmail works, but my suspicion is that it fsync()s the file and then creates a link (and probably unlinks the old name) to mark the queue file as valid and is not partially written. I think this would work with softupdates if the file were fsync()ed again after the link() call. I won't comment about why this change is unlikely to make it into the code. From owner-freebsd-fs@FreeBSD.ORG Tue May 18 17:25:26 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02F6016A4CF; Tue, 18 May 2004 17:25:26 -0700 (PDT) Received: from corbulon.video-collage.com (corbulon.video-collage.com [64.35.99.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7357F43D31; Tue, 18 May 2004 17:25:25 -0700 (PDT) (envelope-from mi+mx@aldan.algebra.com) Received: from 250-217.customer.cloud9.net (195-11.customer.cloud9.net [168.100.195.11])i4INW7B5013448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 May 2004 19:32:08 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from localhost (mteterin@localhost [127.0.0.1]) i4INW0b5016870; Tue, 18 May 2004 19:32:00 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) From: Mikhail Teterin Organization: Virtual Estates, Inc. To: freebsd-fs@FreeBSD.org, Julian Elischer , Don Lewis , Nikita@Namesys.COM Date: Tue, 18 May 2004 19:31:59 -0400 User-Agent: KMail/1.6.1 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: 7bit Message-Id: <200405181931.59373@misha-mx.virtual-estates.net> X-Scanned-By: MIMEDefang 2.39 cc: lioux@FreeBSD.org Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 00:25:26 -0000 =On Tue, 18 May 2004, Don Lewis wrote: = => On 18 May, Julian Elischer wrote: => > => > =[...] = => > => > An fsync will sync ALL directory entries pointing to the file => => I haven't looked at how qmail works, but my suspicion is that it => fsync()s the file and then creates a link (and probably unlinks => the old name) to mark the queue file as valid and is not partially => written. I think this would work with softupdates if the file were => fsync()ed again after the link() call. I won't comment about why this => change is unlikely to make it into the code. = =a single fsync AFTER the link but before acking the mail would be =sufficient. Should the mail/qmail port do that? -mi From owner-freebsd-fs@FreeBSD.ORG Tue May 18 17:26:44 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D56616A4CE; Tue, 18 May 2004 17:26:44 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF48C43D31; Tue, 18 May 2004 17:26:41 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc11) with ESMTP id <2004051823190001300blrh8e>; Tue, 18 May 2004 23:19:02 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA44636; Tue, 18 May 2004 16:18:59 -0700 (PDT) Date: Tue, 18 May 2004 16:18:57 -0700 (PDT) From: Julian Elischer To: Don Lewis In-Reply-To: <200405182308.i4IN8L7E021763@gw.catspoiler.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@FreeBSD.org cc: Nikita@Namesys.COM cc: mi+mx@aldan.algebra.com Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 00:26:44 -0000 On Tue, 18 May 2004, Don Lewis wrote: > On 18 May, Julian Elischer wrote: > > > > [...] > > > > An fsync will sync ALL directory entries pointing to the file > > I haven't looked at how qmail works, but my suspicion is that it > fsync()s the file and then creates a link (and probably unlinks the old > name) to mark the queue file as valid and is not partially written. I > think this would work with softupdates if the file were fsync()ed again > after the link() call. I won't comment about why this change is > unlikely to make it into the code. a single fsync AFTER the link but before acking the mail would be sufficient. From owner-freebsd-fs@FreeBSD.ORG Tue May 18 18:10:11 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C791B16A4CE; Tue, 18 May 2004 18:10:11 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD99F43D3F; Tue, 18 May 2004 18:10:11 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc11) with ESMTP id <2004051901095801300a4c55e>; Wed, 19 May 2004 01:09:58 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id SAA46345; Tue, 18 May 2004 18:09:58 -0700 (PDT) Date: Tue, 18 May 2004 18:09:58 -0700 (PDT) From: Julian Elischer To: Mikhail Teterin In-Reply-To: <200405181931.59373@misha-mx.virtual-estates.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@FreeBSD.org cc: Nikita@Namesys.COM cc: Don Lewis cc: lioux@FreeBSD.org Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 01:10:11 -0000 On Tue, 18 May 2004, Mikhail Teterin wrote: > =On Tue, 18 May 2004, Don Lewis wrote: > = > => On 18 May, Julian Elischer wrote: > => > > => > > =[...] > = > => > > => > An fsync will sync ALL directory entries pointing to the file > => > => I haven't looked at how qmail works, but my suspicion is that it > => fsync()s the file and then creates a link (and probably unlinks > => the old name) to mark the queue file as valid and is not partially > => written. I think this would work with softupdates if the file were > => fsync()ed again after the link() call. I won't comment about why this > => change is unlikely to make it into the code. > = > =a single fsync AFTER the link but before acking the mail would be > =sufficient. > > Should the mail/qmail port do that? it certainly could... > > -mi > > From owner-freebsd-fs@FreeBSD.ORG Tue May 18 18:14:28 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6521816A4CE; Tue, 18 May 2004 18:14:28 -0700 (PDT) Received: from qn-82-217-200-212.quicknet.nl (qn-82-217-200-212.quicknet.nl [82.217.200.212]) by mx1.FreeBSD.org (Postfix) with SMTP id 8E9FB43D45; Tue, 18 May 2004 18:14:09 -0700 (PDT) (envelope-from FaulkMyra@interpira.com.br) Date: Tue, 18 May 2004 21:14:06 -0500 From: Kramer-Monroe To: freebsd-fs@freebsd.org Message-id: Content-Transfer-Encoding: 7Bit MIME-Version: 1.0 Content-Type: text/plain; charset="ascii-us" X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Anderson X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 01:14:28 -0000 Freebsd-fs carlyle meaty bifocal dare chose gainesville ellipsis conformal amphibian exile internal Email is Loading . . . . [1][bestgpad.jpg] Content not Showi'ng? [2] No Prescri.ption Require.d, Orde.r Her.e robotics warlike couldn't tansy densitometer suntanned bitch huston stayed yarrow barlow erbium infect astute calfskin essence levine burlington auk cutback leper alumina bohr vertical arrogant option billiken plump ultimatum renoir frowzy abram hookup sterling tarnish systematic afghan countenance tad scoot chosen sex fiesta leachate dichondra gemlike valhalla rockford literacy chose duly tyrosine counterexample shrew watertown chide sonora mixup fanatic sic borrow nolan dauphine colossal arithmetic expositor execrate magdalene clatter fling progenitor labyrinth coffeepot marguerite covet cleave circumstance spear appendices autumnal enigma ernest sci optimist cambridge clairvoyant workforce toxicology amanita chamomile ergative leash moonlit sheathe vestige curricula cannibal triple bryan mastermind burglar lengthy rosetta delmarva dung senile adept cormorant eternity buses front wistful sane attack contingent intestine elm earthenware gould schott ky minuteman stampede breadboard handwrite adhere celibacy baptiste voodoo benefice conclusive cash sanctimonious key prove yourself doubleheader occasion sigmund apology shakedown antipodes damnation calgary account bestirring cambric discrepant pave ace calligraphy sparge amarillo confederacy crystallite formatted constitution accidental chute stucco willowy accordant germ grubby discriminatory contextual prefab marquette avocado substitution herringbone blare tigris vow damascus dod bagley rupee sanatorium spat epiphyseal alex campaign illicit cremate aversion chalk huggins persuade deferring honey computation solace michele climate genitive frill circa thousandfold catholic riddance coffer susanne assassin beefsteak abater historian mclaughlin respiration braille del diocesan steeve persuasive inanimate davis christmas surgeon caveat crowfoot albacore buffalo archenemy lois catch tissue dhabi mandarin terrier invariable osha adolph evanescent saleslady magisterial mezzan ine n nigh reverberate cuisine shapiro venal gedanken system demurred buick inequivalent blockade totemic excoriate thicket bugaboo maladroit pulse coconut fizzle alexandria cauldron liturgy angelo koinonia billings ncar robot convoke belies lutz roth crumble carleton transcribe kitchenette canon voluminous emblem glassy perpetrate assess impetuous languid hawk transference onslaught betroth tribune madcap mynah besotted capital thereabouts static lilac corset alveoli incontrollable blastula blaze References 1. http://www.dsdsmed.com/gp/default.asp?id=SBL 2. http://www.asmwn1.com/gp/default.asp?id=SBL From owner-freebsd-fs@FreeBSD.ORG Thu May 20 13:16:24 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA1B616A4CE for ; Thu, 20 May 2004 13:16:24 -0700 (PDT) Received: from corbulon.video-collage.com (corbulon.video-collage.com [64.35.99.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60A0543D4C for ; Thu, 20 May 2004 13:16:24 -0700 (PDT) (envelope-from mi+mx@aldan.algebra.com) Received: from 250-217.customer.cloud9.net (195-11.customer.cloud9.net [168.100.195.11])i4KKGFQF082709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 20 May 2004 16:16:16 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from localhost (mteterin@localhost [127.0.0.1]) i4KKFqov028658; Thu, 20 May 2004 16:15:55 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) From: Mikhail Teterin Organization: Virtual Estates, Inc. To: Steve Byan Date: Thu, 20 May 2004 16:15:51 -0400 User-Agent: KMail/1.6.1 References: <20040517174836.GA983@frontfree.net> <40A974DA.30704@comcast.net> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: 7bit Message-Id: <200405201615.51539@misha-mx.virtual-estates.net> X-Scanned-By: MIMEDefang 2.39 cc: freebsd-fs@freebsd.org cc: Julian Elischer Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2004 20:16:25 -0000 => Even if the OS crashes, as long as power is supplied to the drive, => its firmware should finish writing the data from its cache to the => disk media, no? And therefore, as long as one has a stable power => source, e.g. running off a UPS, there really isn't any great risk => from on-drive write caches, is there? = =No. Unlike SCSI disks, ATA disks will toss their write-cache on a =reset. When the system crashes and the BIOS starts rebooting, guess =what it issues to the ATA disks? Yep, a reset. So with ATA write-cache =enabled, your filesystem is likely to be toast after a crash, as well =as after a power failure. Is not this only of concern if the power is restored and the BIOS resets the disks _before_ they flush their write caches? I'd expect them to do that (the flushing) within seconds anyway, no? -mi From owner-freebsd-fs@FreeBSD.ORG Fri May 21 01:24:03 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B68016A4CE for ; Fri, 21 May 2004 01:24:03 -0700 (PDT) Received: from fatcity.com (rrcs-west-66-27-56-211.biz.rr.com [66.27.56.211]) by mx1.FreeBSD.org (Postfix) with SMTP id EA64743D1D for ; Fri, 21 May 2004 01:24:02 -0700 (PDT) (envelope-from listguru@fatcity.com) Received: by fatcity.com (wcMail) id 10746W Fri, 21 May 2004 01:19:05 -0700 From: listguru@fatcity.com Date: Fri, 21 May 2004 01:19:01 -0700 Message-Id: <1085127541@fatcity.com> Organization: Fat City Hosting, San Diego, California, USA To: freebsd-fs@freebsd.org X-Mailer: wcMail v5.4.449.1 Subject: Response to your ListGuru session [MsgId AA20040521.011901.1] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2004 08:24:03 -0000 -- >>>> Your file is attached. Unrecognized command -- skipping. Use HELP for assistance. From owner-freebsd-fs@FreeBSD.ORG Fri May 21 09:09:16 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 414B216A4CE for ; Fri, 21 May 2004 09:09:16 -0700 (PDT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3F0843D1D for ; Fri, 21 May 2004 09:09:15 -0700 (PDT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 36EE9ACBD6; Fri, 21 May 2004 18:09:14 +0200 (CEST) Date: Fri, 21 May 2004 18:09:14 +0200 From: Pawel Jakub Dawidek To: "David E. Cross" Message-ID: <20040521160914.GE845@darkness.comp.waw.pl> References: <1084556769.2304.20.camel@kiki.cs.rpi.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7FBusMY41sbWuT4E" Content-Disposition: inline In-Reply-To: <1084556769.2304.20.camel@kiki.cs.rpi.edu> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: freebsd-fs@freebsd.org cc: moorthy@cs.rpi.edu cc: wronkm@cs.rpi.edu Subject: Re: Journalled UFS X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2004 16:09:16 -0000 --7FBusMY41sbWuT4E Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 14, 2004 at 01:46:11PM -0400, David E. Cross wrote: +> Ok... It was brought to my attention that someone was asking for this +> again, so I figure its time to put out an update on the status. Great to hear! +> Here's what I want to do: +>=20 +> VOP/VFS entry point { +> Aquire Mutex with RECURSION; mtx_lock(your_mtx); +> If first aquire, inc transaction ID; else don't; if (!mtx_recursed(your_mtx)) /* Inc transaction ID. */; +> NORMAL VOP/VFS Dispatch; +>=20 +> Release Mutex; recursed =3D mtx_recursed(your_mtx); mtx_unlock(your_mtx); +> if last release && syn_journal Checkpoint_Routine; if (!recursed && syn_journal) Checkpoint_Routine; +> } +> Checkpoint_Routine { +> Aquire mutex with RECURSION: +> if first aquire, last_tid=3DTID; +> else last_tid=3DTID-1; +>=20 +> Dump_to last_tid; +>=20 +> Release mutex; +> } +>=20 +> I am not sure how to check if we already have a mutex, and if its +> recursion or not vs. the mutex is already aquired but its not "ours". +> suggestions? I'm not sure why you want to check if mutex is already acquired. You don't want to sleep? You can use mtx_trylock(9) or mtx_owned(9) maybe. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --7FBusMY41sbWuT4E Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFArimqForvXbEpPzQRAiGwAKCuE22rNNWQmv3S43rnZhqz29D/bACeNxZq 0MfLIX0WnoZY/bO4/YaLlG4= =CrIJ -----END PGP SIGNATURE----- --7FBusMY41sbWuT4E-- From owner-freebsd-fs@FreeBSD.ORG Fri May 21 09:53:53 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ABE2116A4EA for ; Fri, 21 May 2004 09:53:53 -0700 (PDT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 59F3643D1F for ; Fri, 21 May 2004 09:53:53 -0700 (PDT) (envelope-from garycor@comcast.net) Received: from comcast.net (pcp09118143pcs.union01.nj.comcast.net[69.142.234.88]) by comcast.net (sccrmhc11) with SMTP id <2004052116534001100qms84e> (Authid: garycor); Fri, 21 May 2004 16:53:41 +0000 Message-ID: <40AE34DA.6060804@comcast.net> Date: Fri, 21 May 2004 12:56:58 -0400 From: Gary Corcoran User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Steve Byan References: <20040517174836.GA983@frontfree.net> <40A974DA.30704@comcast.net> <200405201615.51539@misha-mx.virtual-estates.net> <7CE7075D-AB35-11D8-B0BF-000A957CD5B0@egenera.com> In-Reply-To: <7CE7075D-AB35-11D8-B0BF-000A957CD5B0@egenera.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-fs@freebsd.org cc: Mikhail Teterin cc: Julian Elischer Subject: Re: QMail and SoftUpdates X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2004 16:53:53 -0000 Steve Byan wrote: >> => Even if the OS crashes, as long as power is supplied to the drive, >> => its firmware should finish writing the data from its cache to the >> => disk media, no? And therefore, as long as one has a stable power >> => source, e.g. running off a UPS, there really isn't any great risk >> => from on-drive write caches, is there? >> = >> =No. Unlike SCSI disks, ATA disks will toss their write-cache on a >> =reset. When the system crashes and the BIOS starts rebooting, guess >> =what it issues to the ATA disks? Yep, a reset. > > I checked with my BIOS source, and I got this wrong. After a crash, the > BIOS is usually entered as a result of the crash-code (panic(), in the > case of *BSD) invoking a hard reset by writing to the reset bit of I/O > port 92. This causes a reset of the hardware, which includes the PCI bus > and the ATA disks as well as the CPU. I haven't crashed a FreeBSD box in quite a while :), but isn't there a 15 second (or more?) delay, after a panic, before the FreeBSD code auto-reboots (i.e. restarts the BIOS)? In which case I would expect the on-disk caches to have been flushed to the media before the BIOS gets control and resets things... >> So with ATA write-cache >> =enabled, your filesystem is likely to be toast after a crash, as well >> =as after a power failure. >> >> Is not this only of concern if the power is restored and the BIOS resets >> the disks _before_ they flush their write caches? I'd expect them to do >> that (the flushing) within seconds anyway, no? > > > I'm confused by your reference to the restoration of power in your > question. If you lose power to the whole system, then it's game over. > Are you suggesting that the disks might be powered separately from the > CPU and motherboard, and that the CPU might lose power and then regain > it while the disks are still powered? I don't know of any systems that > are designed that way. > > The primary case I was discussing was the case where the system has > power, but the OS crashes. Yes, if the disks manage to win the race by > flushing their write cache before the hard reset is issued by the crash > code, then everything is fine. However, the disks don't know that the > system is crashing; in general there's no flush command issued to the > disks. (I haven't looked at FreeBSD source, but comments on this list > made a few years back lead me to believe that panic() doesn't issue > flush cache commands to ATA disks.) I think the panic code quite soon > after getting control, and the disks flush their write cache rather > lazily, rather than eagerly. So if the ATA disks are getting a lot of > write traffic, it's likely that you will lose the race, and there will > be data in the write cache that has not made it to the media at the time > that the disk is reset.