summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-03-11 13:53:00 +0000
committerphk <phk@FreeBSD.org>2002-03-11 13:53:00 +0000
commitc68bd5ed71080580d9f9e699c6d44ba16d155eab (patch)
tree6f6ba871d417c30edd14f39b847c03666657d789 /sys/ufs
parent844d26540edf533ec4434041bf3aada0d1cb3ffa (diff)
downloadFreeBSD-src-c68bd5ed71080580d9f9e699c6d44ba16d155eab.zip
FreeBSD-src-c68bd5ed71080580d9f9e699c6d44ba16d155eab.tar.gz
As a XXX bandaid open the mounted device READ/WRITE even if we only mount
read-only. The trouble here is that we don't reopen the device in read/write mode when we remount in read/write mode resulting in a filesystem sending write requests to a device which was only opened read/only. I'm not quite sure how such a reopen would best be done and defer the problem to more agile hackers.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 091fd64..5c43f7c 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -591,7 +591,16 @@ ffs_mountfs(devvp, mp, td, malloctype)
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
+ /*
+ * XXX: We don't re-VOP_OPEN in FREAD|FWRITE mode if the filesystem
+ * XXX: is subsequently remounted, so open it FREAD|FWRITE from the
+ * XXX: start to avoid getting trashed later on.
+ */
+#ifdef notyet
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, td);
+#else
+ error = VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, td);
+#endif
VOP_UNLOCK(devvp, 0, td);
if (error)
return (error);
@@ -785,7 +794,12 @@ out:
devvp->v_rdev->si_mountpoint = NULL;
if (bp)
brelse(bp);
+ /* XXX: see comment above VOP_OPEN */
+#ifdef notyet
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, cred, td);
+#else
+ (void)VOP_CLOSE(devvp, FREAD|FWRITE, cred, td);
+#endif
if (ump) {
free(ump->um_fs, M_UFSMNT);
free(ump, M_UFSMNT);
OpenPOWER on IntegriCloud