On 08/28/10 11:13 AM, Robert Milkowski wrote:
Hi,

When I set readonly=on on a dataset then no new files are allowed to be created.
However writes to already opened files are allowed.

This is rather counter intuitive - if I set a filesystem as read-only I would expect it not to allow any modifications to it.

I think it shouldn't behave this way and it should be considered as a bug.

What do you think?

No.

Think of this from the perspective of an application. How would write failure be reported? open(2) returns EACCES if the file can not be written but there isn't a corresponding return from write(2). Any open file descriptors would have to be updated to reflect the change of access and the application would end up with an unexpected error return (EBADF?).

If the application has been given permission to open a file for writing and this permission is unexpectedly revoked, strange things my happen. The file being written would be in an inconsistent state.

I think it is better to let write operation complete and leave the file in a consistent state.

--

Ian.

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to