From d12aa577156101a1c6a05765de751f0a54b58aa8 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 29 Jul 2017 16:13:38 +0200 Subject: fusefronted_reverse: fix ino collision between .name and .diriv files A directory with a long name has two associated virtual files: the .name file and the .diriv files. These used to get the same inode number: $ ls -di1 * */* 33313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw 1000000000033313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw/gocryptfs.diriv 1000000000033313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw.name With this change we use another prefix (2 instead of 1) for .name files. $ ls -di1 * */* 33313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw 1000000000033313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw/gocryptfs.diriv 2000000000033313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw.name --- internal/fusefrontend_reverse/rfs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/fusefrontend_reverse/rfs.go') diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go index 3c84e15..76b1361 100644 --- a/internal/fusefrontend_reverse/rfs.go +++ b/internal/fusefrontend_reverse/rfs.go @@ -162,9 +162,9 @@ func (rfs *ReverseFS) GetAttr(relPath string, context *fuse.Context) (*fuse.Attr return nil, fuse.ToStatus(err) } // Instead of risking an inode number collision, we return an error. - if st.Ino > virtualInoBase { + if st.Ino > inoBaseMin { tlog.Warn.Printf("GetAttr %q: backing file inode number %d crosses reserved space, max=%d. Returning EOVERFLOW.", - relPath, st.Ino, virtualInoBase) + relPath, st.Ino, inoBaseMin) return nil, fuse.ToStatus(syscall.EOVERFLOW) } var a fuse.Attr -- cgit v1.2.3