From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 9 15:56:28 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB820567; Tue, 9 Sep 2014 15:56:28 +0000 (UTC) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [IPv6:2607:f8b0:400e:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9508DECF; Tue, 9 Sep 2014 15:56:28 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id rd3so5059385pab.4 for ; Tue, 09 Sep 2014 08:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qVtU8Ca+xSFDyivJicV3KGFNCqGRa0d/xVJnGEi439E=; b=k81QnHN7Gq4IttilII5/9FTMDemg5RWw5y8A6Ep2e4dEI++U5G321Lzr4OeT0SFB+N o45pCsQoNEhIW1amINKbM9oSq79a7q3PkUbSaqCYejv1srnRWVODHnuaLIyQ8OtYgvCx SXYRWBYbfunLSGU73oVbdEs29/LGivQg37nTQCXixqgAAWGA0Q/jS+OvsFYNWBEQ9EhE ztd94WRRi15IND+LNIl4gebrGtB+rRURA3W+D+nCqwJkFwZ+CVcC3H16PbKHKCmkK61T L7kilGk8b1c+ot5sgUmbNHpQUsY6nKiX5SnL9+greqTTQVq3JBQYOLA9eaTjMggbGokd oftg== MIME-Version: 1.0 X-Received: by 10.69.26.134 with SMTP id iy6mr31834927pbd.115.1410278188241; Tue, 09 Sep 2014 08:56:28 -0700 (PDT) Received: by 10.66.82.37 with HTTP; Tue, 9 Sep 2014 08:56:28 -0700 (PDT) In-Reply-To: <14246348.Ehh2xp5iLB@ralph.baldwin.cx> References: <14246348.Ehh2xp5iLB@ralph.baldwin.cx> Date: Tue, 9 Sep 2014 17:56:28 +0200 Message-ID: Subject: Re: O_XATTR support in FreeBSD? From: Simon Toedt To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: Rick Macklem , Cedric Blancher , freebsd-hackers@freebsd.org, Richard Yao , Pedro Giffuni , Lionel Cons , Jordan Hubbard X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2014 15:56:29 -0000 On Mon, Sep 8, 2014 at 5:52 PM, John Baldwin wrote: > On Friday, September 05, 2014 04:24:02 PM Lionel Cons wrote: >> On 1 December 2013 23:05, Lionel Cons wrote: >> > On 27 November 2013 05:52, Tim Kientzle wrote: >> >> On Nov 26, 2013, at 1:51 AM, Cedric Blancher > wrote: >> >>> 5. Support for tar and pax is already there. Its described in >> >>> Solaris's fsattr man page, they use a extended header with filename >> >>> /dev/null (to prevent older tar versions from tripping over the new >> >>> headers) and then have a named attribute header which describes the >> >>> attributes names and flags. >> >> >> >> There are quite a few alternative approaches for storing >> >> extended attributes in tar and pax files. >> > >> > But this discussion is *not* about extended attributes, this >> > discussion is about Alternate Data Streams. Unfortunately the O_XATTR >> > discussion somehow started to cover the Linux "extended attribute >> > system", which is utterly useless in the intended use cases (as said, >> > no access through normal POSIX read(), write(), mmap(), no unlimited >> > size, no sparse data support (aka SEEK_HOLE, SEEK_DATA) etc etc). >> > >> > Lionel >> >> What is the status of O_XATTR (alias alternate data stream support) in >> FreeBSD? We run more and more into the trouble that these kind of >> streams are in use but cannot be accessed or processed on FreeBSD. > > I don't think anyone is even looking at it. I didn't quite follow the > earlier mail about this and some concrete examples probably would help. > Can you do 'open("/path/to/foo@forkname", O_XATTR)' to open the "forkname" > fork of the "/path/to/foo" file? No. You open a file (use O_NONBLOCK to prevent trouble with fifos) and use openat(filefd, "attrname", O_XATTR, ...) Filename "." returns you a fd to the virtual directory of the attr resources, which you can use to fchdir() or otherwise use as normal directory. mkdir(), mkfifo() and mknod() aren't allowed in such a directory. > > -- > John Baldwin > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" Simon