From 8d04a7ece364c0a95b087990d6365401819b3efa Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 15 May 2014 20:53:27 -0700 Subject: [PATCH] HashIndex: in cleanup, interpret missing dir as completed merge If we stop between unlinking the empty subdir and removing the root merge marker, we get ENOENT on the get_info. That's actually fine. Backport: firefly Fixes: 8332 Signed-off-by: Samuel Just (cherry picked from commit 5ff95dbdd2dbb533d344f37fea722ca4f140e670) --- src/os/HashIndex.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/os/HashIndex.cc b/src/os/HashIndex.cc index d556cbc766139..35cb49bbe0013 100644 --- a/src/os/HashIndex.cc +++ b/src/os/HashIndex.cc @@ -36,8 +36,12 @@ int HashIndex::cleanup() { InProgressOp in_progress(i); subdir_info_s info; r = get_info(in_progress.path, &info); - if (r < 0) + if (r == -ENOENT) { + return end_split_or_merge(in_progress.path); + } else if (r < 0) { return r; + } + if (in_progress.is_split()) return complete_split(in_progress.path, info); else if (in_progress.is_merge()) -- 2.39.5