mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-06 03:57:48 +01:00
mount: tell windows about changes made elsewhere (#10553)
* mount: tell windows about changes made elsewhere Nothing invalidates a Windows client's cache from this side, so a file created or removed by another mount, the S3 gateway or the filer API stayed invisible in Explorer until the user refreshed by hand. The mount already receives those events; they just had nowhere to go. WFS gains a listener for every applied metadata event, and on Windows that turns into the WinFsp notification for the path. A rename reports both ends, since the destination's own event may never arrive when it falls outside this mount. * mount: report a removed directory as a directory Entry is nil once a path is vacated, so asking it whether the thing that went away was a directory always answered no and every removal was reported as a file. Windows watches the two through different filters, so a folder removed elsewhere never refreshed. The invalidation now carries what used to be there, which the event already knew and simply was not passing on. * mount: report a rename destination once The event stream already carries a second invalidation describing the new path, so reporting RenamedTo here sent the destination twice — and always as a create, so a moved directory arrived as a create followed by a mkdir.
This commit is contained in:
1 parent
a0e278f86f
commit
b8cba2982c
7 files changed
+171
-4
No files matched your search
@@ -108,6 +108,10 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||
ExtraOptions: option.extraOptions,
|
||||
})
|
||||
|
||||
// Windows caches entries on its own side and the mount cannot invalidate
|
||||
// that cache directly, so changes made elsewhere have to be pushed out.
|
||||
host.Notify(seaweedFileSystem)
|
||||
|
||||
grace.OnInterrupt(func() {
|
||||
// The signal handler exits the process as soon as the hooks return, so
|
||||
// anything still queued has to be flushed here rather than after Serve.
|
||||
|
||||
Reference in new issue
Block a user