Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Nov 2013 13:27:45 +0100
From:      Lionel Cons <lionelcons1972@gmail.com>
To:        Freebsd hackers list <freebsd-hackers@freebsd.org>
Cc:        Richard Yao <ryao@gentoo.org>, Jordan Hubbard <jordan.hubbard@gmail.com>, Pedro Giffuni <pfg@freebsd.org>, Cedric Blancher <cedric.blancher@gmail.com>, Rick Macklem <rmacklem@uoguelph.ca>
Subject:   Alternate Data Stream Support in FreeBSD (was Re: O_XATTR support in FreeBSD?)
Message-ID:  <CAPJSo4XFNxZLPG=uvZkCdhOX08Wt_JqNCAOV-Eg58pw0U%2BsavQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
On 26 November 2013 11:19, Jordan Hubbard <jordan.hubbard@gmail.com> wrote:
>
> On Nov 26, 2013, at 1:51 AM, Cedric Blancher <cedric.blancher@gmail.com> =
wrote:
>
>> 1. You do not need more syscalls. Solaris uses the plain openat()
>> syscall for this, with the O_XATTR flag passed to the normal
>> open()/openat() flags to open a named attribute. Likewise read(),
>> write(), mmap() etc work, too.
>
> I don=92t know if I=92d go so far as to say =93you do not need more sysca=
lls=94;
> there are additional functions for manipulating EAs that go well beyond
> the Solaris extensions to the directory and file I/O functions.  Assuming=
 you
> want to be able to get/set as well as enumerate or remove EAs, then
> you might just as well add getxattr(2), listxattr(2), removexattr(2), set=
xattr(2)
> too and follow the herd (Linux and OS X, so far).

You mean 'follow the lemmings down into the abyss'? :)

> We=92re also glossing over ACLs and where they get to live.  I don=92t kn=
ow if Robert
> and friends have stuck them in a separate namespace on FreeBSD or if they=
=92re
> in system-protected EAs, as they are in OS X, but ACL preservation across
> serialization / deserialization is just as important as it is for EAs.

Could we first agree what we are talking about, please? I'm a bit new
to this thread, but AFAIK we are talking about the Windows Alternate
Data Streams as they appear in networked filesystem like NFSv4 and
CIFS and physical filesystems like NTFS, ZFS and Solaris UFS, right?
ACLs have no direct relation to those streams.

The attributes support from Linux has been proven (at least from CERNs
viewpoint) as pretty useless because of their size constrains and
crappy API (i.e. no mmap(), no sparse support, no normal tools can
access them, ...) so IMHO the herd to follow is the herd which
implements at least the following requirements:
1) A proper implementation, which includes access using the normal
system utilities (in Solaris there is the runat(1) utility to access
the hidden directory containing the attribute files, and bash4.3 and
ksh have cd -@ to cwd into the hidden directories containing the
attribute files. From that point on (inside the hidden directory)
ls(1) and even chown(1) and chmod(1) work as usual. You can even stick
ZFS and NFSv4 ACLs on the files in the hidden directory containing the
attribute files)
2) read(), write() and mmap() access, i.e. the normal POSIX API (of
course with the minor extension to flag an access to an alternate data
stream or the directory containing the alternate data streams)
2) Support in networked filesystems (i.e. NFSv4, CIFS)
3) No size restrictions (just to explain, at CERN the alternate data
streams are often precompiled caches or index files of the main file's
contents, and can easily in the TB range)
4) Support for sparse data (i.e. SEEK_HOLE and SEEK_DATA)
5) More than one implementation available

AFAIK Solaris, Nexenta, Illumos (NFSv4, ZFS, UFS) and Windows
Alternate Data Streams (CIFS, NTFS) fit these requirements.

Lionel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPJSo4XFNxZLPG=uvZkCdhOX08Wt_JqNCAOV-Eg58pw0U%2BsavQ>