summaryrefslogtreecommitdiffstats
path: root/user_channel
diff options
context:
space:
mode:
authorRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2019-09-01 23:02:47 +0530
committerVernon Mauery <vernon.mauery@linux.intel.com>2019-09-24 15:42:05 +0000
commite91474cf7b023393594dc47bc0f2aaf4b8d5c72e (patch)
tree4c0e5838f24b3fb80abfad4672ce442b650f67a0 /user_channel
parent0e862fabcc4772ec8f98c60ed3ddd004f785b6ce (diff)
downloadphosphor-host-ipmid-e91474cf7b023393594dc47bc0f2aaf4b8d5c72e.tar.gz
phosphor-host-ipmid-e91474cf7b023393594dc47bc0f2aaf4b8d5c72e.zip
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 <richard.marian.thomaiyar@linux.intel.com>
Diffstat (limited to 'user_channel')
-rw-r--r--user_channel/channel_mgmt.cpp3
1 files changed, 3 insertions, 0 deletions
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<boost::interprocess::named_recursive_mutex>
+ channelLock{*channelMutex};
+
/* Always read the channel config */
if (loadChannelConfig() != 0)
{
OpenPOWER on IntegriCloud