mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-12 01:10:48 +00:00
This adds a new notify channel to the transfuse protocol. It is not optional yet but could be made to be optional. A notify protocol and notify channel are required because writing FUSE response messages to the FUSE device has different semantics from writing asynchronous notifications. In particular, response message writes only error on malformed messages, do not take locks, and do not block. In contrast, asynchronous notifications can error under normal conditions (e.g. invalidating a cache entry that doesn't exist), can take locks during the write call, and can block. If responses and notifications occur in the same thread, the file system can become deadlocked when syscalls lock resources waiting for a response and a notification is written that blocks attempting to acquire those same locks. The response that would unlock the contended lock could be queued behind the notification write but the notification write can't unblock until the response is written in the future. This patch enables file systems to avoid that fate by offering a secondary channel on which to send notifications. Signed-off-by: David Sheets <dsheets@docker.com>