From: Patrick Donnelly Date: Sat, 7 Mar 2020 03:19:49 +0000 (-0800) Subject: mds: skip export of empty directories X-Git-Tag: v17.0.0~1965^2~17 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=570e6cfbcfc98f877a0e21cf536dfc826a4f9d15;p=ceph.git mds: skip export of empty directories Note: empty as in no cached sub-entries. Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index f752007045258..e4de95ec0f465 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -145,7 +145,12 @@ void MDBalancer::handle_export_pins(void) dir->state_set(CDir::STATE_AUXSUBTREE); } } else { - mds->mdcache->migrator->export_dir(dir, export_pin); + /* Only export a directory if it's non-empty. An empty directory will + * be sent back by the importer. + */ + if (dir->get_num_head_items() > 0) { + mds->mdcache->migrator->export_dir(dir, export_pin); + } remove = false; } }