User defined extended attributes visibility between users

19 views
Skip to first unread message

metalp...@gmail.com

unread,
May 29, 2018, 8:08:36 PM5/29/18
to XtreemFS
Hi,

I am attempting to configure xtreemfs 1.6 as the back-end storage for Samba.

The filesystem has been mounted using the following command:

# mount.xtreemfs --no-default-permissions -o xtreemfs_acl,user_xattr,allow_other dir.domain.name/userdata /mnt/xtreemfs

Using this command I can then apply a test system extended attribute.

# setfattr -n system.test -v test1 /mnt/xtreemfs/test

This appears correctly when dumping the extended attributes when logged in with the same user that applied them:

# getfattr -d -m - /mnt/xtreemfs/test
getfattr: Removing leading '/' from absolute path names
# file: mnt/xtreemfs/test
system.test="test1"
xtreemfs.acl="{}"
...
xtreemfs.userquotainfo="{\"root\":{\"blocked\":0,\"quota\":0,\"used\":15}}"
xtreemfs.userusedspace="No user specified!"
xtreemfs.vouchersize="10485760"

Logging in with another user  does not display this attribute in the dump.

Is there a configuration option that I missed to allow this? I've gone through the use guide but did not find anything related to this.

Thank you,
David

Robert Schmidtke

unread,
May 30, 2018, 6:47:37 AM5/30/18
to XtreemFS
Hi David,

I just went through the implementation. User attributes are prefixed by the User ID internally, and therefore only the ones for the current user will be listed.
Could you try using the "xtreemfs." prefix instead of "system."? I currently don't have the setup for a running XtreemFS instance with extended file attributes and cannot test it. It might not be possible though because of checks against a predefined list of system attributes.

Cheers
Robert

David Rivera

unread,
May 30, 2018, 2:47:29 PM5/30/18
to xtre...@googlegroups.com
Hi Robert,

Unfortunately, Samba uses system.NTACL and a few other extended attributes under user.* but I still tried using the following command just to test but received Invalid argument.

# setfattr -n xtreemfs.test3 -v test3 /mnt/xtreemfs/test
setfattr: /mnt/xtreemfs/test: Invalid argument

Thank you,
David


--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Schmidtke

unread,
May 31, 2018, 5:09:31 AM5/31/18
to XtreemFS
Hi David,

I see. I think I can whip up a solution that treats extended attributed that start with "system." as global attributes, whereas the other ones are per-user attributes. This is expected behavior if I'm not mistaken?
The easiest way for you to test this would be to build XtreemFS yourself from the feature branch in my fork, would you be willing to do that? Building packages takes longer, and I would need to know your OS environment.

Cheers
Robert


On Wednesday, May 30, 2018 at 8:47:29 PM UTC+2, David Rivera wrote:
Hi Robert,

Unfortunately, Samba uses system.NTACL and a few other extended attributes under user.* but I still tried using the following command just to test but received Invalid argument.

# setfattr -n xtreemfs.test3 -v test3 /mnt/xtreemfs/test
setfattr: /mnt/xtreemfs/test: Invalid argument

Thank you,
David


To unsubscribe from this group and all its topics, send an email to xtreemfs+unsubscribe@googlegroups.com.

Robert Schmidtke

unread,
May 31, 2018, 5:30:30 AM5/31/18
to XtreemFS
This tree contains the changes I believe necessary to support globally visible extended attributes: https://github.com/robert-schmidtke/xtreemfs/tree/system-xattr
Instead of the "system." prefix, I used the "global." prefix though.

David Rivera

unread,
May 31, 2018, 3:00:02 PM5/31/18
to xtre...@googlegroups.com
Hi Robert,

It's not a problem, I will try to build XtreemFS from the provided branch today and let you know the results from my test.

Thank you,
David

To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.

David Rivera

unread,
May 31, 2018, 7:06:14 PM5/31/18
to xtre...@googlegroups.com
Hi Robert,

I was able to compile and install xtreemfs from the system-xattr branch. Below are the results from my testing.

Using user testuser I create a file test2 and set 3 global attributes.

[testuser@xtreemfs]$ echo test2 > /mnt/xtreemfs/test2
[testuser@xtreemfs]$  setfattr -n global.test -v test /mnt/xtreemfs/test2
[testuser@xtreemfs]$  setfattr -n global.test2 -v test2 /mnt/xtreemfs/test2
[testuser@xtreemfs]$  setfattr -n global.test3 -v test3 /mnt/xtreemfs/test2
[testuser@xtreemfs]$  getfattr -d -m global.* /mnt/xtreemfs/test2
getfattr: Removing leading '/' from absolute path names
# file: mnt/xtreemfs/test2
global.test="test"
global.test2="test2"
global.test3="test3"

Now logging in with root, I dump the global attibutes but returns no results. I then set an additional 3 attributes.

[root@xtreemfs]# getfattr -d -m global.* /mnt/xtreemfs/test2   (Returns no results)
[root@xtreemfs]# setfattr -n global.test4 -v test4 /mnt/xtreemfs/test2
[root@xtreemfs]# setfattr -n global.test5 -v test5 /mnt/xtreemfs/test2
[root@xtreemfs]# setfattr -n global.test6 -v test6 /mnt/xtreemfs/test2
[root@xtreemfs]# getfattr -d -m global.* /mnt/xtreemfs/test2
getfattr: Removing leading '/' from absolute path names
# file: mnt/xtreemfs/test2
global.test4="test4"
global.test5="test5"
global.test6="test6"

