From 8f92b1dacc660c93d2375b6ef4c2089f732505e1 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Fri, 29 Nov 2024 01:42:28 -0500 Subject: [PATCH] BeesRangePair: drop the _really_ expensive toxic extent workaround We were doing a `LOGICAL_INO` ioctl on every _block_ of a matching extent, just to see how long it takes. It takes a while! This could be modified to do an ioctl with the `IGNORE_OFFSET` flag, once per new extent, but the kernel bug was fixed a long time ago, so we can start removing all the toxic extent code. Signed-off-by: Zygo Blaxell --- src/bees-types.cc | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/bees-types.cc b/src/bees-types.cc index 9be56cf..bd89c4b 100644 --- a/src/bees-types.cc +++ b/src/bees-types.cc @@ -406,17 +406,6 @@ BeesRangePair::grow(shared_ptr ctx, bool constrained) break; } - // Source extent cannot be toxic - BeesAddress first_addr(first.fd(), new_first.begin()); - if (!first_addr.is_magic()) { - auto first_resolved = ctx->resolve_addr(first_addr); - if (first_resolved.is_toxic()) { - BEESLOGWARN("WORKAROUND: not growing matching pair backward because src addr is toxic:\n" << *this); - BEESCOUNT(pairbackward_toxic_addr); - break; - } - } - // Extend second range. If we hit BOF we can go no further. BeesFileRange new_second = second; BEESTRACE("new_second = " << new_second); @@ -452,6 +441,7 @@ BeesRangePair::grow(shared_ptr ctx, bool constrained) } // Source block cannot be zero in a non-compressed non-magic extent + BeesAddress first_addr(first.fd(), new_first.begin()); if (first_bbd.is_data_zero() && !first_addr.is_magic() && !first_addr.is_compressed()) { BEESCOUNT(pairbackward_zero); break; @@ -509,17 +499,6 @@ BeesRangePair::grow(shared_ptr ctx, bool constrained) break; } - // Source extent cannot be toxic - BeesAddress first_addr(first.fd(), new_first.begin()); - if (!first_addr.is_magic()) { - auto first_resolved = ctx->resolve_addr(first_addr); - if (first_resolved.is_toxic()) { - BEESLOGWARN("WORKAROUND: not growing matching pair forward because src is toxic:\n" << *this); - BEESCOUNT(pairforward_toxic); - break; - } - } - // Extend second range. If we hit EOF we can go no further. BeesFileRange new_second = second; BEESTRACE("new_second = " << new_second); @@ -563,6 +542,7 @@ BeesRangePair::grow(shared_ptr ctx, bool constrained) } // Source block cannot be zero in a non-compressed non-magic extent + BeesAddress first_addr(first.fd(), new_first.begin()); if (first_bbd.is_data_zero() && !first_addr.is_magic() && !first_addr.is_compressed()) { BEESCOUNT(pairforward_zero); break;