From: David Mair 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: b/memory.c =================================================================== --- a/memory.c +++ b/memory.c @@ -2442,8 +2442,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()) { @@ -2451,6 +2449,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: