XFS had several places where it detected a read-only mount, and
twiddled the VFS readonly flags before proceeding, for instance
with recovery, quotacheck, and quota inode creation.
However, the vfs flag is really not what matters here, it's the
read-only status of the underlying devices. So, check -that-
before attempting to recover, quotacheck, etc, and fail if the
device is read-only (this part is no different from previous
behavior). The writes we need to do are under the vfs, so the
vfs flag really doesn't matter.
I also took out warnings pertaining to this behavior, if it's
standard behavior, why issue a warning...
Also, what may be a real bugfix here, is that xfs would clear
out "stale" log blocks from a previous partial log write prior to log
recovery, but we were incorrectly skipping that step on read-only
mounts. This may have led to some recovery problems, particularly
on root devices. Now we skip that skip that step only if
the log device itself is read-only, since we can't recover anyway.
Rearrange how xfs deals with read-only mounts vs. read-only devices.
Date: Fri Oct 4 14:09:39 PDT 2002
Workarea:
stout.americas.sgi.com:/localhome/src/sandeen/2.4.x-xfs/workarea-alwaysclean
The following file(s) were checked into:
bonnie.engr.sgi.com:/isms/slinx/2.4.x-xfs
Modid: 2.4.x-xfs:slinx:129120a
linux/fs/xfs/xfs_log_recover.c - 1.243
- Check device for read-only (rather than mount flag)
before doing xlog_clear_stale_blocks(). We were skipping
this on read-only mounts, which was not a good thing.
Don't change VFS readonly flag to do recovery, only
check for ro status of underlying device.
linux/fs/xfs/xfs_mount.c - 1.303
- Use new xfs_dev_is_read_only function to check device
status before changing quota state.
Don't change VFS readonly flag to do quotacheck, only
check for ro status of underlying device.
linux/fs/xfs/xfs_qm.c - 1.86
- Don't change VFS readonly flag to do quotacheck, only
check for ro status of underlying device.
linux/fs/xfs/linux/xfs_lrw.h - 1.27
linux/fs/xfs/linux/xfs_lrw.c - 1.169
- Remove the vfs read-only checks for various xfs operations,
just check whether the underlying device is read-only
in a generic way.
|