From e28c1b46e9944f0215a13cab8ee7dded88d7fc90 Mon Sep 17 00:00:00 2001
From: Callum Prentice <callum@lindenlab.com>
Date: Tue, 20 Jul 2021 15:03:22 -0700
Subject: [PATCH] Speculative fix for SL-15547: Viewer hung while looking for a
 file in the cache - since I am unable to repro, this might be enough

---
 indra/llfilesystem/llfilesystem.cpp | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp
index da44e8d98c2..b029723e118 100644
--- a/indra/llfilesystem/llfilesystem.cpp
+++ b/indra/llfilesystem/llfilesystem.cpp
@@ -165,11 +165,14 @@ BOOL LLFileSystem::read(U8* buffer, S32 bytes)
         }
     }
 
-    // update the last access time for the file - this is required
-    // even though we are reading and not writing because this is the
-    // way the cache works - it relies on a valid "last accessed time" for
-    // each file so it knows how to remove the oldest, unused files
-    LLDiskCache::getInstance()->updateFileAccessTime(filename);
+    if (success == TRUE)
+    {
+        // update the last access time for the file - this is required
+        // even though we are reading and not writing because this is the
+        // way the cache works - it relies on a valid "last accessed time" for
+        // each file so it knows how to remove the oldest, unused files
+        LLDiskCache::getInstance()->updateFileAccessTime(filename);
+    }
 
     return success;
 }
-- 
GitLab