[Crash-utility] [PATCH v3 03/10] check LOCAL_ACTIVE() rather than ACTIVE() in memory_source_init() path

Oleg Nesterov oleg at redhat.com
Fri Apr 29 16:22:25 UTC 2016


Change fd_init() and memory_source_init() to check LOCAL_ACTIVE(). We need
this for the last patch in series.

The 1st change is obviously safe, fd_init() sets LIVE_SYSTEM | MEMSRC_LOCAL
and nobody else can set LIVE_SYSTEM if we get here.

The 2nd one should be correct even if REMOTE() is true, we check MEMSRC_LOCAL
at the start of memory_source_init().
---
 filesys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/filesys.c b/filesys.c
index 9ea8f7e..3b2ce05 100644
--- a/filesys.c
+++ b/filesys.c
@@ -135,7 +135,7 @@ fd_init(void)
 			pc->nfd = -1;
 		}
 
-		if (ACTIVE() && !(pc->namelist_debug || pc->system_map)) {
+		if (LOCAL_ACTIVE() && !(pc->namelist_debug || pc->system_map)) {
 			memory_source_init();
 			match_proc_version();
 		}
@@ -169,7 +169,7 @@ memory_source_init(void)
 	if (pc->flags & KERNEL_DEBUG_QUERY)
 		return;
 
-        if (ACTIVE()) {
+        if (LOCAL_ACTIVE()) {
 		if (pc->mfd != -1)  /* already been here */
 			return;
 
-- 
2.5.0




More information about the Crash-utility mailing list