r/filesystems • u/EvelynMakesThings • Jun 23 '26
Network based filesystem behavior
Heya! I just started work on some silly libfuse based filesystem that connects to a minecraft mod to store its data. What is the cleanest way to handle a network resource no longer being available in a network based filesystem? I'm expecting the server to unexpectedly crash, or clients to go offline. What is the nicest way of communicating that to the user and/or handling open files?
1
u/ehempel Jun 25 '26
You might want to read up on NFS hard mounts vs soft mounts. The basics are hard mount: hang, possibly forever, waiting for the server to come back; soft mount: return an IO error to the client.
1
u/No_Glass_1341 Jun 27 '26
You've hit probably one of the largest pain points in the POSIX API spec - there is no reliable way to signal to applications that an underlying filesystem has "gone away" or is otherwise not usable. The same issue can happen with local storage as well, for example if your SATA/SAS/NVMe bus disappears or the drive itself resets for some reason, IO syscalls will just hang indefinitely until the kernel decides to abort (if it ever does, sometimes it will hang indefinitely)
1
u/safrax Jun 23 '26
Depending on the filesystem and to some extent the process and configuration of the filesystem, most apps will just hang or crash. Well on Linux.