Skip to content

Commit 4c9d3f8

Browse files
authored
Move fault point to the iscsi mount function
1 parent 255e1fe commit 4c9d3f8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

utils/mount/mount_linux.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,6 @@ func (client *LinuxClient) MountNFSPath(ctx context.Context, exportPath, mountpo
237237
Logc(ctx).WithField("error", err).Warning("Mkdir failed.")
238238
}
239239

240-
if err := beforeMount.Inject(); err != nil {
241-
return err
242-
}
243-
244240
if out, err := client.command.Execute(ctx, mountCommand, args...); err != nil {
245241
Logc(ctx).WithField("output", string(out)).Debug("Mount failed.")
246242
return fmt.Errorf("error mounting NFS volume %v on mountpoint %v: %v", exportPath, mountpoint, err)
@@ -348,6 +344,10 @@ func (client *LinuxClient) MountDevice(ctx context.Context, device, mountpoint,
348344
client.createMountPoint(ctx, mountpoint, isMountPointFile)
349345
}
350346

347+
if err := beforeMount.Inject(); err != nil {
348+
return err
349+
}
350+
351351
if !mounted {
352352
if _, err := client.command.Execute(ctx, "mount", args...); err != nil {
353353
Logc(ctx).WithField("error", err).Error("Mount failed.")

0 commit comments

Comments
 (0)