FFS writes to read-only mount
Bruce Evans
brde at optusnet.com.au
Wed Jul 4 01:08:41 UTC 2007
On Tue, 3 Jul 2007, David Cecil wrote:
> in March I mailed the list about errors I'm seeing that look something like
> this:
> g_vfs_done():mirror/gmroots1f[WRITE(offset=1349091328, length=16384)]error =
> 1
> (Note that gmroots1f is not a complete mirror set, just one disk ,and was
> never part of a complete mirror set. Also, partition f is the root
> partition.)
>
> The problem comes about because the underlying geom object has had its access
> permissions changed so that g_io_check fails due to acw being 0 (as per my
> original message at the end of this email). This problem is most easily
> reproducible when during boot if the root filesystem is changed from rw to ro
> mount. Our code is now 6.1-based.
At least -current seems to have the opposite problem -- that acw is not
changed to 0 on mount -o ro, as shown by:
boot
use the system a bit
# fsck -p / # fails of course since / is rw
# mount -u -o ro / # fails with EBUSY
# # I don't want to try mount -f ... /
# kill -TERM 1 # shut down to single user mode to run fsck safely
# umount -A # old bug: this still doesn't remount / ro
# not so old bug: it now tries to unmount devfs; this
# fails of course
# mount -u -o ro / # finish unmounting / (works according to mount status)
# fsck -p / # fails, apparently since acw is still nonzero
In some non-current versions of FreeBSD, I have debugging code in
ffs_update() that complains about attempts to update inodes on read-only
file systems. Such attempts certainly occur, due to historical mistakes.
They are supposed to be handled (starting sometime in 4.x) by silently
ignoring the problem and clearing the IN_MODIFIED flag and related flags
so that the update is not retried later. I don't know of any cases where
this doesn't work.
Bruce
More information about the freebsd-fs
mailing list