From 94311e4997fa29e5f19f8d577365010b0e61de49 Mon Sep 17 00:00:00 2001 From: Liu Jiang Date: Mon, 2 Dec 2019 15:52:47 +0800 Subject: [PATCH] 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 --- src/agent/src/sandbox.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/agent/src/sandbox.rs b/src/agent/src/sandbox.rs index 9da20c4f07..b669141874 100644 --- a/src/agent/src/sandbox.rs +++ b/src/agent/src/sandbox.rs @@ -103,8 +103,9 @@ impl Sandbox { *count -= 1; if *count < 1 { self.storages.remove(path); + return true; } - return true; + false } } }