Whamcloud - gitweb
LU-104 Properly address ownership of posix and flock locks
authorOleg Drokin <green@whamcloud.com>
Sat, 23 Apr 2011 03:15:37 +0000 (23:15 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 3 May 2011 14:15:23 +0000 (07:15 -0700)
commit3bb8d1b9656994b0313cdba6ad8eeb7b84f5ee9f
treee2a74914e6048dfc2bfb8ca3454cc218bb79ce2e
parent1d0bf2a777010fcc3316be061d7e26367c36f475
LU-104 Properly address ownership of posix and flock locks

This patch fixes the long standing problem where we only relied
on pid to determine lock ownership.

This patch uses kernel-passed fl_owner field for posix lock and
fl_file for flock ownership like it should. This is a wire
protocol change of sorts, but I have compat code in place. Also
introduced a clear separation for on the wire and in-memory
policy representations and ways to convert between them.

This makes nfs4 locking work, also fixes original problem with
flock locking of the same fd from different processes. Makes
our own tests/flock_test.c to pass now which it never did before.

connectathon on nfs4 also passes locally for me now.

Added a flock test that is actually being run now.

Signed-off-by: Oleg Drokin <green@whamcloud.com>
Change-Id: Ifb4f4a0246f34143497225f2b8974f5fd93817a1
Reviewed-on: http://review.whamcloud.com/459
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Hudson
19 files changed:
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_extent.c
lustre/ldlm/ldlm_flock.c
lustre/ldlm/ldlm_inodebits.c
lustre/ldlm/ldlm_internal.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_plain.c
lustre/ldlm/ldlm_request.c
lustre/llite/file.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/tests/Makefile.am
lustre/tests/flock_test.c [deleted file]
lustre/tests/flocks_test.c
lustre/tests/sanity.sh
lustre/utils/wirecheck.c
lustre/utils/wiretest.c