mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-11 08:19:32 +00:00
btrfs-progs: scrub start: consider the lowest non-zero limit
On multi-device filesystems, a scrub limit may be applied to any of the
devices. Ensure that any limit found is not disregarded.
Since it's more intuitive, keep the lowest non-zero limit found, even
though at the present we don't actually use the exact value.
Pull-request: #733
Issue: #727
Fixes: 7e4a235df1
("btrfs-progs: scrub status: print device speed limit in status if set")
Signed-off-by: Jonas Malaco <jonas@protocubo.io>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
96011debe4
commit
1d37d3ef91
@ -1634,8 +1634,10 @@ static int scrub_start(const struct cmd_struct *cmd, int argc, char **argv,
|
||||
struct btrfs_scrub_progress *cur_progress =
|
||||
&sp[i].scrub_args.progress;
|
||||
|
||||
/* Save last limit only, works for single device filesystem. */
|
||||
limit = sp[i].limit;
|
||||
/* On a multi-device filesystem, keep the lowest limit only. */
|
||||
if (!limit || (sp[i].limit && sp[i].limit < limit))
|
||||
limit = sp[i].limit;
|
||||
|
||||
if (do_stats_per_dev) {
|
||||
print_scrub_dev(&di_args[i],
|
||||
cur_progress,
|
||||
|
Loading…
Reference in New Issue
Block a user