Skip to content

Commit

Permalink
Merge pull request #63 from vixns/master
Browse files Browse the repository at this point in the history
nfs: force remount if needed
  • Loading branch information
gondor authored Aug 3, 2016
2 parents 88caa60 + 0a438cf commit 040842e
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 040842e

Please sign in to comment.