genode/repos/os/src/server/lx_fs
Alexander Boettcher accc7e7521 fs servers: handle result propagation better
This patch removes the notion of partial writes from the file-system
servers. Since write operations are asynchronously submitted, they are
expected to succeed completely, except for I/O errors. I/O errors are
propagated with the write acknowledgement but those are usually handled
out of band at the client side. Partial writes must never occur because
they would go undetected by clients, which usually don't wait for the
completion of each single write operation.

Until now, most file-system servers returned the number of written bytes
in the acknowledgement packet. If a server managed to write a part of
the request only, it issued the acknowledgement immediately where it
should have cared about writing the remaining part first.

The patch detects such misbehaving server-side code. If partial writes
unexpectedly occur, it prints a message and leaves the corresponding
request unacknowdleged.

Issue #2672
2018-02-15 10:22:08 +01:00
..
directory.h Follow practices suggested by "Effective C++" 2018-01-17 12:14:35 +01:00
file.h Follow practices suggested by "Effective C++" 2018-01-17 12:14:35 +01:00
lx_util.h Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
main.cc fs servers: handle result propagation better 2018-02-15 10:22:08 +01:00
node.h Follow practices suggested by "Effective C++" 2018-01-17 12:14:35 +01:00
open_node.h Follow practices suggested by "Effective C++" 2018-01-17 12:14:35 +01:00
README Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
symlink.h file system: use Id_space instead of Node_handle_registry 2017-08-17 10:59:43 +02:00
target.mk Build dynamically linked executables by default 2016-12-14 11:22:27 +01:00

This directory contains an Genode file-system service to Linux host fs
wrapper.

Configuration
~~~~~~~~~~~~~

Access to the file system can be tailored for each session depending on the
session's label. By default, no permissions are granted to any session.
To selectively permit access to (a part of) the file system, at least one
policy must be defined.

The following configuration illustates the way of how to express policy.

! <config>
!   <!-- constrain sessions according to their labels -->
!   <policy label="noux -> root" root="/" />
!   <policy label="noux -> home" root="/home/user" writeable="yes" />
!   <policy label="noux -> tmp"  root="/tmp"       writeable="yes" />
! </config>

Session-specific access-control policy is expressed via one or more '<policy>'
nodes. At session-creation time, each policy node is matched against the label
of the new session. If the label of a policy node matches, the defined policy
is applied. If multiple policies match, the one with the longest 'label'
attribute (the most specific one) is selected.

A policy node may contain the following attributes. The mandatory 'root'
attribute defines the viewport of the session onto the file system. The
optional 'writeable' attribute grants the permission to modify the file system.


Example
~~~~~~~

To illustrate the use of lx_fs, refer to the 'base-linux/run/lx_fs.run'
script.


Notes
~~~~~

If the Linux file system experiences changes from other processes
'inotify' may help to keep the servers cache up-to-date. This is not
implemented yet.