From owner-freebsd-hackers Tue Dec 4 23:10:58 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from gw.gbch.net (gw.gbch.net [203.143.238.93]) by hub.freebsd.org (Postfix) with SMTP id C42F237B41A for ; Tue, 4 Dec 2001 23:10:51 -0800 (PST) Received: (qmail 88132 invoked by uid 1001); 5 Dec 2001 17:10:49 +1000 X-Posted-By: GJB-Post 2.23 27-Nov-2001 X-Operating-System: FreeBSD 4.2-RELEASE i386 X-Uptime: 1 day, 1:19 X-Location: Brisbane, Australia; 27.49841S 152.98439E X-URL: http://www.gbch.net/gjb.html X-Image-URL: http://www.gbch.net/gjb/gjb-auug048.gif X-GPG-Fingerprint: EBB2 2A92 A79D 1533 AC00 3C46 5D83 B6FB 4B04 B7D6 X-PGP-Public-Keys: http://www.gbch.net/keys.html Message-Id: Date: Wed, 05 Dec 2001 17:10:49 +1000 From: Greg Black To: cjclark@alum.mit.edu Cc: Matthew Dillon , Ian Dowse , Bernd Walter , Mark Hannon , bugs-followup@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: bin/32261: dump creates a dump file much larger than sum of dumped files References: <200112041339.aa05506@salmon.maths.tcd.ie> <200112041957.fB4Jv1j20226@apollo.backplane.com> <20011204225814.E40864@blossom.cjclark.org> In-reply-to: <20011204225814.E40864@blossom.cjclark.org> of Tue, 04 Dec 2001 22:58:14 PST Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Crist J . Clark" wrote: | On Wed, Dec 05, 2001 at 06:02:49AM +1000, Greg Black wrote: | > Matthew Dillon wrote: | > | > | :In message <20011204135626.A75212@cicely8.cicely.de>, Bernd Walter writes: | > | :>> Is there any reason we don't want to truncate the file? Does O_TRUNC | > | :>> not work well of the file is a tape device or something? | > | :> | > | :>I don't expect O_TRUNK to work on devices such tapes and disks. | > | : | > | :Well, it won't achieve anything on tapes or disk devices, but it | > | :should be completely harmless to add the O_TRUNC flag. The current | > | :behaviour is likely to be unexpected and cause confusion so it | > | :might as well be changed. I'll commit this later unless someone | > | :can think of a good reason not to. | > | : | > | :Ian | > | | > | Woa! That sounds like a bad idea to me. If you want to do it right | > | then open(), fstat(), and only if the stat says it is a regular file | > | do you then ftruncate(). Passing O_TRUNC to a tape device may be ignored | > | by us, but it's not a valid flag to pass to a tape device and we shouldn't | > | do it. | > | > I haven't used any of them for a while, but there are certainly | > Unix systems that treat O_TRUNC as a signal to rewind a tape | > device before writing to it. | | So? Who cares? This is FreeBSD's dump(8) and FreeBSD's write(2). There | is no reason to worry about portability of FreeBSD's dump(8) in how | write(2) flags work. If our write(2) "does the right thing" with | O_TRUNC and tape devices, there is no reason not to let it do the | right thing on its own. That's a rather strange attitude. All I was suggesting that, from the once-respected POLA, it would be less surprising to people who might have experience of other systems if FreeBSD did not make its own arrangements without some good reason. There's no need for responses like: "So? Who cares?" -- if there's some reason not to consider other people, by all means explain it; but be polite while you're at it. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message