btrfs-progs/tests/misc-tests
Marcos Paulo de Souza b20f94e984 btrfs-progs: misc-test: 034: Call "udevmadm settle" before mount
As seem in issue #192, this test can fail from time to time. The
issue happens when a mount is issued before the new device is processed
by systemd-udevd, as we can see by the og bellow:

  [ 2346.028809] BTRFS: device fsid 593e23af-a7e6-4360-b16a-229f415de697 devid 1 transid 6 /dev/loop10 scanned by systemd-udevd (3418)
  [ 2346.265401] BTRFS info (device loop10): found metadata UUID change in progress flag, clearing
  [ 2346.272474] BTRFS info (device loop10): disk space caching is enabled
  [ 2346.277472] BTRFS info (device loop10): has skinny extents
  [ 2346.281840] BTRFS info (device loop10): flagging fs with big metadata feature
  [ 2346.308428] BTRFS error (device loop10): devid 2 uuid cde07de6-db7e-4b34-909e-d3db6e7c0b06 is missing
  [ 2346.315363] BTRFS error (device loop10): failed to read the system array: -2
  [ 2346.329887] BTRFS error (device loop10): open_ctree failed

  failed: mount /dev/loop10 /home/marcos/git/suse/btrfs-progs/tests//mnt
  test failed for case 034-metadata-uuid
  make: *** [Makefile:401: test-misc] Error 1

  [ 2346.666865] BTRFS: device fsid 593e23af-a7e6-4360-b16a-229f415de697 devid 2 transid 5 /dev/loop11 scanned by systemd-udevd (3422)
  [ 2346.853233] BTRFS: device fsid 1c2debeb-e829-4d6b-84df-aa7c5d246fd5 devid 1 transid 7 /dev/loop6 scanned by systemd-udevd (3418)

A few moments after the test failed systemd-udevd processed the new
device (registered the new device under btrfs). This can be tested by
executing a mount after the test failed, resulting in a successful
mount:

  $ mount /dev/loop10 /mnt
  [ 2398.955254] BTRFS info (device loop10): found metadata UUID change in progress flag, clearing
  [ 2398.959416] BTRFS info (device loop10): disk space caching is enabled
  [ 2398.962483] BTRFS info (device loop10): has skinny extents
  [ 2398.965070] BTRFS info (device loop10): flagging fs with big metadata feature
  [ 2399.012617] BTRFS info (device loop10): enabling ssd optimizations
  [ 2399.022375] BTRFS info (device loop10): checking UUID tree

This problem can be avoided is we execute "udevadm settle" before the
mount is executed.

Issue: #192
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Su Yue <Damenly_Su@gmx.com>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-03 19:58:54 +01:00
..
001-btrfstune-features btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
002-uuid-rewrite btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
003-zero-log btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
004-shrink-fs btrfs-progs: tests: switch messages to _log 2019-07-26 17:46:42 +02:00
005-convert-progress-thread-crash btrfs-progs: tests: switch messages to _log 2019-07-26 17:46:42 +02:00
006-image-on-missing-device btrfs-progs: tests: fix typos in test comments 2018-11-26 17:53:43 +01:00
007-subvolume-sync btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
008-leaf-crossing-stripes btrfs-progs: tests: add shell quotes to misc test scripts 2018-03-30 22:15:55 +02:00
009-subvolume-sync-must-wait btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
010-convert-delete-ext2-subvol btrfs-progs: tests: add shell quotes to misc test scripts 2018-03-30 22:15:55 +02:00
011-delete-missing-device btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
012-find-root-no-result btrfs-progs: tests: add shell quotes to misc test scripts 2018-03-30 22:15:55 +02:00
013-subvolume-sync-crash btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
014-filesystem-label btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
015-dump-super-garbage btrfs-progs: tests: add shell quotes to misc test scripts 2018-03-30 22:15:55 +02:00
016-send-clone-src btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
017-recv-stream-malformatted btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
018-recv-end-of-stream btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
019-receive-clones-on-mounted-subvol btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
020-fix-superblock-corruption btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
021-image-multi-devices btrfs-progs: tests: fix misc/021 when restoring overlapping stale data 2019-10-14 17:28:02 +02:00
022-filesystem-du-on-empty-subvol btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
023-device-usage-with-missing-device btrfs-progs: tests: add shell quotes to misc test scripts 2018-03-30 22:15:55 +02:00
024-inspect-internal-rootid btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
025-zstd-compression btrfs-progs: introduce TEST_TOP and INTERNAL_BIN for tests 2018-02-13 15:41:32 +01:00
026-image-non-printable-chars btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
027-subvol-list-deleted-toplevel btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
028-superblock-recover btrfs-progs: tests: drop keyword function 2019-07-04 15:36:01 +02:00
029-send-p-different-mountpoints btrfs-progs: misc-tests/029: exit manually after run_mayfail() 2019-07-03 20:49:04 +02:00
030-missing-device-image btrfs-progs: tests: Test if btrfs-image can handle RAID1 missing device 2018-03-30 22:15:55 +02:00
031-qgroup-parent-child-relation btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
032-bad-item-ptr btrfs-progs: tests: Add test case for dump-tree on heavily corrupted leaf 2018-06-07 16:37:32 +02:00
033-filename-length-limit btrfs-progs: switch to mkfs helper 2019-06-05 20:27:32 +02:00
034-metadata-uuid btrfs-progs: misc-test: 034: Call "udevmadm settle" before mount 2020-03-03 19:58:54 +01:00
035-receive-common-mount-point-prefix btrfs-progs: tests: disable misc-tests/035-receive-common-mount-point-prefix 2019-05-17 13:02:22 +02:00
036-receive-dump-invalid-stream btrfs-progs: tests: stream dump and max_error counts 2019-05-17 12:32:38 +02:00
037-fi-show-on-new-file btrfs-progs: tests: Test fs on image files is correctly recognised 2019-06-05 20:27:31 +02:00
038-backup-root-corruption btrfs-progs: tests: fix path of btrfs-corrupt-block 2020-03-03 19:58:53 +01:00