@@ -21,6 +21,7 @@
#include "read_verify.h"
#include "spacemap.h"
#include "vfs.h"
+#include "common.h"
/*
* Phase 6: Verify data file integrity.
@@ -291,13 +292,14 @@ report_inode_loss(
/* Try to open the inode. */
fd = scrub_open_handle(handle);
if (fd < 0) {
- error = errno;
- if (error == ESTALE)
- return error;
+ /* Handle is stale, try again. */
+ if (errno == ESTALE)
+ return ESTALE;
- str_info(ctx, descr,
-_("Disappeared during read error reporting."));
- return error;
+ str_error(ctx, descr,
+ _("Could not open to report read errors: %s."),
+ strerror(errno));
+ return 0;
}
/* Go find the badness. */
@@ -353,10 +355,18 @@ report_dirent_loss(
fd = openat(dir_fd, dirent->d_name,
O_RDONLY | O_NOATIME | O_NOFOLLOW | O_NOCTTY);
if (fd < 0) {
+ char descr[PATH_MAX + 1];
+
if (errno == ENOENT)
return 0;
- str_errno(ctx, path);
- return errno;
+
+ snprintf(descr, PATH_MAX, "%s/%s", path, dirent->d_name);
+ descr[PATH_MAX] = 0;
+
+ str_error(ctx, descr,
+ _("Could not open to report read errors: %s."),
+ strerror(errno));
+ return 0;
}
/* Go find the badness. */