Fix cp not to give chflags error on NFS

Lewis Donzis lew at perftech.com
Sat Apr 1 18:43:52 UTC 2017


> On Apr 1, 2017, at 1:16 PM, Bruce Evans <brde at optusnet.com.au> wrote:

Thanks for the detailed explanation.

As I mentioned later, the problem seems to be more lated to the NFSv4 server running Linux (FWIW, the underlying filesystem on our Linux NFS server is ZFS).

> nfs should support file flags iff the server does.  Unfortunately, there
> is no protocol to set them (at least in nfs3).

We switched to NFSv4 in the hopes that it would solve this.  And, in fact, it does if the server is running FreeBSD.

But on Linux, not only does the ACL (which we never set) appear to cp not to be “trivial”, but it fails to set.  I’ve added some details below, if it’s of any interest.

We were already in the process of switching our NFS servers from Linux to FreeBSD anyway, so this will just accelerate the process.

Thanks,
lew

Using a Linux NFSv4 server:

root at fbdev:/shared/lew # mount
******:/shared on /shared (nfs, nfsv4acls)

root at fbdev:/shared/lew # cp -p xx yy
nfsv4 err=10032
cp: failed to set acl entries for yy: Operation not permitted

root at fbdev:/shared/lew # ls -l xx yy
-rwxrwxr-x+ 1 root  wheel  4821 Apr 25  2009 xx
-rwxrwxr-x+ 1 root  wheel  4821 Apr 25  2009 yy

root at fbdev:/shared/lew # getfacl -v xx
# file: xx
# owner: root
# group: wheel
            owner@:read_data/write_data/execute/append_data/read_attributes/write_attributes/read_acl/write_acl/synchronize::allow
            group@:read_data/write_data/execute/append_data/read_attributes/read_acl/synchronize::allow
         everyone@:read_data/execute/read_attributes/read_acl/synchronize::allow

Using a FreeBSD NFSv4 server:

root at fbdev:/mnt/lew # mount
******:/shared on /mnt (nfs, nfsv4acls)

root at fbdev:/mnt/lew # cp -p xx yy

root at fbdev:/mnt/lew # ls -l xx yy
-rwxrwxr-x  1 root  wheel  4821 Apr 25  2009 xx
-rwxrwxr-x  1 root  wheel  4821 Apr 25  2009 yy

root at fbdev:/mnt/lew # getfacl -v xx
# file: xx
# owner: root
# group: wheel
            owner@:read_data/write_data/execute/append_data/read_attributes/write_attributes/read_xattr/write_xattr/read_acl/write_acl/write_owner/synchronize::allow
            group@:read_data/write_data/execute/append_data/read_attributes/read_xattr/read_acl/synchronize::allow
         everyone@:read_data/execute/read_attributes/read_xattr/read_acl/synchronize::allow




More information about the freebsd-bugs mailing list