summaryrefslogtreecommitdiffstats
path: root/src/tools/cephfs/DataScan.cc
diff options
context:
space:
mode:
authorJohn Spray <john.spray@redhat.com>2016-01-06 13:01:04 +0100
committerJohn Spray <john.spray@redhat.com>2016-03-03 19:35:54 +0100
commit434ba9a44b106490c5e6f79763324f822877c91f (patch)
tree914fe3298e5be389537721e1a494275183cd488c /src/tools/cephfs/DataScan.cc
parentmds: enable dirs to go complete with corrupt dentries (diff)
downloadceph-434ba9a44b106490c5e6f79763324f822877c91f.tar.xz
ceph-434ba9a44b106490c5e6f79763324f822877c91f.zip
tools: create mdsdir frag in cephfs-data-scan init
MDS used to ignore missing dirfrag objects. Now that they're detected and flagged, we need to explicitly inject them during disaster recovery in order to have a working filesystem. (Specifically, this is needed because in CDir::_go_bad we used to finish_waiting(WAIT_COMPLETE, 0), but now we finish_waiting(WAIT_COMPLETE, -EIO)) Signed-off-by: John Spray <john.spray@redhat.com>
Diffstat (limited to 'src/tools/cephfs/DataScan.cc')
-rw-r--r--src/tools/cephfs/DataScan.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/cephfs/DataScan.cc b/src/tools/cephfs/DataScan.cc
index 0a992a32e8f..1deabbdd878 100644
--- a/src/tools/cephfs/DataScan.cc
+++ b/src/tools/cephfs/DataScan.cc
@@ -329,6 +329,11 @@ int MetadataDriver::init_roots(int64_t data_pool_id)
if (r != 0) {
return r;
}
+ bool created = false;
+ r = find_or_create_dirfrag(MDS_INO_MDSDIR(0), frag_t(), &created);
+ if (r != 0) {
+ return r;
+ }
return 0;
}