daemon: btrfs: Fix parsing for new output from btrfs scrub.

The format changed at some point breaking our existing parsing code.
Typical example of the new format is below.

UUID:             b8604449-c7b5-4d3b-9fad-56114e8594f5
Scrub started:    Wed Oct  2 12:54:06 2019
Status:           finished
Duration:         0:00:00
\tdata_extents_scrubbed: 0
\ttree_extents_scrubbed: 16
\tdata_bytes_scrubbed: 0
\ttree_bytes_scrubbed: 262144
\tread_errors: 0
\tcsum_errors: 0
\tverify_errors: 0
\tno_csum: 0
\tcsum_discards: 0
\tsuper_errors: 0
\tmalloc_errors: 0
\tuncorrectable_errors: 0
\tunverified_errors: 0
\tcorrected_errors: 0
\tlast_physical: 253493248
This commit is contained in:
Richard W.M. Jones
2019-10-02 14:20:37 +01:00
parent 9f516b4fcc
commit 0177552375

View File

@@ -1834,8 +1834,10 @@ do_btrfs_scrub_status (const char *path)
* scrub status for 346121d1-1847-40f8-9b7b-2bf3d539c68f
* no stats available
*/
for (i = 1; lines[i] != NULL; ++i) {
if ((i == 1) && STREQ (lines[i], "\tno stats available"))
for (i = 0; lines[i] != NULL; ++i) {
if (lines[i][0] != '\t')
continue;
else if (STREQ (lines[i], "\tno stats available"))
return ret;
else if (STRPREFIX (lines[i], "\tscrub started at"))
continue;