BCF-6552: [REAR] REAR tries to map the disk that has been commented in the disklayout.conf file on the source machine#83
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts ReaR’s migration-mode layout mapping step to avoid aborting recovery when df.txt contains references to disks that were excluded/commented out in the source layout, while keeping strict failures for core layout/config files.
Changes:
- Treat failures applying layout mappings to
$VAR_DIR/layout/config/df.txtas a warning (do not fail the overall mapping step). - Keep hard-failure behavior for
disklayout.conf($LAYOUT_FILE) and/etc/rear/rescue.conf.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| LogPrintError "Failed to apply disk layout mappings to $file_to_migrate" | ||
| applied_mappings_to_all_files="no" | ||
| if [ "$file_to_migrate" = "$original_disk_space_usage_file" ] ; then | ||
| LogPrint "Warning: Failed to apply disk layout mappings to $file_to_migrate (likely due to unmapped excluded disks)." |
There was a problem hiding this comment.
The codebase consistently prefixes warning-level user messages with "WARNING:" (often using LogPrint), but this message uses "Warning:". Consider changing it to match existing wording/format (e.g., "WARNING: Failed …"), to keep log scanning/grep behavior consistent.
| LogPrint "Warning: Failed to apply disk layout mappings to $file_to_migrate (likely due to unmapped excluded disks)." | |
| LogPrint "WARNING: Failed to apply disk layout mappings to $file_to_migrate (likely due to unmapped excluded disks)." |
| LogPrintError "Failed to apply disk layout mappings to $file_to_migrate" | ||
| applied_mappings_to_all_files="no" | ||
| if [ "$file_to_migrate" = "$original_disk_space_usage_file" ] ; then | ||
| LogPrint "Warning: Failed to apply disk layout mappings to $file_to_migrate (likely due to unmapped excluded disks)." |
There was a problem hiding this comment.
The warning text asserts a specific root cause ("likely due to unmapped excluded disks"), but this isn't actually checked here and could mislead troubleshooting if apply_layout_mappings failed for another reason. Consider rephrasing to a more factual message (e.g., that failure is being ignored for df.txt because it may include excluded devices).
| LogPrint "Warning: Failed to apply disk layout mappings to $file_to_migrate (likely due to unmapped excluded disks)." | |
| LogPrint "Warning: Failed to apply disk layout mappings to $file_to_migrate; continuing without mappings for this file (it may include excluded devices)." |
BCF-6552: [REAR] REAR tries to map the disk that has been commented in the disklayout.conf file on the source machine
3b293ff to
4eb5952
Compare
prevent failure when mapping excluded disks in df.txt