O_XATTR support in FreeBSD?
Edward Tomasz Napierała
trasz at FreeBSD.org
Sun Nov 24 01:28:41 UTC 2013
Wiadomość napisana przez Rick Macklem <rmacklem at uoguelph.ca> w dniu 23 lis 2013, o godz. 23:53:
> Pedro Giffuni wrote:
>> On 23.11.2013 02:13, Cedric Blancher wrote:
>>> On 22 November 2013 20:55, Pedro Giffuni <pfg at freebsd.org> wrote:
>>>> Well ...
>>>>
>>>> According to:
>>>>
>>>> https://wiki.freebsd.org/ZFS
>>>>
>>>> We do support Extended Attributes on ZFS but they differ from the
>>>> ones in
>>>> Solaris (and Linux).
>>> Well, we need the one specified in the NFSv4 standard. The Linux
>>> extended attributes are pretty much useless because they are size
>>> restricted (typical attribute size here is in the GB range, and for
>>> example NIH and CERN have even much bigger sizes), can't be
>>> accessed
>>> like normal files and are incompatible to Window's Alternate
>>> Streams.
>>>
>>> Ced
>>
>> I was unaware of a standard for EA beyond the old posix draft.
>> The reason for Extended Attributes is supporting ACL and we support
>> both
>> the draft posix and the NFS/win style ACLs.
>>
> Interestingly, FreeBSD has a VOP_OPENEXTATTR() but no syscall
> that uses it nor support for it in ZFS. (I'm just guessing it
> was intended for an openat(2) syscall at some time?)
Hm, interesting. It looks kind of unused (MAC uses it to implement
mac_vnode_create_extattr() and mac_vnode_setlabel_extattr()). Robert (Cc-ed),
perhaps you know what’s the story here?
% grep -R openextattr *
fs/unionfs/union.h:#define UNIONFS_OPENEXTL 0x01 /* openextattr (lower) */
fs/unionfs/union.h:#define UNIONFS_OPENEXTU 0x02 /* openextattr (upper) */
fs/unionfs/union_vnops.c:unionfs_openextattr(struct vop_openextattr_args *ap)
fs/unionfs/union_vnops.c: .vop_openextattr = unionfs_openextattr,
kern/vnode_if.src:%% openextattr vp L L L
kern/vnode_if.src:vop_openextattr {
ufs/ffs/ffs_vnops.c:static vop_openextattr_t ffs_openextattr;
ufs/ffs/ffs_vnops.c: .vop_openextattr = ffs_openextattr,
ufs/ffs/ffs_vnops.c: .vop_openextattr = ffs_openextattr,
ufs/ffs/ffs_vnops.c:ffs_openextattr(struct vop_openextattr_args *ap)
ufs/ffs/ffs_vnops.c:struct vop_openextattr_args {
% grep -R VOP_OPENEXTATTR *
fs/unionfs/union_vnops.c: error = VOP_OPENEXTATTR(tvp, ap->a_cred, ap->a_td);
fs/unionfs/union_vnops.c: VOP_OPENEXTATTR(lvp, cred, td)) {
fs/unionfs/union_vnops.c: panic("unionfs: VOP_OPENEXTATTR failed");
fs/unionfs/union_vnops.c: if ((error = VOP_OPENEXTATTR(uvp, cred, td)) != 0)
fs/unionfs/union_vnops.c: VOP_OPENEXTATTR(lvp, cred, td)) {
fs/unionfs/union_vnops.c: panic("unionfs: VOP_OPENEXTATTR failed");
fs/unionfs/union_vnops.c: if ((error = VOP_OPENEXTATTR(uvp, cred, td)) != 0)
security/mac/mac_vfs.c: error = VOP_OPENEXTATTR(vp, cred, curthread);
security/mac/mac_vfs.c: error = VOP_OPENEXTATTR(vp, cred, curthread);
Anyway - extended attributes _are_ supported on ZFS; see extattr(2) for API.
More information about the freebsd-hackers
mailing list