From owner-cvs-src@FreeBSD.ORG Thu Jun 1 13:59:49 2006 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F62116A567; Thu, 1 Jun 2006 13:59:49 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3802943D46; Thu, 1 Jun 2006 13:59:49 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (Postfix) with ESMTP id A1D926E782; Thu, 1 Jun 2006 23:59:47 +1000 (EST) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k51DxgWk029061; Thu, 1 Jun 2006 23:59:45 +1000 Date: Thu, 1 Jun 2006 23:59:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Scott Long In-Reply-To: <447EBA65.9000103@samsco.org> Message-ID: <20060601232412.F34374@delplex.bde.org> References: <200605311315.k4VDFUhD093628@repoman.freebsd.org> <447EBA65.9000103@samsco.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Maxim Konovalov , cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/ufs/ufs ufs_vnops.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2006 13:59:49 -0000 On Thu, 1 Jun 2006, Scott Long wrote: > Maxim Konovalov wrote: > >> maxim 2006-05-31 13:15:29 UTC >> >> FreeBSD src repository >> >> Modified files: >> sys/ufs/ufs ufs_vnops.c Log: >> o According to POSIX, the result of ftruncate(2) is unspecified >> for file types other than VREG, VDIR and shared memory objects. >> We already handle VREG, VLNK and VDIR cases. Silently ignore >> truncate requests for all the rest. Adjust comments. > ... > If POSIX says that the result is undefined, wouldn't it be in our > best interests to return EBADF instead of 0? Or would that break > 3rd party software? POSIX says that the result is unspecified, not that it is undefined. truncate.2 has many bugs, but null changes to it are required to be (almost) consistent with this commit. This commit just makes the code agree with the documentation in one case. truncate.2 never documented that [f]truncate() panics on fifos. It tries to say that [f]truncate() always succeeds on fifos, but gets this wrong for truncate() on fifos (and device files...) residing on r/o file systems (unless we interpret fifos as not residing on file systems at all). It doesn't document that file systems cloned from ffs still panic for [f]truncate() on fifos, or the details of the panics; nor should it. See another reply for more details. Bruce