[LU-9929] Use "setfacl" to set "default" setting fail when nodemap enabled Created: 30/Aug/17 Updated: 12/Oct/17 Resolved: 30/Sep/17 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.11.0, Lustre 2.10.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | sebg-crd-pm (Inactive) | Assignee: | Emoly Liu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Lustre 2.9 |
||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Severity: | 3 | ||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||
| Description |
|
Hi , When we setfacl default in lustre directory, I got unmapping group id(getfacl) after first setting(setfacl) . Then we executed setfacl command again and got fail ( Operation not permitted). Please help us to fix this problem. Thanks! The detail information is listed below. 1.cat /etc/passwd , |
| Comments |
| Comment by Peter Jones [ 30/Aug/17 ] |
|
Emoly Could you please assist with this one? Thanks Peter |
| Comment by sebg-crd-pm (Inactive) [ 01/Sep/17 ] |
|
Hi Emoly, Do you have any comment about this issue? Thanks ! |
| Comment by Emoly Liu [ 02/Sep/17 ] |
|
I will look into this issue. |
| Comment by Emoly Liu [ 04/Sep/17 ] |
|
sebg-crd-pm, #On client node
+ groupadd -g 1001 user1
+ useradd -g user1 -u 1001 user1
+ cat /etc/passwd
+ grep user1
user1:x:1001:1001::/home/user1:/bin/bash
#On MGS node
+ lctl nodemap_add nodemap_test
+ lctl nodemap_add_idmap --name nodemap_test --idtype gid --idmap 1001:23501
+ lctl get_param 'nodemap.nodemap_test.*'
nodemap.nodemap_test.admin_nodemap=0
nodemap.nodemap_test.deny_unknown=0
nodemap.nodemap_test.exports=[
]
nodemap.nodemap_test.fileset=
nodemap.nodemap_test.id=5
nodemap.nodemap_test.idmap=[
{ idtype: gid, client_id: 1001, fs_id: 23501 }
]
nodemap.nodemap_test.map_mode=both
nodemap.nodemap_test.ranges=[
]
nodemap.nodemap_test.squash_gid=99
nodemap.nodemap_test.squash_uid=99
nodemap.nodemap_test.trusted_nodemap=0
#On client node
+ mkdir -p /mnt/lustre/hadoop3
+ getfacl /mnt/lustre/hadoop3
getfacl: Removing leading '/' from absolute path names
# file: mnt/lustre/hadoop3
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
+ echo '1st: setfacl'
1st: setfacl
+ setfacl -R -d -m group:user1:rwx /mnt/lustre/hadoop3
+ getfacl /mnt/lustre/hadoop3
getfacl: Removing leading '/' from absolute path names
# file: mnt/lustre/hadoop3
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:group:user1:rwx
default:mask::rwx
default:other::r-x
+ echo '2nd: setfacl'
2nd: setfacl
+ setfacl -R -d -m group:user1:rwx /mnt/lustre/hadoop3
+ getfacl /mnt/lustre/hadoop3
getfacl: Removing leading '/' from absolute path names
# file: mnt/lustre/hadoop3
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:group:user1:rwx
default:mask::rwx
default:other::r-x
Could you provide the following information?
Thanks! |
| Comment by sebg-crd-pm (Inactive) [ 06/Sep/17 ] |
|
Hi Emoly, Did you set your client ip to nodemap_test ? (lctl nodemap_add_range)? Which nodes are there in your system and which nodes have user "user1"? [setup lustre] [output] , { nid: 172.20.110.211@o2ib, uuid: 2a980ffd-962a-eef8-37aa-cedf34253b31 }, nodemap.nodemap_test.id=1 ] ] [client] [root@hsm mnt]mount.lustre 172.20.110.212@o2ib:/jlustre /mnt/lustre
[root@hsm mnt]# setfacl -R -d -m group:ppp:rwx /mnt/lustre/hadoop3 |
| Comment by Emoly Liu [ 07/Sep/17 ] |
|
Thanks, I can see this issue now. I will investigate it. |
| Comment by Emoly Liu [ 07/Sep/17 ] |
|
The following log 00000004:00000001:2.0:1504689607.481641:0:22011:0:(mdt_xattr.c:327:mdt_reint_setxattr()) Process leaving via out (rc=18446744073709551615 : -1 : 0xffffffffffffffff) shows the error comes from the following code int mdt_reint_setxattr() { ... rc = nodemap_map_acl(nodemap, rr->rr_eadata, xattr_len, NODEMAP_CLIENT_TO_FS); nodemap_putref(nodemap); if (rc < 0) GOTO(out, rc); /* ACLs were mapped out, return an error so the user knows */ if (rc != xattr_len) GOTO(out, rc = -EPERM); ... } The debugging information shows rc(44) != xattr_len(52). I will see what's wrong here. |
| Comment by sebg-crd-pm (Inactive) [ 13/Sep/17 ] |
|
Hi Emoly, Do you have any update ? Thanks! |
| Comment by Emoly Liu [ 13/Sep/17 ] |
|
Hi sebg-crd-pm,
I will give a update later. |
| Comment by Emoly Liu [ 15/Sep/17 ] |
|
When acl default unmapping code is added to mdt_getxattr(), EPERM issue disappears too. The issue happened because after the first setfacl, a wrong default acl was cached in the client side, when running setfacl again, FS didn't know this wrong unmapped gid(23501), so treated it as a squash id, then this squash id entry(8 bytes) was skipped in nodemap_map_acl(). That's why we saw EPERM error. I will submit a patch later. |
| Comment by Gerrit Updater [ 15/Sep/17 ] |
|
Emoly Liu (emoly.liu@intel.com) uploaded a new patch: https://review.whamcloud.com/29010 |
| Comment by Gerrit Updater [ 30/Sep/17 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/29010/ |
| Comment by Peter Jones [ 30/Sep/17 ] |
|
Landed for 2.11 |
| Comment by Gerrit Updater [ 09/Oct/17 ] |
|
Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/29369 |
| Comment by Gerrit Updater [ 11/Oct/17 ] |
|
John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/29369/ |