]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: fix owner check of file lock 1410/head
authorYan, Zheng <zheng.z.yan@intel.com>
Sun, 9 Mar 2014 23:36:14 +0000 (07:36 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Tue, 11 Mar 2014 01:45:43 +0000 (09:45 +0800)
commitd3e3df7ad792c55e73d481dd31f5a85070c603ac
tree1efde2d42396cd5dc439b26fd17120d9175bb3bc
parent83731a75d7f29778dafff5e08a3ebc5da1498665
mds: fix owner check of file lock

flock and posix lock do not use process ID as owner identifier.
The process ID of who holds the lock is just for F_GETLK fcntl(2).
For linux kernel, File lock's owner identifier is the file pointer
through which the lock is requested.

The fix is do not take the 'pid_namespace' into consideration when
checking conflict locks. Also rename the 'pid' fields of struct
ceph_mds_request_args and struct ceph_filelock to 'owner', rename
'pid_namespace' fields to 'pid'.

The kclient counterpart of this patch modifies the flock code to
assign the file pointer to the 'owner' field of lock message. It
also set the most significant bit of the 'owner' field. We can use
that bit to distinguish between old and new clients.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/include/ceph_fs.h
src/mds/Server.cc
src/mds/flock.cc
src/mds/flock.h
src/messages/MClientRequest.h
wireshark/ceph/ceph_fs.h