> From: zfs-discuss-boun...@opensolaris.org [mailto:zfs-discuss-
> boun...@opensolaris.org] On Behalf Of Ian Collins
> 
> > However writes to already opened files are allowed.
> 
> Think of this from the perspective of an application. How would write
> failure be reported?  

Both very good points.  But I agree with Robert.  

write() has a known failure mode when disk is full.  I agree bad things can
happen to applications that attempt write() when disk is full ... however
... Only a user with root privs is able to set readonly property.  I expect
the root user is doing this for a reason.  Willing, able, and aware to take
responsibility for the consequences.

The intuitive (generally expected) thing, when you're root and you make a
filesystem readonly, is that it becomes readonly.

If that is not the behavior ... Well, I can think of at least one really
specific, important example problem.

Suppose an application writes to a file infinitely.  Fills up the
filesystem.  This is a known bad thing for ZFS, sometimes causing
unrecoverable infinite IO and forcing power-cycle (I don't have a bug # but
see here: http://opensolaris.org/jive/thread.jspa?threadID=132383&tstart=0 )
...

If you find yourself in the infinite IO, would-be-forced to power cycle
situation, the workaround is to reduce some reservation to free up space.
Then you should be able to rm, destroy, and stop scrub.  But if the
application is still infinitely writing to the open file handle that it
already owns ... then any space you can free up will just get consumed again
immediately by the bad application.

Another specific example ...

Suppose you "zfs send" from a primary server to a backup server.  You want
the filesystems to be readonly on the backup fileserver, in order to receive
incrementals.  If you make a mistake, and start writing to the backup server
filesystem, you want to be able to correct your mistake.  Make it readonly,
stop anything from writing to it, rollback to the unmodified snapshot, so
you're able to receive incrementals again.

If setting readonly doesn't stop open filehandles from writing ... What can
you do?  You either have to flex your brain muscle to figure out some
technique to find which application is performing writes (not always easy to
do) or you basically have to unmount & remount the filesystem to force
writes to stop, which might not be easy to do, because filehandles are in
use.  You might feel the need to simply reboot, instead of figuring out a
way to do all this.  You just complain to your colleagues and say "yeah, the
stupid thing made me reboot in order to make the filesystem readonly."

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

Reply via email to