From owner-freebsd-hackers@freebsd.org Sun Jan 10 18:08:02 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 4707AA69A8B for ; Sun, 10 Jan 2016 18:08:02 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (unknown [IPv6:2001:4cb8:90:ffff::3]) (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 0929B1A83; Sun, 10 Jan 2016 18:08:01 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from rack1.digiware.nl (unknown [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id D95A91534E8; Sun, 10 Jan 2016 19:07:58 +0100 (CET) X-Virus-Scanned: amavisd-new at digiware.nl Received: from smtp.digiware.nl ([127.0.0.1]) by rack1.digiware.nl (rack1.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nbGrJ4bUZgiZ; Sun, 10 Jan 2016 19:07:32 +0100 (CET) Received: from [192.168.10.10] (asus [192.168.10.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 206AC153416; Sun, 10 Jan 2016 19:07:32 +0100 (CET) Subject: Re: Attribute order in storing and retreiving extended attributes To: Ian Lepore , freebsd-hackers@freebsd.org References: <56928D06.4050500@digiware.nl> <1452447979.1523.11.camel@freebsd.org> From: Willem Jan Withagen Message-ID: <56929DE6.4040308@digiware.nl> Date: Sun, 10 Jan 2016 19:07:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1452447979.1523.11.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 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 18:08:02 -0000 On 10-1-2016 18:46, Ian Lepore wrote: > 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? Hi Ian, I'm just using lsextattr as a means of showing what is going on. In the Ceph code there is the expectancy that the attributes are returned in the same order the attributes are inserted. So for the time being I disabled the test, and perhaps I'm going to rewrite it into explicit test for the inserted attributes. --WjW