Now I log back in with testuser, the original xattrs set by testuser are missing but the new xattrs set by root are present with the correct values.

[testuser@xtreemfs]$ setfattr -n global.test -v test /mnt/xtreemfs/test2
getfattr: Removing leading '/' from absolute path names
# file: mnt/xtreemfs/test2
global.test4="test4"
global.test5="test5"
global.test6="test6"

I set an additional attribute using testuser:

[testuser@xtreemfs]$ setfattr -n global.test7 -v test7 /mnt/xtreemfs/test2
[testuser@xtreemfs]$ setfattr -n global.test -v test /mnt/xtreemfs/test2
getfattr: Removing leading '/' from absolute path names
# file: mnt/xtreemfs/test2
global.test="test"
global.test2="test2"
global.test3="test3"
global.test7="test7"

The original attributes reappeared along with the newly set attribute and the attributes set by root are gone.
Logging in back with root only the attributes set by root are present:

[root@xtreemfs]# getfattr -d -m global.* /mnt/xtreemfs/test2
getfattr: Removing leading '/' from absolute path names
# file: mnt/xtreemfs/test2
global.test4="test4"
global.test5="test5"
global.test6="test6"

Let me know if you need me to test something specific.

Thank you,
David

Robert Schmidtke

unread,
Jun 1, 2018, 4:06:03 AM6/1/18
to XtreemFS
Hi David,

thanks for testing and reporting your findings.
I finally managed to set it all up in a virtual machine with Ubuntu 16.04 myself.
I repeated the steps you took, but they all work as expected. All attributes, global.test -- global.test7 are visible from both users (my regular login and root), and never get lost in between.

Here are a few things that might be worthwhile checking:
- do you ever recreate your test2 file (might be by accident when repeating your bash history)?
- are you sure you installed the new XtreemFS version properly? here are the steps I took:
1. clone the repository, checkout the correct branch
2. $ make client server
3. $ ./tests/xstartserv --start-dir --start-mrc --start-osd # this brings up a local XtreemFS, no need to do any installation whatsoever
4. $ ./bin/mkfs.xtreemfs localhost/demo # create volume demo on local MRC
5. $ mkdir /mnt/xtreemfs
6. $ ./bin/mount.xtreemfs --no-default-permissions -o xtreemfs_acl,user_xattr,allow_other localhost/demo /mnt/xtreemfs
- when you mean logging out and logging back in, do you mean you also unmount/remount the volume (e.g. I simply have two terminal windows open side by side, one with my user, one with root)?
- which operating system and version are you using?

Looking forward to hearing back from you with new insights!
Cheers
Robert


On Friday, June 1, 2018 at 1:06:14 AM UTC+2, David Rivera wrote:
Hi Robert,

On Thu, May 31, 2018 at 11:59 AM David Rivera wrote:
Hi Robert,

It's not a problem, I will try to build XtreemFS from the provided branch today and let you know the results from my test.

Thank you,
David

To unsubscribe from this group and all its topics, send an email to xtreemfs+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+unsubscribe@googlegroups.com.

David Rivera

unread,
Jun 1, 2018, 3:09:51 PM6/1/18
to xtre...@googlegroups.com
Hi Robert,

Sorry for not explaining a bit more.

I create the file only once; notice I do this by using echo "text" > file so even if I re-ran this command again it would not overwrite the file attributes only the file data.

Here are the steps I took for compiling and builting xtreemfs.
2. make
3. make install
4. /etc/xos/xtreemfs/postinstall_setup.sh
5 chown -R root:xtreemfs /etc/xos # had to fix group ownership
6. /etc/init.d/xtreemfs-dir start
7.  /etc/init.d/xtreemfs-mrc start
8.  /etc/init.d/xtreemfs-osd start
9.  mkfs.xtreemfs localhost/test
10. mkdir /mnt/xtreemfs
11. mount.xtreemfs --no-default-permissions -o xtreemfs_acl,user_xattr,allow_other localhost/test /mnt/xtreemfs

By logging out/in I mean I use `su testuser`, there is no unmount/remount involved.
I am using CentOS Linux release 7.5.1804 (Core), all updates applied.

I will try to spin up a fresh virtual machine today and follow your steps then report back.

Thank you for taking the time to look into this.

David



To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.

Robert Schmidtke

unread,
Jun 4, 2018, 9:13:11 AM6/4/18
to XtreemFS
Hi David,

off the top of my hat I'd say you may not have switched to the system-xattr branch:

$ git clone https://github.com/robert-schmidtke/xtreemfs.git && git checkout system-xattr

Other than that I think that you took the right steps to install.

Cheers
Robert


On Friday, June 1, 2018 at 9:09:51 PM UTC+2, David Rivera wrote:
Hi Robert,

To unsubscribe from this group and all its topics, send an email to xtreemfs+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+unsubscribe@googlegroups.com.

David Rivera

unread,
Jun 4, 2018, 9:22:09 PM6/4/18
to xtre...@googlegroups.com
Hi Robert,

You're right, I somehow did miss that but now that it's on the system-xattr branch I'm still seeing the same results.

I started the git clone from scratch.

[root@xtreemfs]# git branch
  master
* system-xattr
[root@xtreemfs]# git log -1
commit 49db7d3d531d54b63a40f3ee5ea11def89ba25f7
Author: Robert Schmidtke <ro.sch...@gmail.com>
Date:   Thu May 31 11:29:03 2018 +0200

    java: mrc: use global prefix for extended attributes


I still have to try this on a clean CentOS install.

Thank you,
David

To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/g7DlCCUckS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages