summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0007-Fix-unmounting-image-in-proxy-mode.patch
blob: 88fa894650688c104b85ce8e527ffe34cbdd3487 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 6f4b5fc1879f39b0f5fee0838f0ecbc481275d5e Mon Sep 17 00:00:00 2001
From: Alicja Rybak <alicja.rybak@intel.com>
Date: Fri, 23 Apr 2021 17:35:52 +0200
Subject: [PATCH] Fix unmounting image in proxy mode.

Sometimes Slot0 got higher key than Slot1 and erase function for Slot1
invalidates elements with keys not less than the erased element.
In that case invalid slot0 will be unmounted.
Change order of calling close() and erase() functions to
unmount correct device.

Change-Id: I7a40a4518982f697d3eed635cde6d06978149cf0
Signed-off-by: Alicja Rybak <alicja.rybak@intel.com>
---
 include/nbd_proxy.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp
index 3b28823..897bcf2 100644
--- a/include/nbd_proxy.hpp
+++ b/include/nbd_proxy.hpp
@@ -439,9 +439,9 @@ inline void requestRoutes(App& app)
                     BMCWEB_LOG_DEBUG << "No session to close";
                     return;
                 }
+                session->second->close();
                 // Remove reference to session in global map
                 sessions.erase(session);
-                session->second->close();
             })
         .onmessage([](crow::websocket::Connection& conn,
                       const std::string& data, bool) {
-- 
2.17.1