Skip to content

Commit 82451be

Browse files
committed
btrfs-progs: do not output extra lines about mismatching device numbers
[BUG] Fstests btrfs/218 fails with newer btrfs-progs: btrfs/218 2s ... - output mismatch (see /home/adam/xfstests-dev/results//btrfs/218.out.bad) --- tests/btrfs/218.out 2024-11-24 18:04:01.137258508 +1030 +++ /home/adam/xfstests-dev/results//btrfs/218.out.bad 2025-11-27 20:19:21.653781264 +1030 @@ -2,6 +2,7 @@ Label: none uuid: <UUID> Total devices <NUM> FS bytes used <SIZE> devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV +found more devices than fs_info [SCRATCH_DEV].write_io_errs 0 [SCRATCH_DEV].read_io_errs 0 [SCRATCH_DEV].flush_io_errs 0 ... (Run 'diff -u /home/adam/xfstests-dev/tests/btrfs/218.out /home/adam/xfstests-dev/results//btrfs/218.out.bad' to see the entire diff) [CAUSE] Commit f1115bd ("btrfs-progs: count devices without SEARCH_TREE ioctl in get_fs_info()") added a new message which will be triggered every time we're calling get_fs_info() on a fs with a seed device. This message is not really necessary as we know this behavior already and is doing device number counting to handle such situation. [FIX] Just remove the unnecessary message which is confusing and lead to the above golden output mismatch. Fixes: f1115bd ("btrfs-progs: count devices without SEARCH_TREE ioctl in get_fs_info()") Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Qu Wenruo <wqu@suse.com>
1 parent 745e510 commit 82451be

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

common/utils.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,8 @@ int get_fs_info(const char *path, struct btrfs_ioctl_fs_info_args *fi_args,
208208
if (ret == 0)
209209
count++;
210210
}
211-
if (count > fi_args->num_devices) {
212-
printf("found more devices than fs_info\n");
211+
if (count > fi_args->num_devices)
213212
fi_args->num_devices = count;
214-
}
215213

216214
/* We did not count devid 0, do another probe. */
217215
ret = device_get_info(fd, 0, &tmp);

0 commit comments

Comments
 (0)