linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* local_lock mount option
@ 2012-12-13 13:35 Lukas Hejtmanek
  2012-12-13 14:10 ` Fred Isaman
  0 siblings, 1 reply; 7+ messages in thread
From: Lukas Hejtmanek @ 2012-12-13 13:35 UTC (permalink / raw)
  To: linux-nfs

Hi,

is this option supported and should work?

It seems that in SLES and RHEL kernel, it is ignored:
mount nfs.server:/ /storage -t nfs4 -o sec=krb5,local_lock=all

cat /proc/mounts  | grep storage
nfs.server:/ /storage nfs4
rw,relatime,vers=4,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=krb5,clientaddr=xxx.xxx.xxx.xxx,minorversion=0,local_lock=none,addr=xxx.xxx.xxx.xxx 0 0

and it seems, that it actually tries to lock through NFS.

Has this been fixed in later kernels or this is broken at all?

-- 
Lukáš Hejtmánek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: local_lock mount option
  2012-12-13 13:35 local_lock mount option Lukas Hejtmanek
@ 2012-12-13 14:10 ` Fred Isaman
  2012-12-13 14:23   ` Lukas Hejtmanek
  0 siblings, 1 reply; 7+ messages in thread
From: Fred Isaman @ 2012-12-13 14:10 UTC (permalink / raw)
  To: Lukas Hejtmanek; +Cc: linux-nfs

On Thu, Dec 13, 2012 at 8:35 AM, Lukas Hejtmanek <xhejtman@ics.muni.cz> wrote:
> Hi,
>
> is this option supported and should work?
>
> It seems that in SLES and RHEL kernel, it is ignored:
> mount nfs.server:/ /storage -t nfs4 -o sec=krb5,local_lock=all
>
> cat /proc/mounts  | grep storage
> nfs.server:/ /storage nfs4
> rw,relatime,vers=4,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=krb5,clientaddr=xxx.xxx.xxx.xxx,minorversion=0,local_lock=none,addr=xxx.xxx.xxx.xxx 0 0
>
> and it seems, that it actually tries to lock through NFS.
>
> Has this been fixed in later kernels or this is broken at all?
>
> --

local_lock is a v2/v3 option.  It does not currently effect the behavior of v4.

Fred

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: local_lock mount option
  2012-12-13 14:10 ` Fred Isaman
@ 2012-12-13 14:23   ` Lukas Hejtmanek
  2012-12-13 14:38     ` Fred Isaman
  0 siblings, 1 reply; 7+ messages in thread
From: Lukas Hejtmanek @ 2012-12-13 14:23 UTC (permalink / raw)
  To: Fred Isaman; +Cc: linux-nfs

On Thu, Dec 13, 2012 at 09:10:14AM -0500, Fred Isaman wrote:
> local_lock is a v2/v3 option.  It does not currently effect the behavior of v4.

if I understand correctly source codes, it should:
nfs/file.c:

