mirror of
https://github.com/containerd/containerd.git
synced 2026-08-08 17:11:15 +00:00
client:improve mount error message
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
This commit is contained in:
@@ -459,7 +459,11 @@ func optionsSize(opts []string) int {
|
|||||||
|
|
||||||
func mountAt(chdir string, source, target, fstype string, flags uintptr, data string) error {
|
func mountAt(chdir string, source, target, fstype string, flags uintptr, data string) error {
|
||||||
if chdir == "" {
|
if chdir == "" {
|
||||||
return unix.Mount(source, target, fstype, flags, data)
|
err := unix.Mount(source, target, fstype, flags, data)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("mount source: %q, target: %q, fstype: %s, flags: %d, data: %q, err: %w", source, target, fstype, flags, data, err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
ch := make(chan error, 1)
|
ch := make(chan error, 1)
|
||||||
@@ -481,8 +485,11 @@ func mountAt(chdir string, source, target, fstype string, flags uintptr, data st
|
|||||||
ch <- err
|
ch <- err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
err := unix.Mount(source, target, fstype, flags, data)
|
||||||
ch <- unix.Mount(source, target, fstype, flags, data)
|
if err != nil {
|
||||||
|
err = fmt.Errorf("mount source: %q, target: %q, fstype: %s, flags: %d, data: %q, err: %w", source, target, fstype, flags, data, err)
|
||||||
|
}
|
||||||
|
ch <- err
|
||||||
}()
|
}()
|
||||||
return <-ch
|
return <-ch
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user