btrfs-progs: scrub: add the new -t option to set the limit at runtime #947
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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>
tobtrfs 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 asbtrfs 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.