]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: acquire scatter locks when exporting dir
authorYan, Zheng <zheng.z.yan@intel.com>
Sun, 12 Jan 2014 10:51:18 +0000 (18:51 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Mon, 17 Feb 2014 01:37:50 +0000 (09:37 +0800)
commit5faa3134a1754892f36ae40f10f809a5a45ad2ad
treed9b91c9eb8ad6f5847c0d7953beef1a3953bbbb2
parent3154ee84fa6ff5d5fdfab29f1b076be01bccca32
mds: acquire scatter locks when exporting dir

If auth MDS of the subtree root inode is neither the exporter MDS
nor the importer MDS and it gathers subtree root's fragstat/neststat
while the subtree is exporting. It's possible that the exporter MDS
and the importer MDS both are auth MDS of the subtree root or both
are not auth MDS of the subtree root at the time they receive the
lock messages. So the auth MDS of the subtree root inode may get no
or duplicated fragstat/neststat for the subtree root dirfrag.

The fix is, during exporting a subtree, both the exporter MDS and
the importer MDS hold locks on scatter locks of the subtree root
inode. For the importer MDS, it tries acquiring locks on the scatter
locks when handling the MExportDirPrep message. If fails to acquire
all locks, it sends a NACK to the exporter MDS. The exporter MDS
cancels the exporting when receiving the NACK.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Migrator.cc
src/mds/Migrator.h
src/messages/MExportDirPrepAck.h