Possible error in SFS specification
Posted: Sun Mar 07, 2010 4:12 am
I'm not sure where to post this... I've searched the forum and turned up some topics concerning SFS, but as far as I can tell, this issue has not been reported yet.
The issue is the following.
Currently I can see no workaround this issue, except for modifying the specification so that in these cases an excess continuation entry must not be created. This results in slightly more complicated code (you can no longer determine the length of a file using strlen or similar means, but have to use strnlen or equivalent function), but doing so removes the contradiction from the specification.
Has anyone come across this yet?
I've started implementing SFS, which I hope will be useful to anyone wishing to implement this file system and at some point in the future could be used as a reference implementation. The code is available at https://code.google.com/p/sfstools/ . I'm using the SFS draft at http://dimensionalrift.homelinux.net/co ... k/sfs.html as it is more complete than the one in the OSdev wiki.
I've come across some more ambiguities in the specification.
1. Do data block numbers for a file include the number of blocks in the reserved area, or is block number zero at the very start of the data area? This is not stated explicitly. I've interpreted it as if block number zero was indeed the first block of the data area.
2. In section Index Area Format, the graphic representation of "Continuation entry for file entry 4" is incorrect. It should be at least adjacent to its base file entry. Also the numbering of files is misleading (should be the reverse).
3. The specification indicates the Volume Identifier as the "first" entry. However, this would place the continuation entries before (closer to the start of the volume than) their base file/directory entry, removing the ability to simply strcmp() your way through the index are to locate a specific file/directory. I've interpreted the specification as if the Starting Marker was the "first" entry.
The issue is the following.
This means that the zero terminator is part of the file/directory name. However,SFS Specification wrote: All names must end with a null character (0x0000).
SFS Specification wrote: There are 9 different types of index area entries:
<snip>
* Continuation Entry (any value between 0x20 and 0xFF inclusive)
I've found that creating a directory or file whose full path (including the leading '/' character and excluding the zero terminator byte) is of length (64n+54) for directories or (64n+30) for files, leads to creating an excess continuation entry whose sole purpose is to store a single 0x00 byte, breaking the constraints on the Continuation Entries.SFS Specification wrote: Because bytes with values less than 32 aren't possible within directory names and file names, it is possible to determine if an entry is a continuation entry or any other type of entry by checking the first byte of the entry. If the first byte is below 0x20 the entry is not a continuation entry, and if the first byte is above or equal to 0x20 then it must be a continuation entry.
Currently I can see no workaround this issue, except for modifying the specification so that in these cases an excess continuation entry must not be created. This results in slightly more complicated code (you can no longer determine the length of a file using strlen or similar means, but have to use strnlen or equivalent function), but doing so removes the contradiction from the specification.
Has anyone come across this yet?
I've started implementing SFS, which I hope will be useful to anyone wishing to implement this file system and at some point in the future could be used as a reference implementation. The code is available at https://code.google.com/p/sfstools/ . I'm using the SFS draft at http://dimensionalrift.homelinux.net/co ... k/sfs.html as it is more complete than the one in the OSdev wiki.
I've come across some more ambiguities in the specification.
1. Do data block numbers for a file include the number of blocks in the reserved area, or is block number zero at the very start of the data area? This is not stated explicitly. I've interpreted it as if block number zero was indeed the first block of the data area.
2. In section Index Area Format, the graphic representation of "Continuation entry for file entry 4" is incorrect. It should be at least adjacent to its base file entry. Also the numbering of files is misleading (should be the reverse).
3. The specification indicates the Volume Identifier as the "first" entry. However, this would place the continuation entries before (closer to the start of the volume than) their base file/directory entry, removing the ability to simply strcmp() your way through the index are to locate a specific file/directory. I've interpreted the specification as if the Starting Marker was the "first" entry.