From owner-freebsd-hackers@freebsd.org Sun Jan 10 17:46:26 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F236FA691BE for ; Sun, 10 Jan 2016 17:46:26 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B965D1952 for ; Sun, 10 Jan 2016 17:46:26 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 10 Jan 2016 17:45:07 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id u0AHkJxp008075; Sun, 10 Jan 2016 10:46:19 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452447979.1523.11.camel@freebsd.org> Subject: Re: Attribute order in storing and retreiving extended attributes From: Ian Lepore To: Willem Jan Withagen , freebsd-hackers@freebsd.org Date: Sun, 10 Jan 2016 10:46:19 -0700 In-Reply-To: <56928D06.4050500@digiware.nl> References: <56928D06.4050500@digiware.nl> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 17:46:27 -0000 On Sun, 2016-01-10 at 17:55 +0100, Willem Jan Withagen wrote: > Hi, > > I'm looking into why a snippet of Ceph testcode sometimes retuns > error, > and other times does complete oke. > > It seems that under Linux the way order of attributes is always > consistent in the same order. > > Where as on FreeBSD it can happen that even with the same sequence of > extattr_set_* will give a different order in the extattr_list_fd > output. > And because the outputbuffer is compared with memcmp an error is > detected. > > Easy to verify with lsextattr, which also gives a different order. > > When things go oke the order is: > # lsextattr user chain_xattr_listxatrr > chain_xattr_listxatrr, size: 512 > user.1111111111111111111111111111111111111111111111111111111111111111 > 111 > 11111111111111111111111111111111111111111111111111111111@1 > user.1111111111111111111111111111111111111111111111111111111111111111 > 111 > 11111111111111111111111111111111111111111111111111111111 > user.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ > @@@ > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ > @@@ > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ > @@@ > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ > > When thing go wrong, the order is: > # lsextattr user chain_xattr_listxatrr > chain_xattr_listxatrr, size: 512 > user.1111111111111111111111111111111111111111111111111111111111111111 > 111 > 11111111111111111111111111111111111111111111111111111111 > user.1111111111111111111111111111111111111111111111111111111111111111 > 111 > 11111111111111111111111111111111111111111111111111111111@1 > user.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ > @@@ > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ > @@@ > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ > @@@ > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ > > This is on a ZFS filesystem. > Is there any particular reason why these is not deterministic? > I do not have a testbox with UFS available, so it is hard to verify > that > it occurs there too. > > Would this be easy to make more deterministic? > Could you just pipe the lsextattr output through sort to make it deterministic? -- Ian