cephfs: add stderr to mount function errors

This commit appends stderr to error in both kernel and
ceph-fuse mounter functions to better be able to debug
errors.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R 2021-04-08 14:24:46 +05:30 committed by mergify[bot]
parent 62ae17e263
commit fb7389f478

View File

@ -168,7 +168,7 @@ func mountFuse(ctx context.Context, mountPoint string, cr *util.Credentials, vol
_, stderr, err := util.ExecCommand(ctx, "ceph-fuse", args[:]...)
if err != nil {
return err
return fmt.Errorf("%w stderr: %s", err, stderr)
}
// Parse the output:
@ -227,7 +227,11 @@ func mountKernel(ctx context.Context, mountPoint string, cr *util.Credentials, v
args = append(args, "-o", optionsStr)
return execCommandErr(ctx, "mount", args[:]...)
_, stderr, err := util.ExecCommand(ctx, "mount", args[:]...)
if err != nil {
return fmt.Errorf("%w stderr: %s", err, stderr)
}
return err
}
func (m *kernelMounter) mount(ctx context.Context, mountPoint string, cr *util.Credentials, volOptions *volumeOptions) error {