On Sat, 30 Dec 2006 02:28:49 +0100, Pawel Jakub Dawidek <[EMAIL PROTECTED]>
wrote:
Hi.
Here are some things my file system test suite discovered on Solaris ZFS
and UFS.
Bascially ZFS pass all my tests (about 3000). I see one problem with UFS
and two differences:
1. link(2) manual page states that privileged processes can make
multiple links to a directory. This looks like a general comment, but
it's only true for UFS.
2. link(2) in UFS allows to remove directories, but doesn't allow this
in ZFS.
both are actually correct, the standards wording permits either way:
<snip link(2)/unlink(2) POSIX IEEE Std 1003.1, 2004 Edition>
If path1 names a directory, link() shall fail unless the process has
appropriate
privileges and the implementation supports using link() on directories.
The path argument shall not name a directory unless the process has
appropriate
privileges and the implementation supports using unlink() on directories.
<snip end>
UFS does support link(2)/unlink(2) with appropriate privilidges of
directories
while ZFS does not.
However, it gets interesting when SVID3 comes into play:
<snip>
The link(BA_OS) and unlink(BA_OS) descriptions in SVID3 both specify that
a process with appropriate privileges is allowed to operate on a
directory.
We have claimed to conform to SVID3 since Solaris 2.0 and have not
announced
that we ever plan to EOL SVID3 conformance.
<snip end>
3. Unsuccessful link(2) can update file's ctime:
# fstest mkdir foo 0755
# fstest create foo/bar 0644
# fstest chown foo/bar 65534 -1
# ctime1=`fstest stat foo/bar ctime`
# sleep 1
# fstest -u 65534 link foo/bar foo/baz <--- this unsuccessful
operation updates ctime
EACCES
# ctime2=`fstest stat ${n0} ctime`
# echo $ctime1 $ctime2
1167440797 1167440798
I'd call this a bug, although the standard does not presicely mentions
this,
but at least it sais:
<snip link(2) POSIX IEEE Std 1003.1, 2004 Edition>
Upon successful completion, link() shall mark for update the st_ctime
field of the file.
Also, the st_ctime and st_mtime fields of the directory that contains the
new entry shall be marked for update.
If link() fails, no link shall be created and the link count of the file
shall remain unchanged.
<snip end>
Since we fail the successfull completion part and we should stay away from
modifying
the link count in that case I think it makes a good argument to also
require us to
stay away from updating the ctime as well.
--
frankB
(I'd rather be a forest than a street....)
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss