Bug 7060 - mount+alter needs locking
: mount+alter needs locking
: Nimbus
Workspace control
: 2.4
: PC Linux
: P3 normal
: 2.5
Assigned To:
: 7013
  Show dependency treegraph
Reported: 2010-06-19 15:27 by
Modified: 2010-06-19 15:58 (History)



You need to log in before you can comment on or make changes to this bug.

Description From 2010-06-19 15:27:31
If too many VMs are being started on the same machine at the same time, you can
run into this:

    ioctl: LOOP_SET_FD: Device or resource busy

Putting an flock in place fixes this.

Also, the flock file descriptor redirection part here needs ">>" and not ">"
because of "set -C" (thankyou Pierre).  Otherwise you will get:
"/var/lock/nimbus.mountalter.lock: cannot overwrite existing file"
------- Comment #1 From 2010-06-19 15:27:56 -------
Committed to master for 2.5

------- Comment #2 From 2010-06-19 15:58:40 -------
Just for reference, apparently any way about it the losetup or mount commands
both exihibit a race condition on the loop device selection.  So flock at a
higher level is the only way to go for us.