[Git-commits] [grml/grml-debootstrap] 9b2cf8: mkfs: avoid blockdev failing to re-read partition ...

Michael Prokop noreply at github.com
Thu Apr 25 17:14:26 CEST 2024


  Branch: refs/heads/mika/273
  Home:   https://github.com/grml/grml-debootstrap
  Commit: 9b2cf8303e8e403b1bd9eaa5dbf6f3e795a4f426
      https://github.com/grml/grml-debootstrap/commit/9b2cf8303e8e403b1bd9eaa5dbf6f3e795a4f426
  Author: Michael Prokop <mika at grml.org>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M grml-debootstrap

  Log Message:
  -----------
  mkfs: avoid blockdev failing to re-read partition table

Invoking `blockdev --rereadpt` straight after creating the file system
might fail with:

| blockdev: ioctl error on BLKRRPART: Device or resource busy
| Unexpected non-zero exit code 1 in /sbin/grml-debootstrap /sbin/grml-debootstrap /sbin/grml-debootstrap at line 1376 2132 0 detected!
| last bash command: blockdev --rereadpt "$main_device"

This is caused by udev kicking in and causing a race condition. Let's
invoke udevadm settle (which watches the udev event queue, and exits if
all current events are handled), and then retry `blockdev --rereadpt
...` up to 30 times/seconds.

Thanks: Darshaka Pathirana for bug report and initial investigation, and Chris Hofstaedtler for feedback
Closes: https://github.com/grml/grml-debootstrap/issues/273



To unsubscribe from these emails, change your notification settings at https://github.com/grml/grml-debootstrap/settings/notifications


More information about the Git-commits mailing list