mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-26 16:12:34 +00:00
btrfs-progs: scrub status: 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
8bca55d1e7
commit
96011debe4
@ -1947,8 +1947,10 @@ static int cmd_scrub_status(const struct cmd_struct *cmd, int argc, char **argv)
|
||||
init_fs_stat(&fs_stat);
|
||||
fs_stat.s.in_progress = in_progress;
|
||||
for (i = 0; i < fi_args.num_devices; ++i) {
|
||||
/* Save the last limit only, works for a single device filesystem. */
|
||||
limit = read_scrub_device_limit(fdmnt, di_args[i].devid);
|
||||
/* On a multi-device filesystem, keep the lowest limit only. */
|
||||
u64 this_limit = read_scrub_device_limit(fdmnt, di_args[i].devid);
|
||||
if (!limit || (this_limit && this_limit < limit))
|
||||
limit = this_limit;
|
||||
|
||||
last_scrub = last_dev_scrub(past_scrubs,
|
||||
di_args[i].devid);
|
||||
|
Loading…
Reference in New Issue
Block a user