Skip to content

Commit

Permalink
Merge pull request moby#26378 from rhvgoyal/fix-max-retries
Browse files Browse the repository at this point in the history
devmapper: Fail to start container if xfs_nospace_max_retries can't be enforced
  • Loading branch information
cpuguy83 authored Sep 7, 2016
2 parents 426a0af + 6cc55dd commit ce5eb34
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions daemon/graphdriver/devmapper/deviceset.go
Original file line number Diff line number Diff line change
Expand Up @@ -2325,11 +2325,7 @@ func (devices *DeviceSet) xfsSetNospaceRetries(info *devInfo) error {
filePath := "/sys/fs/xfs/" + dmDeviceName + "/error/metadata/ENOSPC/max_retries"
maxRetriesFile, err := os.OpenFile(filePath, os.O_WRONLY, 0)
if err != nil {
// Older kernels don't have this feature/file
if os.IsNotExist(err) {
return nil
}
return fmt.Errorf("devmapper: Failed to open file %v:%v", filePath, err)
return fmt.Errorf("devmapper: user specified daemon option dm.xfs_nospace_max_retries but it does not seem to be supported on this system :%v", err)
}
defer maxRetriesFile.Close()

Expand Down Expand Up @@ -2383,6 +2379,8 @@ func (devices *DeviceSet) MountDevice(hash, path, mountLabel string) error {

if fstype == "xfs" && devices.xfsNospaceRetries != "" {
if err := devices.xfsSetNospaceRetries(info); err != nil {
syscall.Unmount(path, syscall.MNT_DETACH)
devices.deactivateDevice(info)
return err
}
}
Expand Down

0 comments on commit ce5eb34

Please sign in to comment.