bneradt commented on issue #12124:
URL: 
https://github.com/apache/trafficserver/issues/12124#issuecomment-2751809511

   @JosiahWI provided the following patch. I built it and deployed it in 
production and vefified that with it ATS starts up stable in our production 
environment:
   
   ```patch
   From 255fe9c5d8363080c851dc24877dbaa64f3bc031 Mon Sep 17 00:00:00 2001
   From: Josiah VanderZee <[email protected]>
   Date: Mon, 24 Mar 2025 18:12:40 -0500
   Subject: [PATCH] Fix narrowing conversion in StripeSM construction
   
   ---
    src/iocore/cache/PreservationTable.cc | 2 +-
    src/iocore/cache/PreservationTable.h  | 2 +-
    src/iocore/cache/StripeSM.cc          | 2 +-
    3 files changed, 3 insertions(+), 3 deletions(-)
   
   diff --git a/src/iocore/cache/PreservationTable.cc 
b/src/iocore/cache/PreservationTable.cc
   index f8ad81fde..0c5dc3b71 100644
   --- a/src/iocore/cache/PreservationTable.cc
   +++ b/src/iocore/cache/PreservationTable.cc
   @@ -45,7 +45,7 @@ DbgCtl dbg_ctl_cache_evac{"cache_evac"};
    
    } // namespace
    
   -PreservationTable::PreservationTable(int size) : evacuate_size{(size / 
EVACUATION_BUCKET_SIZE) + 2}
   +PreservationTable::PreservationTable(off_t size) : 
evacuate_size{static_cast<int>(size / EVACUATION_BUCKET_SIZE) + 2}
    {
      ink_assert(size > 0);
      int evac_len   = this->evacuate_size * sizeof(DLL<EvacuationBlock>);
   diff --git a/src/iocore/cache/PreservationTable.h 
b/src/iocore/cache/PreservationTable.h
   index acf762cce..1b55258f0 100644
   --- a/src/iocore/cache/PreservationTable.h
   +++ b/src/iocore/cache/PreservationTable.h
   @@ -110,7 +110,7 @@ public:
       * @param size The total number of directory entries the table must
       * be able to store. The size must be a positive number.
       */
   -  PreservationTable(int size);
   +  PreservationTable(off_t size);
    
      ~PreservationTable();
    
   diff --git a/src/iocore/cache/StripeSM.cc b/src/iocore/cache/StripeSM.cc
   index 0ec046c39..40a3877d2 100644
   --- a/src/iocore/cache/StripeSM.cc
   +++ b/src/iocore/cache/StripeSM.cc
   @@ -117,7 +117,7 @@ StripeSM::StripeSM(CacheDisk *disk, off_t blocks, off_t 
dir_skip, int avg_obj_si
        Stripe{disk, blocks, dir_skip, avg_obj_size, fragment_size},
        fd{disk->fd},
        disk{disk},
   -    _preserved_dirs{static_cast<int>(len)}
   +    _preserved_dirs{len}
    {
      open_dir.mutex = this->mutex;
      SET_HANDLER(&StripeSM::aggWrite);
   -- 
   2.48.1
   ```


-- 
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]

Reply via email to