@@ -158,6 +158,12 @@ func clearMountpoint(path string) {
158158 delete (mountpointMap , path )
159159}
160160
161+ func clearSupportsQuotas (path string ) {
162+ supportsQuotasLock .Lock ()
163+ defer supportsQuotasLock .Unlock ()
164+ delete (supportsQuotasMap , path )
165+ }
166+
161167// getFSInfo Returns mountpoint and backing device
162168// getFSInfo should cache the mountpoint and backing device for the
163169// path.
@@ -430,7 +436,7 @@ func ClearQuota(m mount.Interface, path string, userNamespacesEnabled bool) erro
430436 // stale directory, so if we find a quota, just remove it.
431437 // The process of clearing the quota requires that an applier
432438 // be found, which needs to be cleaned up.
433- defer delete ( supportsQuotasMap , path )
439+ defer clearSupportsQuotas ( path )
434440 defer clearApplier (path )
435441 return clearQuotaOnDir (m , path , userNamespacesEnabled )
436442 }
@@ -467,7 +473,7 @@ func ClearQuota(m mount.Interface, path string, userNamespacesEnabled bool) erro
467473 }
468474 delete (dirPodMap , path )
469475 delete (dirQuotaMap , path )
470- delete ( supportsQuotasMap , path )
476+ clearSupportsQuotas ( path )
471477 clearApplier (path )
472478 if err != nil {
473479 return fmt .Errorf ("unable to clear quota for %s: %v" , path , err )
0 commit comments