File crash-stop_read_error_when_intent_is_retry.patch of Package crash.7724

From: David Mair <dmair@suse.com>
Date: 2017-05-25 10:27:21 -0600
Subject: Avoid printing a read error for a failed read that can be retried
References: bnc#1038839
Upstream: tbd

When reading a memory image fails it may not be an error if it is still
possible to switch image and retry the read. Fix the error message output
to only occur if no retries are intended.

---
 memory.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/memory.c
+++ b/memory.c
@@ -2237,13 +2237,15 @@ readmem(ulonglong addr, int memtype, voi
                         goto readmem_error;
 
 		case READ_ERROR:
-			if (PRINT_ERROR_MESSAGE)
-				error(INFO, READ_ERRMSG, memtype_string(memtype, 0), addr, type);
 			if ((pc->flags & DEVMEM) && (kt->flags & PRE_KERNEL_INIT) &&
 			    !(error_handle & NO_DEVMEM_SWITCH) && devmem_is_restricted() && 
 			    switch_to_proc_kcore())
 				return(readmem(addr, memtype, bufptr, size,
 					type, error_handle));
+
+			if (PRINT_ERROR_MESSAGE)
+				error(INFO, READ_ERRMSG, memtype_string(memtype, 0), addr, type);
+
 			goto readmem_error;
 
 		case PAGE_EXCLUDED:
openSUSE Build Service is sponsored by