- Add missing RWLock protection around accessing subscriberDataPathFlowIDMap.
- Rename clearFlowFromResourceManager as clearFlowFromDeviceAndResourceManager for clarity
- Start 3.0.1-dev version.

Change-Id: I695a526a819005d4f4724869d2bdfab917ae5b12
diff --git a/VERSION b/VERSION
index 4a36342..05d78bc 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.0.0
+3.0.1-dev
diff --git a/internal/pkg/core/openolt_flowmgr.go b/internal/pkg/core/openolt_flowmgr.go
index b936a90..e1bc9aa 100644
--- a/internal/pkg/core/openolt_flowmgr.go
+++ b/internal/pkg/core/openolt_flowmgr.go
@@ -1940,7 +1940,7 @@
 }
 
 // nolint: gocyclo
-func (f *OpenOltFlowMgr) clearFlowFromResourceManager(ctx context.Context, flow *ofp.OfpFlowStats, flowDirection string) error {
+func (f *OpenOltFlowMgr) clearFlowFromDeviceAndResourceManager(ctx context.Context, flow *ofp.OfpFlowStats, flowDirection string) error {
 	var flowInfo *rsrcMgr.FlowInfo
 	logger.Infow(ctx, "clear-flow-from-resource-manager",
 		log.Fields{
@@ -2047,7 +2047,9 @@
 			}
 
 			keySymm := subscriberDataPathFlowIDKey{intfID: Intf, onuID: uint32(onuID), uniID: uint32(uniID), direction: inverseDirection, tpID: tpID}
+			f.subscriberDataPathFlowIDMapLock.Lock()
 			delete(f.subscriberDataPathFlowIDMap, keySymm)
+			f.subscriberDataPathFlowIDMapLock.Unlock()
 		}
 	}
 	return nil
@@ -2077,7 +2079,7 @@
 
 	if flows.HasGroup(flow) {
 		direction = Multicast
-		return f.clearFlowFromResourceManager(ctx, flow, direction)
+		return f.clearFlowFromDeviceAndResourceManager(ctx, flow, direction)
 	} else if IsUpstream(actionInfo[Output].(uint32)) {
 		direction = Upstream
 	} else {
@@ -2093,7 +2095,7 @@
 
 	// Serialize flow removes on a per subscriber basis
 	if f.perUserFlowHandleLock.TryLock(userKey) {
-		err = f.clearFlowFromResourceManager(ctx, flow, direction) //TODO: Take care of the limitations
+		err = f.clearFlowFromDeviceAndResourceManager(ctx, flow, direction)
 		f.perUserFlowHandleLock.Unlock(userKey)
 	} else {
 		// Ideally this should never happen