Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 231118 - [NetApp 4.6 feat] setfacl not supported on NFSv4 mounted filesystem
Summary: [NetApp 4.6 feat] setfacl not supported on NFSv4 mounted filesystem
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: nfs-utils
Version: 4.6
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Peter Staubach
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2007-03-06 07:58 UTC by Ricardo Labiaga
Modified: 2007-11-30 22:07 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Last Closed: 2007-07-18 18:11:37 UTC
Target Upstream Version:

Attachments (Terms of Use)
strace of failed call to setfacl (deleted)
2007-03-06 07:58 UTC, Ricardo Labiaga
no flags Details
Purposed upstream patch (deleted)
2007-03-08 23:19 UTC, Steve Dickson
no flags Details | Diff

Description Ricardo Labiaga 2007-03-06 07:58:46 UTC
Description of problem:
Can not set ACLs on an NFSv4 mounted filesystem when the client is running a
vanilla RHEL or Fedora Core system.  Other Linux distros probably ship with the
same limitation.  The setfacl call fails with EOPTNOTSUPP.

Version-Release number of selected component (if applicable):
- Tested on RHEL 4.4 and FC6.  FC6 kernel details:

How reproducible:
- Every time

Steps to Reproduce:

> mount -t nfs4 proto-u38:/vol/vol0 /mnt
> cd /mnt
> touch foo
> getfacl foo
# file: foo
# owner: nobody
# group: nobody

> setfacl -m user:user1:rwx foo
setfacl: foo: Operation not supported

Actual results:
Fails with error: EOPNOTSUPP

Expected results:
Should succeed and set an Access Control Entry on file 'foo' for 'user1' giving
read/write/execute permission.

Additional info:
Tested against NetApp filer with NFSv4 enabled, and NFS ACL support enabled. 
NetApp filer is running ONTAP 7.2.1.  Any NFsv4 server will produce the same
behavior, since the call errs on the client without calling the server.

strace shows that getfacl("foo", ...) uses getxattr(2) to obtain the ACL 
extended attribute.  The default POSIX-style ACL tool expects the
name of the ACL extended attribute to be "system.posix_acl_access".

getxattr("foo", "system.posix_acl_access", 0xbff77d50, 132) =
-1 EOPNOTSUPP (Operation not supported)

This eventually traps into the kernel calling:

nfs4_getxattr() (in fs/nfs/nfs4proc.c) expects a different extended attribute 
name: "system.nfs4_acl", which differs from what is passed in, making it return

#define XATTR_NAME_NFSV4_ACL "system.nfs4_acl"
ssize_t nfs4_getxattr(struct dentry *dentry, const char *key, void *buf,
                size_t buflen)
        if (strcmp(key, XATTR_NAME_NFSV4_ACL) != 0)
                return -EOPNOTSUPP;

Citi has a set of patches that modify the library behavior to better map
POSIX ACLs to NFSv4 ACLs.  One of the many things it does is use 
"system.nfs4_acl".  It's not a perfect mapping, so they
recommend to use instead the nfs4-acl-tools which use NFSv4 ACLs

Customers that require use of ACLs on NFSv4 filesystems, are forced to compile
these tools themselves (this after generating customer calls to their respective
support providers).

The CITI patches and libraries can be found at:

Comment 1 Ricardo Labiaga 2007-03-06 07:58:46 UTC
Created attachment 149325 [details]
strace of failed call to setfacl

Comment 2 Andrius Benokraitis 2007-03-06 16:06:13 UTC
Since this is a feature request, adding this to the RHEL 4.6 request list.

Comment 3 Andrius Benokraitis 2007-03-06 16:07:35 UTC
FYI: If this is needed in RHEL 5.2, another bug should be created for RHEL 5.

Comment 4 Andrius Benokraitis 2007-03-06 21:34:09 UTC
Corresponding bug for RHEL 5 can be found at bug 231231.

Comment 5 Steve Dickson 2007-03-08 23:19:42 UTC
Created attachment 149657 [details]
Purposed upstream patch

Comment 9 RHEL Product and Program Management 2007-07-18 18:11:37 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request. 

Comment 10 Andrius Benokraitis 2007-07-18 18:35:34 UTC

Red Hat Engineering has reviewed this feature request and has concluded that
support for Linux ACLs over NFSv4 is not stable enough upstream for inclusion
into RHEL 4. Also, the design of NFSv4 makes it almost impossible to completely
emulate Linux ACLs. The solution is to add protocol support for Linux ACLs in a
future version of NFSv4, maybe NFSv4.2. Furthermore, with only a few more minor
releases in the RHEL 4 time frame, this may seem unlikely at all for inclusion.

Note You need to log in before you can comment on or make changes to this bug.