Skip to content

Conversation

@licliu
Copy link
Collaborator

@licliu licliu commented Sep 19, 2025

The kdump scripts previously could not correctly handle cases where the dump target was located on a btrfs subvolume. The logic for finding the mount point did not account for the way subvolumes are represented, leading to failures in identifying the target device and checking for available space.

This patch introduces support for btrfs subvolumes by:

  1. Adding a new helper function get_btrfs_subvol_from_mntopt to extract the subvolume name from mount options.
  2. Modifying get_mntpoint_from_target to accept a subvolume name. When a subvolume is provided, it correctly identifies the mount point by looking for the source entry that includes the subvolume name (e.g., /dev/sda1[/subvol]).
  3. Updating various functions in mkdumprd, kdump-lib.sh, and the dracut module setup scripts to detect if the target is on a btrfs filesystem, parse the subvolume, and pass it to the relevant functions for mount point resolution and free space checks.

This ensures that kdump can now be reliably configured with a dump target located on a btrfs subvolume.

@licliu licliu force-pushed the btrfs_support branch 2 times, most recently from 001e85c to c4e7656 Compare September 30, 2025 04:55
@coiby
Copy link
Member

coiby commented Oct 27, 2025

Hi @licliu ,

It seems this PR is ready for review though it's marked as draft, am I correct?

@licliu
Copy link
Collaborator Author

licliu commented Oct 27, 2025

Hi @coiby, I used an AI tool locally to review this PR and found some issues, I'll post a new version after I fix them.

@coiby
Copy link
Member

coiby commented Oct 27, 2025

Hi @coiby, I used an AI tool locally to review this PR and found some issues, I'll post a new version after I fix them.

I see. Looking forward to your new version!

@licliu
Copy link
Collaborator Author

licliu commented Oct 30, 2025

rebased by the wrong way. I apologize for the disruption.

The kdump scripts previously could not correctly handle cases where the
dump target was located on a btrfs subvolume. The logic for finding
the mount point did not account for the way subvolumes are represented,
leading to failures in identifying the target device and checking for
available space.

This patch introduces support for btrfs subvolumes by:

1.  Adding a new helper function `get_btrfs_subvol_from_mntopt` to
    extract the subvolume name from mount options.
2.  Modifying `get_mntpoint_from_target` to accept a subvolume
    name. When a subvolume is provided, it correctly identifies the
    mount point by looking for the source entry that includes the
    subvolume name (e.g., `/dev/sda1[/subvol]`).
3.  Updating various functions in `mkdumprd`, `kdump-lib.sh`, and the
    dracut module setup scripts to detect if the target is on a btrfs
    filesystem, parse the subvolume, and pass it to the relevant
    functions for mount point resolution and free space checks.

This ensures that kdump can now be reliably configured with a dump
target located on a btrfs subvolume.

Signed-off-by: Lichen Liu <[email protected]>
Add test cases to verify new and modified logic for handling btrfs
subvolumes as kdump targets.

Assisted-by: Claude (Anthropic)
Signed-off-by: Lichen Liu <[email protected]>
@licliu
Copy link
Collaborator Author

licliu commented Oct 30, 2025

Hi @coiby, I pushed a new verison with the help of AI, and I marked it as ready to review, thanks for your attention!

@licliu licliu marked this pull request as ready for review October 30, 2025 09:19
@coiby coiby merged commit 76be088 into rhkdump:main Nov 14, 2025
5 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants