When the kernel sends a `Create` message the WinFsp-FUSE layer creates
and opens the file (as per Windows semantics). Sometimes an additional
operation needs to be performed after the file has been opened, which
may fail. In this case the just opened file must be released.
In this particular case the WinFsp-FUSE layer used to call `release`
with an uninitialized path. This commit fixes the problem.
This problem was originally reported in cgofuse (billziss-gh/cgofuse#58)
The original WinFsp protocol for shutting down a file system was to issue
an FSP_FSCTL_STOP control code to the fsctl device. This would set the IOQ
to the "stopped" state and would also cancel all active IRP's. Cancelation
of IRP's would sometimes free buffers that may have still been in use by
the user mode file system threads; hence access violation.
To fix this problem a new control code FSP_FSCTL_STOP0 is introduced. The
new file system shutdown protocol is backwards compatible with the original
one and works as follows:
- First the file system process issues an FSP_FSCTL_STOP0 control code which
sets the IOQ to the "stopped" state but does NOT cancel IRP's.
- Then the file system process waits for its dispatcher threads to complete
(see FspFileSystemStopDispatcher).
- Finally the file system process issues an FSP_FSCTL_STOP control code
which stops the (already stopped) IOQ and cancels all IRP's.
mingw-w64 declares _FILE_FULL_EA_INFORMATION since Jan 18, 2010 [1].
The change allows the winfsp client library to be consumed by projects built with mingw.
[1]: afd1465722
According to the FILE_BASIC_INFORMATION doc a file system should not update a file timestamp when it receives a value of -1 in the corresponding time field.
This commit converts a -1 timestamp to a 0 timestamp; this directs a WinFsp file system not to update the corresponding file timestamp.
This commit fixes issue #362
Some options (VolumePrefix, FileSystemName, volname) have a fixed maximum size.
This commit adds functionality to truncate user-specified long options to their fixed maximum size.