From e91474cf7b023393594dc47bc0f2aaf4b8d5c72e Mon Sep 17 00:00:00 2001 From: Richard Marian Thomaiyar Date: Sun, 1 Sep 2019 23:02:47 +0530 Subject: Channel: Fix atomic lock issue for file copy Atomic lock was missing in between volatile / non-volatile channel configuration check and restore. This was causing random failure when instances init channel management code. Fixed the same, by having a lock for init channel. Tested: 1. Verified that existing ipmitool commands still works including user & channel commands 2. Verified that random failure doesn't happen. Change-Id: I612917ea1a767e353d0b16b7dd9144e0e99d46e7 Signed-off-by: Richard Marian Thomaiyar --- user_channel/channel_mgmt.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user_channel') diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp index 008ffd9..f2a6354 100644 --- a/user_channel/channel_mgmt.cpp +++ b/user_channel/channel_mgmt.cpp @@ -1341,6 +1341,9 @@ int ChannelConfig::syncNetworkChannelConfig() void ChannelConfig::initChannelPersistData() { + boost::interprocess::scoped_lock + channelLock{*channelMutex}; + /* Always read the channel config */ if (loadChannelConfig() != 0) { -- cgit v1.2.1