Skip to content

Commit

Permalink
nfs: force remount if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
vixns committed Aug 3, 2016
1 parent 6198504 commit 0a438cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion netshare/drivers/nfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ func (n nfsDriver) Mount(r volume.Request) volume.Response {
if n.mountm.HasMount(r.Name) && n.mountm.Count(r.Name) > 0 {
log.Infof("Using existing NFS volume mount: %s", hostdir)
n.mountm.Increment(r.Name)
return volume.Response{Mountpoint: hostdir}
if err := run(fmt.Sprintf("mountpoint -q %s", hostdir)); err != nil {
log.Infof("Existing NFS volume not mounted, force remount.")
} else {
return volume.Response{Mountpoint: hostdir}
}
}

log.Infof("Mounting NFS volume %s on %s", source, hostdir)
Expand Down

0 comments on commit 0a438cf

Please sign in to comment.