]> git.hungrycats.org Git - bees/commitdiff
BeesRangePair: drop the _really_ expensive toxic extent workaround
authorZygo Blaxell <bees@furryterror.org>
Fri, 29 Nov 2024 06:42:28 +0000 (01:42 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sun, 1 Dec 2024 04:30:33 +0000 (23:30 -0500)
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 <bees@furryterror.org>
src/bees-types.cc

index 9be56cf812843c1c0f76e3a1dd9cff6bd9fe1df5..bd89c4b78512a183fe56150e5e6b1f989f37a348 100644 (file)
@@ -406,17 +406,6 @@ BeesRangePair::grow(shared_ptr<BeesContext> 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<BeesContext> 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<BeesContext> 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<BeesContext> 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;