]> git.ipfire.org Git - thirdparty/mdadm.git/commit
tests/00readonly: Run udevadm settle before setting ro
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 27 Jul 2022 21:52:45 +0000 (15:52 -0600)
committerJes Sorensen <jsorensen@fb.com>
Tue, 23 Aug 2022 13:41:28 +0000 (09:41 -0400)
commit39b381252c32275079344d30de18b76fda4bba26
tree74ca20fbdd168d3f926e144c675e2778c5d1b5a6
parent239b3cc0b5da87e966746533b1873c439db54b16
tests/00readonly: Run udevadm settle before setting ro

In some recent kernel versions, 00readonly fails with:

  mdadm: failed to set readonly for /dev/md0: Device or resource busy
  ERROR: array is not read-only!

This was traced down to a race condition with udev holding a reference
to the block device at the same time as trying to set it read only.

To fix this, call udevadm settle before setting the array read only.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
tests/00readonly