Skip to content

BCF-6552: [REAR] REAR tries to map the disk that has been commented in the disklayout.conf file on the source machine#83

Open
Barys Barysenka (BarysBarysenka) wants to merge 1 commit intodevelopfrom
feature/BCF-6552-rear-disk-mapping-during-recovery
Open

BCF-6552: [REAR] REAR tries to map the disk that has been commented in the disklayout.conf file on the source machine#83
Barys Barysenka (BarysBarysenka) wants to merge 1 commit intodevelopfrom
feature/BCF-6552-rear-disk-mapping-during-recovery

Conversation

@BarysBarysenka

prevent failure when mapping excluded disks in df.txt

Copilot AI review requested due to automatic review settings March 10, 2026 09:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.txt as 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)."
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)."

Copilot uses AI. Check for mistakes.
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)."
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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)."

Copilot uses AI. Check for mistakes.
BCF-6552: [REAR] REAR tries to map the disk that has been commented in the disklayout.conf file on the source machine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants