Bug 799244

Summary: nfs-nlm:gnfs server does not allow kernel nfs mount
Product: [Community] GlusterFS Reporter: Saurabh <saujain>
Component: nfsAssignee: Rajesh <rajesh>
Status: CLOSED CANTFIX QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 3.3-betaCC: gluster-bugs, mzywusko, ndevos, optix2002, rajesh, sac, vagarwal, vbellur, vinaraya
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
Cause: conflicting portmap registration of nlm v4 required by two gluster nfs server and kernel nfs client(nlm). Consequence: No two nlm registration can map the same program number to two servers. Workaround (if any): mount the volume with "nolock" option Result: NLM (locking) will not be available in such cases.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-11 07:06:32 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: DP CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Saurabh 2012-03-02 04:02:10 EST
Description of problem:

the kernel nfs mount fails , if the gnfs server is already running on the machine in consideration,

try kernel nfs and it gives this response,
[root@RHSSA1 ~]# mount -t nfs 10.1.12.136:/opt /mnt/opt
mount.nfs: access denied by server while mounting 10.1.12.136:/opt


Version-Release number of selected component (if applicable):
3.3.0qa25

How reproducible:
always

Steps to Reproduce:
1. start gnfs server on the machine in consideration
2. now try to mount a directory exported by some kernel-nfs
3.
  
Actual results:
step 2 fails


Expected results:
step 2 should not get affected

Additional info:

Presently this is getting rectified by killing the nfs server and cleaning the nlm rpc services using rpcinfo -d <progname> <vers>


logs,

on machine gnfs is running

root      5046     1  0 Feb28 ?        00:00:01 /root/330/inst/sbin/glusterfs -f /etc/glusterd/nfs/nfs-server.vol -p /etc/glusterd/nfs/run/nfs.pid -l /root/330/inst/var/log/glusterfs/nfs.log

on same machine try kernel nfs mount,

[root@RHSSA1 ~]# mount -t nfs 10.1.12.136:/opt /mnt/opt
mount.nfs: access denied by server while mounting 10.1.12.136:/opt


[root@RHSSA1 ~]# kill 5046

[root@RHSSA1 ~]# rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  58139  status
    100024    1   tcp  33935  status
    100021    4   tcp  38468  nlockmgr
    100005    3   tcp  38465  mountd
    100005    1   tcp  38466  mountd
    100003    3   tcp  38467  nfs
    100021    1   udp    987  nlockmgr
    100021    1   tcp    989  nlockmgr

[root@RHSSA1 ~]# rpcinfo -d 100021 4
[root@RHSSA1 ~]# rpcinfo -d 100021 1

[root@RHSSA1 ~]# rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  58139  status
    100024    1   tcp  33935  status
    100005    3   tcp  38465  mountd
    100005    1   tcp  38466  mountd
    100003    3   tcp  38467  nfs

[root@RHSSA1 ~]# mount -t nfs 10.1.12.136:/opt /mnt/opt

mount succeeds
infact after this exercise other kernel-nfs mounts also succeed.
Comment 1 Krishna Srinivas 2012-03-06 02:20:35 EST
Yes. Two NLM implementations can not be running at the same time in a machine. When we try to do an nfs-mount on a client where gluster-nfs is already running, kernel-nfs-client will try to start NLM service (which is also implemented in the kernel) which will fail and hence mount operation fails. In such a situation mount with 'nolock' option will succeed.
Comment 2 Rajesh 2012-03-13 07:18:09 EDT
The NLM problem is analogous to kernel-nfs-server problem. one cannot have two nfs v3 servers(say gNfs and kernel Nfs v3) on the same machine, simply because there is (currently) no way of running/registering two services(programs) of the same version with the portmapper/rpcbind service. 

To paraphrase, this is one more thing to keep in mind along with the fact that Nfs kernel server v3 cannot run where Gluster Nfs runs, and *must* be documented.
Comment 3 Krishna Srinivas 2012-04-04 08:31:47 EDT
*** Bug 799930 has been marked as a duplicate of this bug. ***
Comment 5 Niels de Vos 2012-05-21 10:14:18 EDT
When mounting a nfs-share, the kernel automatically loads the nfs module and its dependencies. One of the dependencies is the lockd module, which registers itself in the portmapper/rpcbind. This prevents the Gluster lock-daemon to register itself as lockd, because the rpc-service is already provided by the kernel module.

A permanent workaround is to unregister the rpc-service from the lockd kernel-module when the module gets loaded. This can be achieved by creating a modprobe.conf file (saved as /etc/modprobe.d/unregister-lockd.conf):

# unregister lockd on load (RHBZ#799244)
install lockd /sbin/modprobe --ignore-install lockd ; /usr/sbin/rpcinfo -d 100021 1 ; /usr/sbin/rpcinfo -d 100021 4

(the "install lockd ..." should be on line line.)
Comment 6 Rajesh 2012-07-13 02:50:13 EDT
*** Bug 839773 has been marked as a duplicate of this bug. ***
Comment 7 Vidya Sakar 2012-08-28 20:47:55 EDT
Adding DP flag to document this.