From 4d39ea887e779fe23799d048aa423dc9bc29867b Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 13 Jun 2021 16:14:24 +0900 Subject: [PATCH] Protect orgmeta with fdent_lock (#1678) Fixes a crash seen with the CentOS 7 builder and when running with AddressSanitizer. Regression introduced by ac578d188e811ed6bdc7a29fa3b0c810fc29d739. Fixes #1677. --- src/fdcache_entity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fdcache_entity.cpp b/src/fdcache_entity.cpp index 5b827ae..4c5150f 100644 --- a/src/fdcache_entity.cpp +++ b/src/fdcache_entity.cpp @@ -1323,9 +1323,9 @@ int FdEntity::RowFlush(int fd, const char* tpath, bool force_sync) } int result = 0; std::string tmppath = path; - headers_t tmporgmeta = orgmeta; AutoLock auto_lock(&fdent_lock); + headers_t tmporgmeta = orgmeta; // check pseudo fd and its flag fdinfo_map_t::iterator miter = pseudo_fd_map.find(fd);