Advanced Operating Systems (9 CFU)
MS Degree in Computer Engineering
Academic Year 2018/2019

Lecturer: Francesco Quaglia


The examination requires fulfilling the development of a Linux kernel subsystem compliant with the following specification:

Sessioned file access

This specification is related to the implementation of a device driver that allows sessioned file access for files that are kept in a specific directory within the VFS tree. The pathname of this directory is a parameter of the device driver.

Lets' suppose that this pathname is dir-A, then for any file F in dir-A the device driver enables creating a sessioned file F in another directory whose pathname will be dir-B. This pathname can be selected by the software designer.

The device driver must support creation and removal of sessioned files with arbitrary names in/from dir-B.

When a sessioned file F in dir-B is opened, a new incarnation of its content is created, which is filled with the content of the corresponding file F in dir-A. However, its update operations must not be immediately visible in the corresponding file F in dir-A (or in other files). These updates must be flushed to F in dir-A only upon the closure of an I/O session on the sessioned file F residing in dir-B. In other words, all the update operations on the sessioned file F remain volatile up to its closure. This is the so called "session based file access semantic", as opposed to the classical UNIX based semantic where any update on a file performed in an I/O session in are made visible to other I/O sessions on the same file.

If upon the closure of a sessioned file, the corresponding file F in dir-A no longer exists, then the closing process must receive the SIGPIPE signal. Similarly, if upon opening a sessioned file the corresponding file kept in dir-A does (no longer) exist, then opening the sessioned file will result in an error.

Sessioned files in dir-B must support at least the following set of file-operations:

Volatile i-nodes are allowed for sessioned files in dir-B, so that they can disappear when umounting the file-system they belong to. Also, for simplicity of the design, we can assume that the maximum size of a file F in dir-A which is accessed via the corresponding sessioned file F in dir-B does not exceed the maximum storage size garanteed by a single buddy-system allocation operation on the specific version of the Linux kernel where the device driver is nested. If that file exceeds this size, then opening the corresponding sessioned file will result in an error.

Concurrent I/O sessions on files in dir-B must be allowed, as well as concurrent operations on a same I/O session, as usual for files in Linux. On the other hand, atomicity of the concurrent operations must still be guaranteed.

Finally, when a sessioned file is opened and an incarnation of its content is created, the content needs to be filled atomically with respect to the closure of another incarnation of the same file (which flushes the content of the sessioned file to the original file in the dir-A directory). The same is true for concurrent closures of the different incarnations of a sessioned file.


Project delivery

Projects can be delivered (for analysis and discussion) at any scheduled tutoring slot