Index: uspace/srv/bd/hr/raid1.c
===================================================================
--- uspace/srv/bd/hr/raid1.c	(revision b8409b9c4af46ca08e0a3c04c51cfa85776b5671)
+++ uspace/srv/bd/hr/raid1.c	(revision f81960c5dd5ffc19dec3d22be6176802972b2639)
@@ -55,5 +55,5 @@
 static errno_t hr_raid1_check_vol_status(hr_volume_t *);
 static errno_t hr_raid1_update_vol_status(hr_volume_t *);
-static void handle_extent_error(hr_volume_t *, size_t, errno_t);
+static void hr_raid1_handle_extent_error(hr_volume_t *, size_t, errno_t);
 static errno_t hr_raid1_bd_op(hr_bd_op_type_t, bd_srv_t *, aoff64_t, size_t,
     void *, const void *, size_t);
@@ -268,5 +268,5 @@
 }
 
-static void handle_extent_error(hr_volume_t *vol, size_t extent,
+static void hr_raid1_handle_extent_error(hr_volume_t *vol, size_t extent,
     errno_t rc)
 {
@@ -310,5 +310,5 @@
 			rc = block_sync_cache(vol->extents[i].svc_id, ba, cnt);
 			if (rc != EOK && rc != ENOTSUP)
-				handle_extent_error(vol, i, rc);
+				hr_raid1_handle_extent_error(vol, i, rc);
 			else
 				successful++;
@@ -322,5 +322,5 @@
 			    data_read);
 			if (rc != EOK) {
-				handle_extent_error(vol, i, rc);
+				hr_raid1_handle_extent_error(vol, i, rc);
 			} else {
 				successful++;
@@ -345,5 +345,5 @@
 			    data_write);
 			if (rc != EOK)
-				handle_extent_error(vol, i, rc);
+				hr_raid1_handle_extent_error(vol, i, rc);
 			else
 				successful++;
@@ -434,5 +434,4 @@
 
 	hr_extent_t *ext;
-	size_t rebuild_ext_idx = bad;
 
 	size_t cnt;
@@ -448,5 +447,5 @@
 				    buf);
 				if (rc != EOK) {
-					handle_extent_error(vol, i, rc);
+					hr_raid1_handle_extent_error(vol, i, rc);
 					if (i + 1 < vol->dev_no) {
 						/* still might have one ONLINE */
@@ -465,7 +464,8 @@
 		rc = block_write_direct(hotspare->svc_id, ba, cnt, buf);
 		if (rc != EOK) {
-			handle_extent_error(vol, rebuild_ext_idx, rc);
-			HR_ERROR("rebuild on \"%s\" (%lu), extent number %lu\n",
-			    vol->devname, vol->svc_id, rebuild_ext_idx);
+			hr_raid1_handle_extent_error(vol, bad, rc);
+			HR_ERROR("rebuild on \"%s\" (%lu), failed due to "
+			    "the rebuilt extent number %lu failing\n",
+			    vol->devname, vol->svc_id, bad);
 			goto end;
 
@@ -479,5 +479,5 @@
 	    "extent number %lu\n", vol->devname, vol->svc_id, hotspare_idx);
 
-	hr_update_ext_status(vol, hotspare_idx, HR_EXT_ONLINE);
+	hr_update_ext_status(vol, bad, HR_EXT_ONLINE);
 	/*
 	 * For now write metadata at the end, because
