btrfs-progs/cmds
Jonas Malaco 8bca55d1e7 btrfs-progs: scrub status: only report limits if at least one exists
On multi-device filesystems, scrub status should report "some limits
set" if at least one device has a scrub limit set.

However, with btrfs-progs 6.6.3, this was being reported regardless of
whether any limit actually being set:

    # sudo btrfs scrub limit /more/butter
    UUID: 989129d9-c96f-4d52-9d68-cbb6d9b2c499
    Id  Limit       Path
    --  -----  ---------
     1      -  /dev/sdc1
     2      -  /dev/sdd1

    # sudo btrfs scrub status /more/butter/
    UUID:             989129d9-c96f-4d52-9d68-cbb6d9b2c499
    Scrub started:    Mon Jan 15 02:00:30 2024
    Status:           running
    Duration:         6:23:19
    Time left:        0:49:08
    ETA:              Mon Jan 15 09:12:57 2024
    Total to scrub:   9.83TiB
    Bytes scrubbed:   8.72TiB  (88.64%)
    Rate:             397.47MiB/s (some device limits set)
    Error summary:    no errors found

Fix it by only setting `limit` to the special marker value 1 if at least
one actual limit is found.

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>
2024-01-15 17:07:19 +01:00
..
balance.c btrfs-progs: remove old syntax of 'balance /path' 2023-11-03 18:04:37 +01:00
commands.h btrfs-progs: use unsigned type for bit shift values 2023-11-03 18:04:37 +01:00
device.c btrfs-progs: device delete: add timeout when removing multiple devices 2023-12-01 02:54:09 +01:00
filesystem-du.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
filesystem-usage.c btrfs-progs: use statvfs() in print_filesystem_usage_overall 2023-12-08 17:08:55 +01:00
filesystem-usage.h btrfs-progs: convert device info to struct array 2023-10-17 19:34:00 +02:00
filesystem.c btrfs-progs: resize: properly return error from check_resize_args 2023-11-03 18:04:37 +01:00
inspect-dump-super.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
inspect-dump-tree.c btrfs-progs: dump-tree: allow using '-' for tree ids 2023-10-06 17:33:08 +02:00
inspect-tree-stats.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
inspect.c btrfs-progs: cmds: drop unsigned long long casts for printf 2023-11-03 18:04:37 +01:00
property.c btrfs-progs: property set: skip opening char devices completely 2023-11-14 15:48:00 +01:00
props.h btrfs-progs: use unsigned type for bit shift values 2023-11-03 18:04:37 +01:00
qgroup.c btrfs-progs: fix -Walloc-size warnings reported by gcc 14 2023-11-14 13:14:24 +01:00
qgroup.h btrfs-progs: sync uapi/btrfs.h into btrfs-progs 2023-05-26 18:02:28 +02:00
quota.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
receive-dump.c btrfs-progs: receive: add support for fs-verity 2022-10-11 09:08:08 +02:00
receive-dump.h btrfs-progs: cmds: update include lists 2022-10-11 09:07:59 +02:00
receive.c btrfs-progs: receive: properly report lack of zstd support 2023-12-07 14:29:54 +01:00
reflink.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
replace.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
rescue-chunk-recover.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
rescue-super-recover.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
rescue.c btrfs-progs: rescue: replace kfree by free in clear_uuid_tree 2023-11-03 18:04:37 +01:00
rescue.h btrfs-progs: unify GPL header comments 2021-09-07 13:58:44 +02:00
restore.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
scrub.c btrfs-progs: scrub status: only report limits if at least one exists 2024-01-15 17:07:19 +01:00
send.c btrfs-progs: use get_sysfs_proto_supported() in get_sysfs_proto_supported() 2023-12-01 01:58:56 +01:00
subvolume-list.c btrfs-progs: fix all variable shadowing 2023-10-10 19:16:29 +02:00
subvolume.c btrfs-progs: subvolume: fix return value when the target exists 2024-01-10 04:16:13 +01:00
subvolume.h btrfs-progs: subvol: introduce rowspec definition for json output 2023-08-28 17:24:23 +02:00