]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mds: fix file existing check in Server::handle_client_openc()
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 10 Dec 2012 07:43:44 +0000 (15:43 +0800)
committerSage Weil <sage@inktank.com>
Mon, 24 Dec 2012 04:01:12 +0000 (20:01 -0800)
commitefbca31d3bb94f173352b527bca6d1ebf9e6b0fb
treec4b1f6fb07d70381bedb587b6cd413de2666358a
parentf5e86ecbd225c173c4e48fd890dc8954be58dbf0
mds: fix file existing check in Server::handle_client_openc()

Creating new file needs to be handled by directory fragment's auth
MDS, opening existing file in write mode needs to be handled by
corresponding inode's auth MDS. If a file is remote link, its parent
directory fragment's auth MDS can be different from corresponding
inode's auth MDS. So which MDS to handle create file request can be
affected by if the corresponding file already exists.

handle_client_openc() calls rdlock_path_xlock_dentry() at the very
beginning. It always assumes the request needs to be handled by
directory fragment's auth MDS. When handling a create file request,
if the file already exists and remotely linked to a non-auth inode,
handle_client_openc() falls back to handle_client_open(),
handle_client_open() forwards the request because the MDS is not
inode's auth MDS. Then when the request arrives at inode's auth MDS,
rdlock_path_xlock_dentry() is called, it will forward the request
back.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/MDCache.cc
src/mds/Server.cc