Signed-off-by: Alexey Guskov <lexag@mail.ru>
| ... | ... |
@@ -212,7 +212,7 @@ func (d *Driver) ZfsPath(id string) string {
|
| 212 | 212 |
} |
| 213 | 213 |
|
| 214 | 214 |
func (d *Driver) MountPath(id string) string {
|
| 215 |
- return path.Join(d.options.mountPath, "graph", id) |
|
| 215 |
+ return path.Join(d.options.mountPath, "graph", getMountpoint(id)) |
|
| 216 | 216 |
} |
| 217 | 217 |
|
| 218 | 218 |
func (d *Driver) Create(id string, parent string) error {
|
| ... | ... |
@@ -2,6 +2,7 @@ package zfs |
| 2 | 2 |
|
| 3 | 3 |
import ( |
| 4 | 4 |
"fmt" |
| 5 |
+ "strings" |
|
| 5 | 6 |
"syscall" |
| 6 | 7 |
|
| 7 | 8 |
log "github.com/Sirupsen/logrus" |
| ... | ... |
@@ -22,3 +23,16 @@ func checkRootdirFs(rootdir string) error {
|
| 22 | 22 |
|
| 23 | 23 |
return nil |
| 24 | 24 |
} |
| 25 |
+ |
|
| 26 |
+func getMountpoint(id string) string {
|
|
| 27 |
+ maxlen := 12 |
|
| 28 |
+ |
|
| 29 |
+ // we need to preserve filesystem suffix |
|
| 30 |
+ suffix := strings.SplitN(id, "-", 2) |
|
| 31 |
+ |
|
| 32 |
+ if len(suffix) > 1 {
|
|
| 33 |
+ return id[:maxlen] + "-" + suffix[1] |
|
| 34 |
+ } |
|
| 35 |
+ |
|
| 36 |
+ return id[:maxlen] |
|
| 37 |
+} |