Skip to content

Commit 62e04f9

Browse files
committed
Fixup: only reference m_off when lock is held
1 parent a34223a commit 62e04f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/S3File.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,9 @@ void S3File::S3Cache::Entry::Download(S3File &file) {
984984
// will need to grab the lock to notify of completion. So, we
985985
// must release the lock here before calling a blocking function --
986986
// otherwise deadlock may occur.
987+
auto off = m_off;
987988
m_parent.m_mutex.unlock();
988-
if (!m_request->SendRequest(m_off, m_cache_entry_size)) {
989+
if (!m_request->SendRequest(off, m_cache_entry_size)) {
989990
m_parent.m_mutex.lock();
990991
std::stringstream ss;
991992
ss << "Failed to send GetObject command: "

0 commit comments

Comments
 (0)