From cf25bd74b082b8334434e8726ff4fe2f18b9dba9 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Fri, 24 Jan 2020 08:37:57 +0100 Subject: [PATCH] qcow: Fix map_err losing the inner error Signed-off-by: Sebastien Boeuf --- qcow/src/qcow.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qcow/src/qcow.rs b/qcow/src/qcow.rs index a0a0cf7d9..9099f0f9f 100755 --- a/qcow/src/qcow.rs +++ b/qcow/src/qcow.rs @@ -1221,7 +1221,12 @@ impl QcowFile { let refcount = self .refcounts .get_cluster_refcount(&mut self.raw_file, cluster_addr) - .map_err(|_| std::io::Error::from_raw_os_error(EINVAL))?; + .map_err(|e| { + io::Error::new( + io::ErrorKind::InvalidData, + format!("failed to get cluster refcount: {}", e), + ) + })?; if refcount == 0 { return Err(std::io::Error::from_raw_os_error(EINVAL)); }