btrfs-progs/tests/misc-tests
Qu Wenruo 788e30f7ea btrfs-progs: tests: fix failure of misc/034
[BUG]
Test case misc/034 can fail like this:

  ====== RUN CHECK mount /dev/loop16 /home/adam/btrfs-progs/tests/mnt
  mount: /home/adam/btrfs-progs/tests/mnt: wrong fs type, bad option, bad superblock on /dev/loop16, missing codepage or helper program, or other error.
         dmesg(1) may have more information after failed mount system call.
  failed: mount /dev/loop16 /home/adam/btrfs-progs/tests/mnt

And the dmesg looks like this:

  loop16: detected capacity change from 0 to 1024000
  loop17: detected capacity change from 0 to 1024000
  BTRFS: device fsid 593e23af-a7e6-4360-b16a-229f415de697 devid 1 transid 6 /dev/loop16 scanned by mount (79348)
  BTRFS info (device loop16): using crc32c (crc32c-intel) checksum algorithm
  BTRFS info (device loop16): found metadata UUID change in progress flag, clearing
  BTRFS info (device loop16): disk space caching is enabled
  BTRFS error (device loop16): devid 2 uuid cde07de6-db7e-4b34-909e-d3db6e7c0b06 is missing
  BTRFS error (device loop16): failed to read the system array: -2
  BTRFS error (device loop16): open_ctree failed

[CAUSE]
From the dmesg, it shows that although both loopback devices are
properly registered, only one is properly scanned by mount.

Thus the other device is missing, and without "-o degraded" the
filesystem failed to be mounted.

[FIX]
Before we mount the filesystem, also scan them in their passed order
to properly assemble the device list for mount.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-21 02:59:06 +01:00
..
001-btrfstune-features
002-uuid-rewrite
003-zero-log
004-shrink-fs
005-convert-progress-thread-crash
006-image-on-missing-device
007-subvolume-sync
008-leaf-crossing-stripes
009-subvolume-sync-must-wait
010-convert-delete-ext2-subvol
011-delete-missing-device
012-find-root-no-result
013-subvolume-sync-crash
014-filesystem-label
015-dump-super-garbage btrfs-progs: dump-super: exit with failure when printing bad superblock 2022-08-16 15:18:12 +02:00
016-send-clone-src btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
017-recv-stream-malformatted
018-recv-end-of-stream btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
019-receive-clones-on-mounted-subvol
020-fix-superblock-corruption
021-image-multi-devices
022-filesystem-du-on-empty-subvol
023-device-usage-with-missing-device
024-inspect-internal-rootid
025-zstd-compression btrfs-progs: tests: switch mktemp to local helpers 2021-10-20 18:59:24 +02:00
026-image-non-printable-chars btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
027-subvol-list-deleted-toplevel
028-superblock-recover
029-send-p-different-mountpoints
030-missing-device-image
031-qgroup-parent-child-relation
032-bad-item-ptr
033-filename-length-limit
034-metadata-uuid btrfs-progs: tests: fix failure of misc/034 2023-03-21 02:59:06 +01:00
035-receive-common-mount-point-prefix btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
036-receive-dump-invalid-stream
037-fi-show-on-new-file btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
038-backup-root-corruption btrfs-progs: tests: make misc/038 more robust when searching backup slots 2021-10-20 18:59:24 +02:00
039-receive-clone-from-current-subvolume
040-subvolume-delete-default
041-subvolume-delete-during-send btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
042-inspect-internal-logical-resolve
043-subvolume-set-default-toplevel
045-receive-check-mount-type
046-seed-multi-mount
047-raid5-convert
048-image-restore-mount btrfs-progs: tests: switch mktemp to local helpers 2021-10-20 18:59:24 +02:00
049-btrfstune-transid-mismatch
050-receive-prop-ro-to-rw btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
051-warning-rw-subvol-received-uuid btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
052-seed-dirty-log btrfs-progs: make sure "btrfstune -S1" will reject fs with dirty log 2022-04-25 18:30:28 +02:00
053-receive-write-encoded btrfs-progs: tests: update stream version checks in misc/058 2022-11-04 20:23:22 +01:00
054-receive-dump-newlines btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
055-qgroup-clear-stale btrfs-progs: tests: add case for clearing stale qgroups 2022-10-26 09:31:19 +02:00
056-subvolume-list-uuid btrfs-progs: misc-tests: add a test case to make sure uuid is correctly reported 2023-01-02 14:00:10 +01:00