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

Oleg Nesterov oleg at redhat.com
Mon Apr 25 14:48:55 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 a9f54b1..de04486 100644
--- a/filesys.c
+++ b/filesys.c
@@ -134,7 +134,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();
 		}
@@ -168,7 +168,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