aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-04-18 11:19:33 -0700
committerChris Lu <chris.lu@gmail.com>2021-04-18 13:07:28 -0700
commitd1c813c4707f988bc0688c2e780bf8075c5571af (patch)
treea06c98d67dedbeba93cca2462d11c5e0ea94c2c6
parent372872ebbfa360e25ff63071166e9eaef6255df8 (diff)
downloadseaweedfs-d1c813c4707f988bc0688c2e780bf8075c5571af.tar.xz
seaweedfs-d1c813c4707f988bc0688c2e780bf8075c5571af.zip
let the fuse library manage directory id
otherwise, on mac, during large directory deletion, if some ReaDirAll happens, the lib seems confused about the directories, and some child directories are not deleted.
-rw-r--r--weed/filesys/dir.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go
index 77e6724e1..1dc2ab939 100644
--- a/weed/filesys/dir.go
+++ b/weed/filesys/dir.go
@@ -28,7 +28,7 @@ type Dir struct {
}
var _ = fs.Node(&Dir{})
-var _ = fs.NodeIdentifier(&Dir{})
+//var _ = fs.NodeIdentifier(&Dir{})
var _ = fs.NodeCreater(&Dir{})
var _ = fs.NodeMknoder(&Dir{})
var _ = fs.NodeMkdirer(&Dir{})
@@ -44,7 +44,7 @@ var _ = fs.NodeRemovexattrer(&Dir{})
var _ = fs.NodeListxattrer(&Dir{})
var _ = fs.NodeForgetter(&Dir{})
-func (dir *Dir) Id() uint64 {
+func (dir *Dir) xId() uint64 {
return dir.id
}
@@ -65,7 +65,7 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error {
return err
}
- attr.Inode = dir.Id()
+ // attr.Inode = dir.Id()
attr.Mode = os.FileMode(entry.Attributes.FileMode) | os.ModeDir
attr.Mtime = time.Unix(entry.Attributes.Mtime, 0)
attr.Crtime = time.Unix(entry.Attributes.Crtime, 0)
@@ -92,7 +92,7 @@ func (dir *Dir) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp *f
func (dir *Dir) setRootDirAttributes(attr *fuse.Attr) {
// attr.Inode = 1 // filer2.FullPath(dir.Path).AsInode()
attr.Valid = time.Second
- attr.Inode = dir.Id()
+ attr.Inode = 1 // dir.Id()
attr.Uid = dir.wfs.option.MountUid
attr.Gid = dir.wfs.option.MountGid
attr.Mode = dir.wfs.option.MountMode