Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btrfs-progs: scrub: add the new -t option to set the limit at runtime #947

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

adam900710
Copy link
Collaborator

I know there is already btrfs scrub limit command to set the limit, but a lot of users are not aware of that command.

Thus adding a new option -t <throughput_limit> to btrfs scrub start.

This has some extra behavior compared to btrfs scrub limit:

  • Only set the value for the involved scrub device(s) If it's a full fs scrub, it will be the same as btrfs scrub limit -a -l <value>. If it's a single device, it will bt the same as btrfs scrub limit -d <devid> -l <value>.

  • Automatically reset the limit after scrub is finished

  • It only needs one single command line to set the limit

Issue: #943
Signed-off-by: Qu Wenruo [email protected]

RFC:
I'm not sure if this is really needed since we already have btrfs scrub limit.
Involved tools like btrfs-maintenance scripts should have such support, but to my surprise, David introduced the btrfs scrub limit but not adding any support to btrfs-maintenance.

@adam900710 adam900710 added enhancement UI/UX User interface change labels Feb 4, 2025
@kdave
Copy link
Owner

kdave commented Feb 5, 2025

The support of limit in scrub start was "nice to have" when I added the limit command. The behaviour as you implemented it is what I'd expect.

Documentation/btrfs-scrub.rst Outdated Show resolved Hide resolved
Documentation/btrfs-scrub.rst Outdated Show resolved Hide resolved
Documentation/btrfs-scrub.rst Outdated Show resolved Hide resolved
Documentation/btrfs-scrub.rst Outdated Show resolved Hide resolved
…limit at runtime

Add a new option `--limit <throughput_limit>` to `btrfs scrub start`.

This has some extra behavior differences compared to `btrfs scrub limit`:

- Only set the value for the involved scrub device(s)
  If it's a full fs scrub, it will be the same as
  `btrfs scrub limit -a -l <value>`.
  If it's a single device, it will bt the same as
  `btrfs scrub limit -d <devid> -l <value>`.

- Automatically revert to the old limit after scrub is finished

- It only needs one single command line to set the limit

Issue: kdave#943
Signed-off-by: Qu Wenruo <[email protected]>
Copy link
Owner

@kdave kdave left a comment

Choose a reason for hiding this comment

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

Perfect, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement UI/UX User interface change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants