File crash-stop_read_error_when_intent_is_retry.patch of Package crash

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.

---

Index: crash-7.2.8/memory.c
===================================================================
--- crash-7.2.8.orig/memory.c
+++ crash-7.2.8/memory.c
@@ -2320,8 +2320,6 @@ 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()) {
@@ -2329,6 +2327,8 @@ readmem(ulonglong addr, int memtype, voi
 				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