[smartos-discuss] 答复: [smartos-discuss] getxattr()/setxattr() on SmartOS platform

2016-06-16 Thread 龙白滔
Robert, thanks for information.


We can implement getxattr/setxattr using opennat() in case we port sheepdog 
onto native SmartOS zone. If we run sheepdog on a centos lx brand zone, which 
is more preferable, we still face the problem that these two interfaces are not 
supported by the lx evaluation. Any idea to make it work on lx brand zone?


Thanks.


Baitao of Briphant team from China


发件人: Robert Mustacchi <r...@joyent.com>
发送时间: 2016年6月16日 21:56:09
收件人: smartos-discuss@lists.smartos.org
主题: Re: [smartos-discuss] getxattr()/setxattr() on SmartOS platform

On 6/15/16 22:28 , 龙白滔 wrote:
> 2. are getxattr()/setxaddr() natively supported on SmartOS platform? if not 
> so, how to achieve similar purpose?
 
 While it seems like you've already discovered the answer to your first
 question, I thought I'd go through and answer this in a bit more detail.
 
 So, first off, both platforms support extended attributes. The
 interfaces for both of them are different though. On illumos, if you
 read http://illumos.org/man/5/fsattr, you'll see how you can open them.
 
 So for example, in this case, while glibc provides the getxattr() and
 setxattr() interfaces, you can implement them in terms of openat() and
 O_XATTR through a translation library. It might not be the worst thing.
 See this mail from a couple months ago that talks about some of the
 differences:
 
 
https://www.listbox.com/member/archive/182179/2016/02/sort/time_rev/page/3/entry/6:323/20160225091351:FC7AECD2-DBC9-11E5-A76D-591BF010038B/
 
 Robert
 



---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com


Re: [smartos-discuss] getxattr()/setxattr() on SmartOS platform

2016-06-16 Thread Robert Mustacchi
On 6/15/16 22:28 , 龙白滔 wrote:
> 2. are getxattr()/setxaddr() natively supported on SmartOS platform? if not 
> so, how to achieve similar purpose?

While it seems like you've already discovered the answer to your first
question, I thought I'd go through and answer this in a bit more detail.

So, first off, both platforms support extended attributes. The
interfaces for both of them are different though. On illumos, if you
read http://illumos.org/man/5/fsattr, you'll see how you can open them.

So for example, in this case, while glibc provides the getxattr() and
setxattr() interfaces, you can implement them in terms of openat() and
O_XATTR through a translation library. It might not be the worst thing.
See this mail from a couple months ago that talks about some of the
differences:

https://www.listbox.com/member/archive/182179/2016/02/sort/time_rev/page/3/entry/6:323/20160225091351:FC7AECD2-DBC9-11E5-A76D-591BF010038B/

Robert


---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com


[smartos-discuss] getxattr()/setxattr() on SmartOS platform

2016-06-15 Thread 龙白滔
Hello, all,

We ran Sheepdog server in lx-branded zone and the execution went to "else" 
block while "if" one is expected.


#define MDNAME  "user.md.size"
#define MDSIZE  sizeof(uint64_t)
if (getxattr(path, MDNAME, , MDSIZE) < 0) {
if (errno == ENODATA) {
goto create;
} else {
sd_err("%s, %m", path);
goto broken_path;
}
}


We also wrote a test program on SmartOS which calls getxaddr() and setxaddr() 
and encountered error saying that "sys/xattr.h" is not found. It's true that we 
failed to locate this header file.

We have two questions here:
1.whethere getxattr()/setxaddr() have been correctly emulated in lx-branded 
zone?
2. are getxattr()/setxaddr() natively supported on SmartOS platform? if not so, 
how to achieve similar purpose?

Thanks a lot in advance.

Baitao of Briphant Team from China



---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com