From 862e6409cb6929e1eb235a9156fbf6cbc4719236 Mon Sep 17 00:00:00 2001 From: Sanju Rakonde Date: Mon, 4 Feb 2019 14:17:16 +0530 Subject: glusterd: adding a comment for code readability Adding a comment in the source code, so that anyone reading the code will understand the changes done by d4fa29 better. fixes: bz#1654270 Change-Id: I75aff4243420c434c47d69a4b310f77bf161bb29 Signed-off-by: Sanju Rakonde --- glusterfsd/src/glusterfsd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 9ee88b6d57b..8d3c71e8988 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -1642,6 +1642,16 @@ cleanup_and_exit(int signum) #endif trav = NULL; + + /* previously we were releasing the cleanup mutex lock before the + process exit. As we are releasing the cleanup mutex lock, before + the process can exit some other thread which is blocked on + cleanup mutex lock is acquiring the cleanup mutex lock and + trying to acquire some resources which are already freed as a + part of cleanup. To avoid this, we are exiting the process without + releasing the cleanup mutex lock. This will not cause any lock + related issues as the process which acquired the lock is going down + */ /* NOTE: Only the least significant 8 bits i.e (signum & 255) will be available to parent process on calling exit() */ exit(abs(signum)); -- cgit