* [PATCH] NLM program ID for user space NLM server
@ 2007-05-10 9:56 Menny Hamburger
2007-05-10 10:02 ` Neil Brown
0 siblings, 1 reply; 9+ messages in thread
From: Menny Hamburger @ 2007-05-10 9:56 UTC (permalink / raw)
To: linux-kernel
Hi,
Since the current kernel cannot be compiled with NFS client and without
lockd, it is not possible to register a user space NLM server
Without colliding with the kernel service registered in
.../fs/lockd/lockd.c.
This simple patch gives the ability to provide NLM_PROGRAM from outside:
--- linux-2.6.20/include/linux/lockd/nlm.h 2007-02-04
20:44:54.000000000 +0200
+++ linux-2.6.20_patched/include/linux/lockd/nlm.h 2007-05-10
12:21:40.799004000 +0300
@@ -30,7 +30,9 @@
#endif
};
+#ifndef
#define NLM_PROGRAM 100021
+#endif
#define NLMPROC_NULL 0
#define NLMPROC_TEST 1
Menny
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] NLM program ID for user space NLM server
2007-05-10 9:56 [PATCH] NLM program ID for user space NLM server Menny Hamburger
@ 2007-05-10 10:02 ` Neil Brown
2007-05-10 10:59 ` Menny Hamburger
0 siblings, 1 reply; 9+ messages in thread
From: Neil Brown @ 2007-05-10 10:02 UTC (permalink / raw)
To: Menny Hamburger; +Cc: linux-kernel
On Thursday May 10, menny@exanet.com wrote:
> Hi,
>
> Since the current kernel cannot be compiled with NFS client and without
> lockd, it is not possible to register a user space NLM server
> Without colliding with the kernel service registered in
> .../fs/lockd/lockd.c.
This doesn't make any sense to me at all.
You can certainly have the NFS client compiled and even running
without lockd running (if you mount with "-o nolock") and in that case
you are free you register your owner user-space NLM server (though I'm
not sure what good it would do you).
And if you want to mount an NFS filesystem without "-o nolock", then
you really need the kernel lockd running, or locking will not work.
Can you explain what you are trying to do - I'm curious.
>
> +#ifndef
> #define NLM_PROGRAM 100021
> +#endif
Uhm... Do you mean
+#ifndef NLM_PROGRAM
?? Still not sure how that helps.
NeilBrown
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] NLM program ID for user space NLM server
2007-05-10 10:02 ` Neil Brown
@ 2007-05-10 10:59 ` Menny Hamburger
2007-05-10 13:39 ` Trond Myklebust
0 siblings, 1 reply; 9+ messages in thread
From: Menny Hamburger @ 2007-05-10 10:59 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-kernel
Hi,
We have a our own userland NFSD and NLM service running that implement
all the NLM/NFS functionality.
We do not want to modify the way the client does his mounts.
M.
-----Original Message-----
From: Neil Brown [mailto:neilb@suse.de]
Sent: Thursday, May 10, 2007 12:03 PM
To: Menny Hamburger
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NLM program ID for user space NLM server
On Thursday May 10, menny@exanet.com wrote:
> Hi,
>
> Since the current kernel cannot be compiled with NFS client and
> without lockd, it is not possible to register a user space NLM server
> Without colliding with the kernel service registered in
> .../fs/lockd/lockd.c.
This doesn't make any sense to me at all.
You can certainly have the NFS client compiled and even running without
lockd running (if you mount with "-o nolock") and in that case you are
free you register your owner user-space NLM server (though I'm not sure
what good it would do you).
And if you want to mount an NFS filesystem without "-o nolock", then you
really need the kernel lockd running, or locking will not work.
Can you explain what you are trying to do - I'm curious.
>
> +#ifndef
> #define NLM_PROGRAM 100021
> +#endif
Uhm... Do you mean
+#ifndef NLM_PROGRAM
?? Still not sure how that helps.
NeilBrown
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] NLM program ID for user space NLM server
2007-05-10 10:59 ` Menny Hamburger
@ 2007-05-10 13:39 ` Trond Myklebust
2007-05-10 15:30 ` Menny Hamburger
0 siblings, 1 reply; 9+ messages in thread
From: Trond Myklebust @ 2007-05-10 13:39 UTC (permalink / raw)
To: Menny Hamburger; +Cc: Neil Brown, linux-kernel
On Thu, 2007-05-10 at 13:59 +0300, Menny Hamburger wrote:
> Hi,
>
> We have a our own userland NFSD and NLM service running that implement
> all the NLM/NFS functionality.
> We do not want to modify the way the client does his mounts.
>
> M.
The client needs to have lockd running (as service 100021) in order to
allow the NSM daemon to notify it of server reboots.
Trond
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] NLM program ID for user space NLM server
2007-05-10 13:39 ` Trond Myklebust
@ 2007-05-10 15:30 ` Menny Hamburger
2007-05-10 16:27 ` Trond Myklebust
0 siblings, 1 reply; 9+ messages in thread
From: Menny Hamburger @ 2007-05-10 15:30 UTC (permalink / raw)
To: Trond Myklebust; +Cc: Neil Brown, linux-kernel
The idea in the change was to be able to override NLM_PROGRAM with
another definition (from our slightly customized build system), so that
the kernel never tries to register port 100021.
We understand that if all mounts are with 'nolock' this wouldn't happen,
and indeed, we configured our mounts that way, but we want to protect
ourself from some innocent mounter that doesn't know/care about NLM,
doesn't use 'nolock' and could cause the kernel to take away our port.
This of course happened in real life.
If such patch would be accepted, it could save some time to anyone who
tries to run user mode NLM server, but it's pretty esoteric, so maybe
this discussion is enough to document the issue.
-----Original Message-----
From: Trond Myklebust [mailto:trond.myklebust@fys.uio.no]
Sent: Thursday, May 10, 2007 3:39 PM
To: Menny Hamburger
Cc: Neil Brown; linux-kernel@vger.kernel.org
Subject: RE: [PATCH] NLM program ID for user space NLM server
On Thu, 2007-05-10 at 13:59 +0300, Menny Hamburger wrote:
> Hi,
>
> We have a our own userland NFSD and NLM service running that implement
> all the NLM/NFS functionality.
> We do not want to modify the way the client does his mounts.
>
> M.
The client needs to have lockd running (as service 100021) in order to
allow the NSM daemon to notify it of server reboots.
Trond
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] NLM program ID for user space NLM server
2007-05-10 15:30 ` Menny Hamburger
@ 2007-05-10 16:27 ` Trond Myklebust
2007-05-10 16:45 ` Menny Hamburger
0 siblings, 1 reply; 9+ messages in thread
From: Trond Myklebust @ 2007-05-10 16:27 UTC (permalink / raw)
To: Menny Hamburger; +Cc: Neil Brown, linux-kernel
On Thu, 2007-05-10 at 18:30 +0300, Menny Hamburger wrote:
> The idea in the change was to be able to override NLM_PROGRAM with
> another definition (from our slightly customized build system), so that
> the kernel never tries to register port 100021.
I repeat: The kernel _NEEDS_ to register RPC service 100021 on the
client so that rpc.statd can find it and notify it of server reboots.
Trond
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] NLM program ID for user space NLM server
2007-05-10 16:27 ` Trond Myklebust
@ 2007-05-10 16:45 ` Menny Hamburger
2007-05-10 17:04 ` Trond Myklebust
0 siblings, 1 reply; 9+ messages in thread
From: Menny Hamburger @ 2007-05-10 16:45 UTC (permalink / raw)
To: Trond Myklebust; +Cc: Neil Brown, linux-kernel
Yes, but in our case we don't care. This is a dedicated server where we
don't see any usage for NLM client. We just want to prevent the kernel
from taking the port in case of some accidental NFS mount that ommitted
'nolock'.
-----Original Message-----
From: Trond Myklebust [mailto:trond.myklebust@fys.uio.no]
Sent: Thursday, May 10, 2007 6:27 PM
To: Menny Hamburger
Cc: Neil Brown; linux-kernel@vger.kernel.org
Subject: RE: [PATCH] NLM program ID for user space NLM server
On Thu, 2007-05-10 at 18:30 +0300, Menny Hamburger wrote:
> The idea in the change was to be able to override NLM_PROGRAM with
> another definition (from our slightly customized build system), so
> that the kernel never tries to register port 100021.
I repeat: The kernel _NEEDS_ to register RPC service 100021 on the
client so that rpc.statd can find it and notify it of server reboots.
Trond
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] NLM program ID for user space NLM server
2007-05-10 16:45 ` Menny Hamburger
@ 2007-05-10 17:04 ` Trond Myklebust
2007-05-10 17:11 ` Menny Hamburger
0 siblings, 1 reply; 9+ messages in thread
From: Trond Myklebust @ 2007-05-10 17:04 UTC (permalink / raw)
To: Menny Hamburger; +Cc: Neil Brown, linux-kernel
On Thu, 2007-05-10 at 19:45 +0300, Menny Hamburger wrote:
> Yes, but in our case we don't care. This is a dedicated server where we
> don't see any usage for NLM client. We just want to prevent the kernel
> from taking the port in case of some accidental NFS mount that ommitted
> 'nolock'.
Which is _wrong_. If you omit the 'nolock' mount option, then the client
_does_ use NLM locking, and so will need the RPC downcall.
If you don't need NLM locking, and want to make sure nobody else can
enable it, then you can triviall 'fix' this on your server by patching
it to force the nolock mount option. This isn't a patch that we
particularly want to see in mainline, though.
Trond
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] NLM program ID for user space NLM server
2007-05-10 17:04 ` Trond Myklebust
@ 2007-05-10 17:11 ` Menny Hamburger
0 siblings, 0 replies; 9+ messages in thread
From: Menny Hamburger @ 2007-05-10 17:11 UTC (permalink / raw)
To: Trond Myklebust; +Cc: Neil Brown, linux-kernel
Well,
That maybe a better idea then what we do - we'll try it.
Thnx,
Menny
-----Original Message-----
From: Trond Myklebust [mailto:trond.myklebust@fys.uio.no]
Sent: Thursday, May 10, 2007 7:04 PM
To: Menny Hamburger
Cc: Neil Brown; linux-kernel@vger.kernel.org
Subject: RE: [PATCH] NLM program ID for user space NLM server
On Thu, 2007-05-10 at 19:45 +0300, Menny Hamburger wrote:
> Yes, but in our case we don't care. This is a dedicated server where
> we don't see any usage for NLM client. We just want to prevent the
> kernel from taking the port in case of some accidental NFS mount that
> ommitted 'nolock'.
Which is _wrong_. If you omit the 'nolock' mount option, then the client
_does_ use NLM locking, and so will need the RPC downcall.
If you don't need NLM locking, and want to make sure nobody else can
enable it, then you can triviall 'fix' this on your server by patching
it to force the nolock mount option. This isn't a patch that we
particularly want to see in mainline, though.
Trond
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-05-10 17:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-10 9:56 [PATCH] NLM program ID for user space NLM server Menny Hamburger
2007-05-10 10:02 ` Neil Brown
2007-05-10 10:59 ` Menny Hamburger
2007-05-10 13:39 ` Trond Myklebust
2007-05-10 15:30 ` Menny Hamburger
2007-05-10 16:27 ` Trond Myklebust
2007-05-10 16:45 ` Menny Hamburger
2007-05-10 17:04 ` Trond Myklebust
2007-05-10 17:11 ` Menny Hamburger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox