Protect orgmeta with fdent_lock (#1678)

Fixes a crash seen with the CentOS 7 builder and when running with
AddressSanitizer.  Regression introduced by
ac578d188e.  Fixes #1677.
This commit is contained in:
Andrew Gaul 2021-06-13 16:14:24 +09:00 committed by GitHub
parent 7638b5b3e3
commit 4d39ea887e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1323,9 +1323,9 @@ int FdEntity::RowFlush(int fd, const char* tpath, bool force_sync)
} }
int result = 0; int result = 0;
std::string tmppath = path; std::string tmppath = path;
headers_t tmporgmeta = orgmeta;
AutoLock auto_lock(&fdent_lock); AutoLock auto_lock(&fdent_lock);
headers_t tmporgmeta = orgmeta;
// check pseudo fd and its flag // check pseudo fd and its flag
fdinfo_map_t::iterator miter = pseudo_fd_map.find(fd); fdinfo_map_t::iterator miter = pseudo_fd_map.find(fd);