Commit c3ec767e authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

UnionFs: when creating symlink, promote directory containing link.

parent 2f58a81d
......@@ -360,7 +360,10 @@ func (me *UnionFs) Mkdir(path string, mode uint32) (code fuse.Status) {
}
func (me *UnionFs) Symlink(pointedTo string, linkName string) (code fuse.Status) {
code = me.fileSystems[0].Symlink(pointedTo, linkName)
code = me.promoteDirsTo(linkName)
if code.Ok() {
code = me.fileSystems[0].Symlink(pointedTo, linkName)
}
if code.Ok() {
me.removeDeletion(linkName)
me.branchCache.GetFresh(linkName)
......
......@@ -152,6 +152,17 @@ func TestSymlink(t *testing.T) {
}
}
func TestSymlinkPromote(t *testing.T) {
wd, clean := setupUfs(t)
defer clean()
err := os.Mkdir(wd + "/ro/subdir", 0755)
CheckSuccess(err)
err = os.Symlink("/foobar", wd+"/mount/subdir/link")
CheckSuccess(err)
}
func TestChtimes(t *testing.T) {
wd, clean := setupUfs(t)
defer clean()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment