[Gluster-devel] Need help from FreeBSD developers

Kaushal M kshlmster at gmail.com
Fri Jun 24 08:13:47 UTC 2016


On Fri, Jun 24, 2016 at 1:39 PM, Kaushal M <kshlmster at gmail.com> wrote:
> On Fri, Jun 24, 2016 at 1:00 PM, Pranith Kumar Karampuri
> <pkarampu at redhat.com> wrote:
>> hi,
>>     Based on the debugging done by Niels on the bug
>> https://bugzilla.redhat.com/show_bug.cgi?id=1181500#c5, we need a
>> confirmation about what listxattr returns on FreeBSD. Could someone please
>> help?
>
> sys_llistxattr() is a wrapper around extattr_list_link() on BSDs, as
> defined in libglusterfs/src/syscall.c
>
> sys_llistxattr(path, list, size) -> extattr_list_link(path,
> EXTATTR_NAMESPACE_USER, list, size)
>
>
> The man page for extattr_list_link() is available at [1].
>
> From the man page,
> '''
>      extattr_list_file() returns a list of attributes present in the requested
>      namespace. Each list entry consists of a single byte containing the
>      length of the attribute name, followed by the attribute name.  The
>      attribute name is not terminated by ASCII 0 (nul). The
>      extattr_get_file(), and extattr_list_file() calls consume the data and
>      nbytes arguments in the style of read(2);
> '''
> (The *link() syscalls behave the same as the *file() syscalls, expect
> they don't follow symlinks)
>

The linux man entry for llistxattr is as follows,
'''
      listxattr() retrieves the list of extended attribute names
associated with the given path in the filesystem.  The retrieved list
is placed in list, a caller-allocated buffer whose size (in bytes) is
specified in  the  argu‐
      ment  size.   The  list  is the set of (null-terminated) names,
one after the other.  Names of extended attributes to which the
calling process does not have access may be omitted from the list.
The length of the attribute
      name list is returned.

      llistxattr() is identical to listxattr(), except in the case of
a symbolic link, where the list of names of extended attributes
associated with the link itself is retrieved, not the file that it
refers to.
'''

There is a difference in the format used to return the names in the list.
The procedure to iterate the list needs to be changed for FreeBSD, or
the list needs to be normalized before sys_llistxattr() returns.

> ~kaushal
>
> [1] https://www.freebsd.org/cgi/man.cgi?query=extattr_list_link&apropos=0&sektion=0&manpath=FreeBSD+10.3-RELEASE+and+Ports&arch=default&format=html
>
>>
>> --
>> Pranith
>>
>> _______________________________________________
>> Gluster-devel mailing list
>> Gluster-devel at gluster.org
>> http://www.gluster.org/mailman/listinfo/gluster-devel


More information about the Gluster-devel mailing list