goto out;
}
- /* Open the dir, let the kernel try to reconnect it to the root. */
+ /*
+ * Warn about naming problems in the directory entries. Opening the
+ * dir by handle means the kernel will try to reconnect it to the root.
+ * If the reconnection fails due to corruption in the parents we get
+ * ESTALE, which is why we skip phase 5 if we found corruption.
+ */
if (S_ISDIR(bstat->bs_mode)) {
fd = scrub_open_handle(handle);
if (fd < 0) {
str_errno(ctx, descr_render(&dsc));
goto out;
}
- }
- /* Warn about naming problems in the directory entries. */
- if (fd >= 0 && S_ISDIR(bstat->bs_mode)) {
error = check_dirent_names(ctx, &dsc, &fd, bstat);
if (error)
goto out;