mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-08 03:24:15 +00:00
agent: fix wrong return value of set_sandbox_storage()
Function set_sandbox_storage() is designed to return true when the reference count drops from 1 to 0. But current implementation always return true no matter the reference count is, which may cause removing an in use mountpoint. Fixes: #88 Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
This commit is contained in:
parent
b1748323f0
commit
94311e4997
@ -103,9 +103,10 @@ impl Sandbox {
|
|||||||
*count -= 1;
|
*count -= 1;
|
||||||
if *count < 1 {
|
if *count < 1 {
|
||||||
self.storages.remove(path);
|
self.storages.remove(path);
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user