Merge pull request #27520 from dmcgowan/fix-27384

Add limit to page size used by overlay2 driver
Upstream-commit: 74f486cd71e99e5e7a04a98e941841af48771c5d
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2016-10-18 23:11:17 -07:00
committed by GitHub

View File

@ -473,6 +473,15 @@ func (d *Driver) Get(id string, mountLabel string) (s string, err error) {
pageSize := syscall.Getpagesize()
// Go can return a larger page size than supported by the system
// as of go 1.7. This will be fixed in 1.8 and this block can be
// removed when building with 1.8.
// See https://github.com/golang/go/commit/1b9499b06989d2831e5b156161d6c07642926ee1
// See https://github.com/docker/docker/issues/27384
if pageSize > 4096 {
pageSize = 4096
}
// Use relative paths and mountFrom when the mount data has exceeded
// the page size. The mount syscall fails if the mount data cannot
// fit within a page and relative links make the mount data much