1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #40056 from kolyshkin/dm-unit

devmapper: fix unit test
This commit is contained in:
Brian Goff 2019-10-07 15:43:08 -07:00 committed by GitHub
commit 4faf65f250
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,8 +34,9 @@ func initLoopbacks() error {
if err != nil { if err != nil {
return err return err
} }
// create at least 8 loopback files, ya, that is a good number // create at least 128 loopback files, since a few first ones
for i := 0; i < 8; i++ { // might be already in use by the host OS
for i := 0; i < 128; i++ {
loopPath := fmt.Sprintf("/dev/loop%d", i) loopPath := fmt.Sprintf("/dev/loop%d", i)
// only create new loopback files if they don't exist // only create new loopback files if they don't exist
if _, err := os.Stat(loopPath); err != nil { if _, err := os.Stat(loopPath); err != nil {