From 1643d5a4f8f726ce27ac9f5cc8160c34c07c09bb Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Sat, 9 Dec 2017 14:09:24 +0800 Subject: [PATCH] mds: properly eval locks after importing inode We should call Locker:eval() for all imported inodes who have non-zero 'wanted caps'. MDS does not properly handle following case. - client open a inode for read, it send a cap message to MDS.a (the cap message updates 'wanted caps') - MDS.a receive the cap message, the inode is non-auth and is ambiguous auth. MDS.a can not request 'wanted caps' from auth mds. - MDS.a finishes importing the inode from. But no caps are imported and mds_caps_wanted map is empty. The bug can cause read hang. Fixes: http://tracker.ceph.com/issues/22357 Signed-off-by: "Yan, Zheng" (cherry picked from commit debb556076c5685f0d8bb8029a95684b9e552eb8) --- src/mds/Migrator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 6603e4f1a966..9e7caad89472 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -2987,7 +2987,7 @@ void Migrator::decode_import_inode_caps(CInode *in, bool auth_cap, if (auth_cap) ::decode(in->get_mds_caps_wanted(), blp); if (!cap_map.empty() || - (auth_cap && !in->get_mds_caps_wanted().empty())) { + (auth_cap && (in->get_caps_wanted() & ~CEPH_CAP_PIN))) { peer_exports[in].swap(cap_map); in->get(CInode::PIN_IMPORTINGCAPS); } -- 2.47.3