From e04dc050126edcf7440ea5412bc74c6ad8b42e95 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 17 Nov 2016 20:32:19 +0100 Subject: fusefrontend: upgrade wlockMap to use device AND inode number If there are multiple filesystems backing the gocryptfs filesystems inode numbers are not guaranteed to be unique. --- internal/fusefrontend_reverse/rfs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/fusefrontend_reverse/rfs.go') diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go index 7f102cf..aca4b90 100644 --- a/internal/fusefrontend_reverse/rfs.go +++ b/internal/fusefrontend_reverse/rfs.go @@ -41,7 +41,7 @@ type ReverseFS struct { // Inode number generator inoGen *inoGenT // Maps backing files device+inode pairs to user-facing unique inode numbers - inoMap map[devIno]uint64 + inoMap map[fusefrontend.DevInoStruct]uint64 // Protects map access inoMapLock sync.Mutex } @@ -68,7 +68,7 @@ func NewFS(args fusefrontend.Args) *ReverseFS { nameTransform: nameTransform, contentEnc: contentEnc, inoGen: newInoGen(), - inoMap: map[devIno]uint64{}, + inoMap: map[fusefrontend.DevInoStruct]uint64{}, } } @@ -167,7 +167,7 @@ func (rfs *ReverseFS) inoAwareStat(relPlainPath string) (*fuse.Attr, fuse.Status // The file has hard links. We have to give it a stable inode number so // tar or rsync can find them. if fi.Mode().IsRegular() && st.Nlink > 1 { - di := devIno{uint64(st.Dev), st.Ino} + di := fusefrontend.DevInoFromStat(st) rfs.inoMapLock.Lock() stableIno := rfs.inoMap[di] if stableIno == 0 { -- cgit v1.2.3