From bf2a01460728ab1f49609cb2a2e1c86634b183c2 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Thu, 22 Nov 2018 20:58:57 -0500 Subject: [PATCH] roots: improve "RO root 6094" message This sequence of log messages isn't clear: crawl_master: WORKAROUND: Avoiding RO subvol 6094 crawl_master: WORKAROUND: RO root 6094 The first is from a cache miss, and appears wherever a root is opened (dedupe or crawl). The second is skipping an entire subvol scan, and only happens in crawl_master. Elaborate on the second message a little. Also use the term "root" consistently when referring to subvol tree IDs. btrfs refers to these objects by (at least) three distinct names: tree, subvol, and root. Using three different words for the same thing is worse than using a single wrong word consistently to refer to the same concept. Signed-off-by: Zygo Blaxell --- src/bees-context.cc | 2 +- src/bees-roots.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bees-context.cc b/src/bees-context.cc index 1e53659..127c051 100644 --- a/src/bees-context.cc +++ b/src/bees-context.cc @@ -193,7 +193,7 @@ BeesContext::dedup(const BeesRangePair &brp) brp.second.fd(shared_from_this()); if (is_root_ro(brp.second.fid().root())) { - // BEESLOGDEBUG("WORKAROUND: dst subvol is read-only in " << name_fd(brp.second.fd())); + // BEESLOGDEBUG("WORKAROUND: dst root is read-only in " << name_fd(brp.second.fd())); BEESCOUNT(dedup_workaround_btrfs_send); return false; } diff --git a/src/bees-roots.cc b/src/bees-roots.cc index f536f9a..7b9c5cd 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -699,7 +699,7 @@ BeesRoots::is_root_ro_nocache(uint64_t root) uint64_t flags = 0; DIE_IF_NON_ZERO(ioctl(root_fd, BTRFS_IOC_SUBVOL_GETFLAGS, &flags)); if (flags & BTRFS_SUBVOL_RDONLY) { - BEESLOGDEBUG("WORKAROUND: Avoiding RO subvol " << root); + BEESLOGDEBUG("WORKAROUND: Avoiding RO root " << root); BEESCOUNT(root_workaround_btrfs_send); return true; } @@ -947,7 +947,7 @@ BeesCrawl::fetch_extents() // is ever switched back to read-write, it won't trigger big // expensive in-kernel searches for ancient transids. if (m_ctx->is_root_ro(old_state.m_root)) { - BEESLOGDEBUG("WORKAROUND: RO root " << old_state.m_root); + BEESLOGDEBUG("WORKAROUND: skipping scan of RO root " << old_state.m_root); BEESCOUNT(root_workaround_btrfs_send); return next_transid(); }