10.1 In this situation the links now point to a new file, which may or may not have any relation to the old file. Applications which accessed and continue to access this file will not be aware it was deleted and may continue to treat it as the old file, leading to problems. To fix this, we might add a unique key to each file, so that even if a program follows an outdated link, it can compare keys and see it is not accessing the same file. 10.6 It could make sure to store the file sequentially on disk, so that it can be read with a minimum of seeks. 11.3 a. Yes. Traverse all the files on the file system, marking which blocks are in use by files. The inverse of this marking is the free space list. b. We actually need to read the contents of 3 files: the two directories a and b, and the file c. Each content read requires at least two I/Os: one to read the index block, and one or more to read the data blocks of the files. So, at a minimum we must make 6 I/O operations to read the file. At a maximum it could be many more of these if we have to read multiple blocks per directory. c. Whenever the pointer is changed as the result of allocating a free block, flush the change to disk. 11.5 Take two examples of performance optimizations: a) Using indexed allocation to reduce fragmentation and improve direct file access: This makes the index block crucial to maintaining a file, so a crash that corrupts a block (such as one during an index block write) can result in file loss b) Batching writes. This improves performance by minimizing disk I/O, but it means a crash with unwritten data still being batched results in file system corruption 11.10 Logging of metadata updates ensures that we have a record of what changes will be made before we make the changes. Thus, if a crash occurs while the system is in an inconsistent state, we can use this record to repeat or rollback the changes to achieve a consistent state again. 12.1 a) With the other scheduling algorithms, there is no notion of bounded waiting, and hence there is starvation. In SSTF, a new request with a smaller seek time may come it. In SCAN and C-SCAN, during a scan in any particular direction, we could always receive a series of requests that would be serviced on that scan before a request at the end of the scan, say b) One option is to remember the age of each request, and preferentially service requests whose age exceeds a certain threshold. This introduces some inefficiency into the algorithms, but prevents starvation c) Fairness minimizes the variance of response time, and make the system more predictable to users. Even if the system runs a little slower because the fair algorithm is a little slower, users tend to prefer predictability vs. raw speed. d) 1. Servicing certain writes first to maintain recoverability of the system 2. Prioritizing page-ins over user disk reads so that the kernel can continue to operate 3. Servicing requests with deadlines (say, certain network requests), over those without deadlines 12.8 Assuming I/O bus bandwidth is sufficient large, we can read disjoint portions of the same file from each of the two mirrors, effectively doubling our read bandwidth. 12.9 a. We must read and write both the data block and the parity block, for a total of 2 blocks accessed and 4 total disk accesses b. Since we're using block-level striping, the first four blocks will share the same parity block, and the last 3 blocks will share a different parity block. In all cases, we must read and write all the data blocks and the parity blocks. So we access (4+1)+(3+1) = 9 total blocks, and 18 different accesses to the disks.