How to detect operational failure during Close.

20 views
Skip to first unread message

ai ou

unread,
Mar 29, 2025, 1:13:40 PMMar 29
to WinFsp

Hello, thank you for providing such wonderful software.

I am developing an application to operate files on remote storage, using the passthrough.c source code as a reference.

Since random access to files is required, I retrieve the file at the execution of Open in FSP_FILE_SYSTEM_INTERFACE. The Read and Write operations are performed on the retrieved file, and I intend to update the remote storage upon Close.

However, since Close is defined as void without a return value, it is not possible to notify WinFsp of a failure in updating the storage. In such a case, is there a way for application users to recognize the update failure?

Bill Zissimopoulos

unread,
Mar 31, 2025, 10:30:10 AMMar 31
to ai ou, WinFsp

Unfortunately no, there is no way to report such an error to the user. This is because the return code from the Cleanup and Close operations (which happen after a file is closed) is ignored.

 

This may look like a problem in the Windows file system, but I note that it is a problem with Linux FUSE as well. Linux FUSE includes a flush operation that can report an error, but this operation is not invoked in the case of memory mapped files.

 

Some of my file systems have a similar design to yours, where the remote storage gets updated some time after the last CLOSE (e.g. 30 seconds). In such cases I build my remote storage update process to be resilient in the face of network outages, errors, etc. At a minimum the updates are retried and will be retried even if the file system process dies or is killed.

 

Thanks.

 

Bill

 

 

--
You received this message because you are subscribed to the Google Groups "WinFsp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to winfsp+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/winfsp/8d7ab018-47fd-4ac1-a7e7-26f172fd21e7n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages