From owner-freebsd-fs@FreeBSD.ORG Tue Jan 18 18:06:22 2011 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0A24106566C for ; Tue, 18 Jan 2011 18:06:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 449658FC08 for ; Tue, 18 Jan 2011 18:06:21 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0II6JBi018272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Jan 2011 05:06:20 +1100 Date: Wed, 19 Jan 2011 05:06:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20110118161637.GS2518@deviant.kiev.zoral.com.ua> Message-ID: <20110119045713.N2631@besplex.bde.org> References: <20110118041447.GA2087@tops.skynet.lt> <20110118234350.R1077@besplex.bde.org> <20110118161637.GS2518@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: fs@freebsd.org Subject: Re: Inconsistency and bug with *chflags functions X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 18:06:22 -0000 On Tue, 18 Jan 2011, Kostik Belousov wrote: > On Wed, Jan 19, 2011 at 01:18:08AM +1100, Bruce Evans wrote: >> The downcast in the call to setfflags() is safe, but the type puns given >> by the wrong types in syscalls.master are not. I think the big-endian >> 64-bit long case is the only case seriously broken by these puns, but >> FreeBSD doesn't notice since it doesn't support any big-endian 64-bit >> arches. > Just a note, do you consider sparc64/mips64/powerpc64 unsupported ? No. I forget that sparc64 is big-endian so this has been tested for long enough to find any bugs, and didn't worry about the others since they are relatively new. In fact, there seems to be no problem with unsigned long fflags on 64-bit bit-endian either, since the least significant bits end up in the top bits of each arg in the args struct no matter how syscalls.master (mis)declares them. Little-endian is of course exactly the opposite. Bruce