Getting an unexpected behavior when mounting more than a single share.
NFS Server
$ -> cd /mnt/raid/nas && ls -lZa
drwxrwxr-x. nas filer unconfined_u:object_r:file_t:s0 file
drwxrwxr-x. nas filer unconfined_u:object_r:file_t:s0 repo
$ -> cat /etc/exports
/mnt/raid/nas 10.1.0.0/18(rw,fsid=0,sync)
/mnt/raid/nas/repo 10.1.0.0/18(rw,all_squash,sync,no_subtree_check,anonuid=501,anongid=503)
/mnt/raid/nas/file/perm 10.1.0.0/18(rw,all_squash,sync,no_subtree_check,anonuid=501,anongid=503)
$ -> id nas && id filer
uid=501(nas) gid=501(nas) groups=501(nas)
uid=502(filer) gid=503(filer) groups=503(filer)
NFS Client
$ -> id nas && id filer
uid=501(nas) gid=501(nas) groups=501(nas)
uid=502(filer) gid=503(filer) groups=503(filer)
$ -> cd /mnt/nas && ls -lZa
drwxrwxr-x. nas filer unconfined_u:object_r:mnt_t:s0 repo
drwxrwxr-x. nas filer unconfined_u:object_r:mnt_t:s0 store
$ -> sudo mount -t nfs4 nas-1:/repo /mnt/nas/repo
$ -> sudo mount -t nfs4 nas-1:/file/perm /mnt/nas/store/file/perm/
$ -> df -h
nas-1:/repo
550G 240G 283G 46% /mnt/nas/repo
nas-1:/file/perm
550G 240G 283G 46% /mnt/nas/store/file/perm
But when I write a test file to each, only the perm/ correctly squashes the user.
$ -> touch /mnt/nas/repo/imagemagick/test_$$.txt
$ -> ls /mnt/nas/repo/imagemagick
-rw-rw-r--. 1 mpurcell mpurcell 0 Apr 5 20:31 test_24571.txt
$ -> touch /mnt/nas/store/file/perm/test_$$.txt
$ -> ls /mnt/nas/store/file/perm/
-rw-rw-r--. 1 nas filer 0 Apr 5 20:32 test_24571.txt
I tried disabling selinux on both boxes, but that did not work either.
Why is one mount correctly squashing the user/group and the other is not?
---Update---
Do I have to bind the NFS mounts on the NFS server? I had a weird entry in my /etc/fstab file where one of the shared directories was being mounted (with bind) and that was the one that was working. I removed the entry from /etc/fstab on the NFS server, remounted everything, and now the once working mount on NFS client is no longer working.