Commit Graph

33 Commits

Author SHA1 Message Date
Rolf Neugebauer
31430016b2 transfused: Use Linux coding style (mostly)
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-09-16 11:02:29 +01:00
David Sheets
78cca476fb transfused: copyedit a couple error messages
Signed-off-by: David Sheets <dsheets@docker.com>
2016-07-22 13:40:52 +01:00
David Sheets
ddd0fcc603 transfused: add separate FUSE notify channel to avoid deadlock
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>
2016-07-22 13:35:57 +01:00
David Sheets
ef98586c22 transfused: add mknod reg file event actuation message
Signed-off-by: David Sheets <dsheets@docker.com>
2016-07-11 16:26:00 -07:00
David Sheets
fbcba85f0e transfused: distinguish export requests from mount requests
We distinguish export suitability requests from bind mount suitability
requests in the transfuse control protocol. This distinction allows us to
permit both bind mounts of empty directories and export mounts onto empty
directories. Addresses docker/pinata#4213.

Signed-off-by: David Sheets <dsheets@docker.com>
2016-07-04 18:53:05 -07:00
David Sheets
d605e6df30 transfused: update control protocol (#181)
Add a mount suitability predicate, a pong reply message type, and a log
notice message type. Also, fixes the multi-line mount point printing issue.

Signed-off-by: David Sheets <dsheets@docker.com>
2016-06-07 19:13:52 +01:00
David Sheets
4330d389cc transfused: introduce automatic mount point preparation
Mount points are now made dynamically if either the leaf doesn't exist
or the leaf has no children. Any proper prefix of the target mount point may
or may not exist prior to mounting.

Signed-off-by: David Sheets <dsheets@docker.com>
2016-06-03 16:31:49 +01:00
David Sheets
afd7458c01 transfused: add a PING event for vsock RTT measurement
Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-21 10:22:57 +01:00
David Sheets
6f76ac9627 transfused: push log messages over control channel if available
Also, remove self-logging and triggers.

Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-15 17:11:38 +01:00
David Sheets
8b8bf30eb7 transfused: update the event protocol for streaming vsock
Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-14 14:57:06 +01:00
David Sheets
52feb0c4d5 transfused: use vsock transport instead of 9p
Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-12 16:38:06 +01:00
Jeremy Yallop
d521bcfcd9 Transfused: free connection objects when read returns 0. 2016-03-29 16:37:51 +01:00
David Sheets
b8660ad77b transfused: add chmod event syscall
Signed-off-by: David Sheets <dsheets@docker.com>
2016-03-20 22:01:22 +00:00
David Sheets
7861ecc474 transfused: create threads already detached
Signed-off-by: David Sheets <david.sheets@docker.com>
2016-03-20 11:20:00 +00:00
David Sheets
f7f3690453 transfused: move logging off of the event actuation thread
Signed-off-by: David Sheets <david.sheets@docker.com>
2016-03-20 11:08:57 +00:00
David Sheets
f358faf440 transfused: fix run-time log non-append bug
Signed-off-by: David Sheets <david.sheets@docker.com>
2016-03-20 11:04:01 +00:00
David Sheets
56215fc7da transfused: work-around virtio-9p/v9fs zero-copy bug
Signed-off-by: David Sheets <david.sheets@docker.com>
2016-03-20 11:03:24 +00:00
David Sheets
58f7e6f32e transfused: add start-up log, self-log trigger, and run-time log flags
During start-up, logs are sent to syslog and stderr and the console if
syslog is not available. -l logfile will also send the logs to logfile but
only prior to any log trigger events. -m mount_trigger lets the user
specify the mount point to watch for to begin sending logs to
-t triggered_log file which may be on the newly mounted file system. Log
concatenation and rollover are not implemented, yet. Logging functionality
has been separated into transfused_log.c. Locks have been placed around
shared fds. The writer thread is now symmetric to the reader thread instead
of inheriting the parent's thread in order to trigger log switchover after
the file system proxy has started. The coredump size rlimit has been lifted.

Signed-off-by: David Sheets <david.sheets@docker.com>
2016-03-18 11:21:42 +00:00
David Sheets
ad4ca2795d transfused: fix usage msg, remove syslog, use start-stop-daemon logging
Signed-off-by: David Sheets <david.sheets@docker.com>
2016-03-18 09:33:41 +00:00
David Sheets
dbadd16989 transfused: change protocol to support events, add syslog logging
The event string in the 9p socket file system now contains a 1 byte
channel type immediately preceding the connection ID. This channel type
determines which protocol will be used on the channel -- m for FUSE
protocol, e for events. The event messages are host-initiated and have
the following structure:

  2 bytes for total length
  2 bytes for path length + NUL (x)
  x bytes for path
  1 byte  for syscall

stderr logging was also changed to syslog-based logging in this patch.

Signed-off-by: David Sheets <david.sheets@docker.com>
2016-03-18 09:33:41 +00:00
David Sheets
b36faade61 transfused: if the pidfile exists, make sure to truncate it 2016-02-12 14:08:11 +00:00
David Sheets
321ee6b30f transfused: it is ok if the pidfile does not yet exist 2016-02-12 14:08:11 +00:00
David Sheets
f4207db176 transfused: fix the 9p socket root name 2016-02-12 14:08:10 +00:00
David Sheets
4ee04ecd45 transfused: introduce command line arguments for pidfile, fusermount, 9p 2016-02-12 14:08:10 +00:00
David Sheets
396e180adb transfused: improve some error message output and fix an fd mixup 2016-02-12 14:08:10 +00:00
David Sheets
7e21a29055 transfused: add trace logging error checking 2016-02-12 14:08:10 +00:00
David Sheets
4f0ca1c4ee transfused: do not check return of close
on advice from @justincormack
2016-02-12 14:08:10 +00:00
David Sheets
9150a6f455 transfused: hook debug into HUP-toggled run-time debug system 2016-02-12 14:08:10 +00:00
David Sheets
f62e78ad86 transfused: clean up equal sign spacing 2016-02-12 14:08:10 +00:00
David Sheets
7ef2c29d50 transfused: clean up comma spacing 2016-02-12 14:08:10 +00:00
David Sheets
a04b701bc6 transfused: use an absolute path for fusermount
Gets rid of non-portable execvpe for execve and prevents diversion.
Explicit diversion will be introduced as a command-line option later.
2016-02-12 14:08:10 +00:00
David Sheets
33019eeb34 transfused: address @yallop's comments 2016-02-12 14:08:10 +00:00
David Sheets
7dfba256d8 Add a FUSE proxy written in C
This should improve portability, be more palatable for future
distribution, and enable lower-level control. Addresses #8.
2016-02-12 14:07:43 +00:00