Merge pull request #24061 from dmcgowan/close-reader-after-mount-exec
overlay2: close read end of pipe on mount exec Upstream-commit: 57977fb1273337db0e5da46faf4068c4073aa0bb Component: engine
This commit is contained in:
@ -32,12 +32,6 @@ type mountOptions struct {
|
||||
}
|
||||
|
||||
func mountFrom(dir, device, target, mType, label string) error {
|
||||
|
||||
r, w, err := os.Pipe()
|
||||
if err != nil {
|
||||
return fmt.Errorf("mountfrom pipe failure: %v", err)
|
||||
}
|
||||
|
||||
options := &mountOptions{
|
||||
Device: device,
|
||||
Target: target,
|
||||
@ -47,7 +41,10 @@ func mountFrom(dir, device, target, mType, label string) error {
|
||||
}
|
||||
|
||||
cmd := reexec.Command("docker-mountfrom", dir)
|
||||
cmd.Stdin = r
|
||||
w, err := cmd.StdinPipe()
|
||||
if err != nil {
|
||||
return fmt.Errorf("mountfrom error on pipe creation: %v", err)
|
||||
}
|
||||
|
||||
output := bytes.NewBuffer(nil)
|
||||
cmd.Stdout = output
|
||||
|
||||
Reference in New Issue
Block a user