const struct file_operations nfs4_file_operations = {
[...]
        .lock           = nfs_lock,
        .flock          = nfs_flock,

and nfs_(f)lock contains tests for:
NFS_MOUNT_LOCAL_FCNTL
NFS_MOUNT_LOCAL_FLOCK

but for some reason, it is not propageted from mount call. Dunno why. Or am
I something missing?

-- 
Lukáš Hejtmánek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: local_lock mount option
  2012-12-13 14:23   ` Lukas Hejtmanek
@ 2012-12-13 14:38     ` Fred Isaman
  2012-12-13 14:40       ` Lukas Hejtmanek
  0 siblings, 1 reply; 7+ messages in thread
From: Fred Isaman @ 2012-12-13 14:38 UTC (permalink / raw)
  To: Lukas Hejtmanek; +Cc: linux-nfs

On Thu, Dec 13, 2012 at 9:23 AM, Lukas Hejtmanek <xhejtman@gmail.com> wrote:
> On Thu, Dec 13, 2012 at 09:10:14AM -0500, Fred Isaman wrote:
>> local_lock is a v2/v3 option.  It does not currently effect the behavior of v4.
>
> if I understand correctly source codes, it should:
> nfs/file.c:
>
> const struct file_operations nfs4_file_operations = {
> [...]
>         .lock           = nfs_lock,
>         .flock          = nfs_flock,
>
> and nfs_(f)lock contains tests for:
> NFS_MOUNT_LOCAL_FCNTL
> NFS_MOUNT_LOCAL_FLOCK
>
> but for some reason, it is not propageted from mount call. Dunno why. Or am
> I something missing?
>
> --
> Lukáš Hejtmánek

It is turned off here:

static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args)
{
	args->flags &= ~(NFS_MOUNT_NONLM|NFS_MOUNT_NOACL|NFS_MOUNT_VER3|
			 NFS_MOUNT_LOCAL_FLOCK|NFS_MOUNT_LOCAL_FCNTL);
}

Fred

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: local_lock mount option
  2012-12-13 14:38     ` Fred Isaman
@ 2012-12-13 14:40       ` Lukas Hejtmanek
  2012-12-13 14:48         ` Fred Isaman
  0 siblings, 1 reply; 7+ messages in thread
From: Lukas Hejtmanek @ 2012-12-13 14:40 UTC (permalink / raw)
  To: Fred Isaman; +Cc: linux-nfs

On Thu, Dec 13, 2012 at 09:38:04AM -0500, Fred Isaman wrote:
> It is turned off here:
> 
> static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args)
> {
> 	args->flags &= ~(NFS_MOUNT_NONLM|NFS_MOUNT_NOACL|NFS_MOUNT_VER3|
> 			 NFS_MOUNT_LOCAL_FLOCK|NFS_MOUNT_LOCAL_FCNTL);
> }

ok, thanks. Is there any reason for this? I need to turn of locks for NFSv4 as
they seem to not work properly with NFS server on CXFS.

-- 
Lukáš Hejtmánek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: local_lock mount option
  2012-12-13 14:40       ` Lukas Hejtmanek
@ 2012-12-13 14:48         ` Fred Isaman
  2012-12-13 14:56           ` Lukas Hejtmanek
  0 siblings, 1 reply; 7+ messages in thread
From: Fred Isaman @ 2012-12-13 14:48 UTC (permalink / raw)
  To: Lukas Hejtmanek; +Cc: linux-nfs

On Thu, Dec 13, 2012 at 9:40 AM, Lukas Hejtmanek <xhejtman@gmail.com> wrote:
> On Thu, Dec 13, 2012 at 09:38:04AM -0500, Fred Isaman wrote:
>> It is turned off here:
>>
>> static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args)
>> {
>>       args->flags &= ~(NFS_MOUNT_NONLM|NFS_MOUNT_NOACL|NFS_MOUNT_VER3|
>>                        NFS_MOUNT_LOCAL_FLOCK|NFS_MOUNT_LOCAL_FCNTL);
>> }
>
> ok, thanks. Is there any reason for this? I need to turn of locks for NFSv4 as
> they seem to not work properly with NFS server on CXFS.
>
> --
> Lukáš Hejtmánek

The idea is that delegations are a better way to decide whether the
client should cache locks.

Fred

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: local_lock mount option
  2012-12-13 14:48         ` Fred Isaman
@ 2012-12-13 14:56           ` Lukas Hejtmanek
  0 siblings, 0 replies; 7+ messages in thread
From: Lukas Hejtmanek @ 2012-12-13 14:56 UTC (permalink / raw)
  To: Fred Isaman; +Cc: linux-nfs

On Thu, Dec 13, 2012 at 09:48:25AM -0500, Fred Isaman wrote:
> The idea is that delegations are a better way to decide whether the
> client should cache locks.

well, but I need to fake locks on client, i.e., client's lock always succeeds
independently of NFS server. I know that's wrong approchach but until I got
fix for NFS+CXFS, I dont' see any other option. And I believe that
local_locks=any does exactly what I need.

-- 
Lukáš Hejtmánek

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-12-13 14:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-13 13:35 local_lock mount option Lukas Hejtmanek
2012-12-13 14:10 ` Fred Isaman
2012-12-13 14:23   ` Lukas Hejtmanek
2012-12-13 14:38     ` Fred Isaman
2012-12-13 14:40       ` Lukas Hejtmanek
2012-12-13 14:48         ` Fred Isaman
2012-12-13 14:56           ` Lukas Hejtmanek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).