masaori335 commented on code in PR #13608:
URL: https://github.com/apache/trafficserver/pull/13608#discussion_r4023444373
##########
src/iocore/cache/CacheDir.cc:
##########
@@ -683,21 +671,17 @@ Directory::remove(const CacheKey *key, StripeSM *stripe,
Dir *del)
int b = key->slice32(1) % this->buckets;
Dir *seg = this->get_segment(s);
Dir *e = nullptr, *p = nullptr;
-#ifdef LOOP_CHECK_MODE
- int loop_count = 0;
-#endif
CHECK_DIR(vol);
e = dir_bucket(b, seg);
if (dir_offset(e)) {
+ int loop_count = 0;
do {
-#ifdef LOOP_CHECK_MODE
- loop_count++;
- if (loop_count > DIR_LOOP_THRESHOLD) {
- if (this->bucket_loop_fix(dir_bucket(b, seg), s))
- return 0;
+ // Past the longest legitimate chain, so this is provably a cycle.
+ if (++loop_count > this->max_bucket_depth()) {
+ this->bucket_loop_fix(dir_bucket(b, seg), s);
Review Comment:
Fixed by
[8c29ff0](https://github.com/apache/trafficserver/pull/13608/commits/8c29ff0b16aad9cffdcf16fc11b954e5be63bb53)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]