Skip to content

Commit 040842e

Browse files
authored
Merge pull request #63 from vixns/master
nfs: force remount if needed
2 parents 88caa60 + 0a438cf commit 040842e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

netshare/drivers/nfs.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ func (n nfsDriver) Mount(r volume.Request) volume.Response {
4646
if n.mountm.HasMount(r.Name) && n.mountm.Count(r.Name) > 0 {
4747
log.Infof("Using existing NFS volume mount: %s", hostdir)
4848
n.mountm.Increment(r.Name)
49-
return volume.Response{Mountpoint: hostdir}
49+
if err := run(fmt.Sprintf("mountpoint -q %s", hostdir)); err != nil {
50+
log.Infof("Existing NFS volume not mounted, force remount.")
51+
} else {
52+
return volume.Response{Mountpoint: hostdir}
53+
}
5054
}
5155

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

0 commit comments

Comments
 (0)