summaryrefslogtreecommitdiffstats
path: root/sys/gnu
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2008-07-21 23:01:09 +0000
committerattilio <attilio@FreeBSD.org>2008-07-21 23:01:09 +0000
commit823ce79a5bcafc8eb919f84fef6937a5636d1978 (patch)
tree3a777195e2dc99a447ae78c9fafb25b15188b6ee /sys/gnu
parent412a8c5e97b26e71c5eb64fedbc644cb9177d3c8 (diff)
downloadFreeBSD-src-823ce79a5bcafc8eb919f84fef6937a5636d1978.zip
FreeBSD-src-823ce79a5bcafc8eb919f84fef6937a5636d1978.tar.gz
- Disallow XFS mounting in write mode. The write support never worked really
and there is no need to maintain it. - Fix vn_get() in order to let it call vget(9) with a valid locking request. vget(9) returns the vnode locked in order to prevent recycling, but in this case internal XFS locks alredy prevent it from happening, so it is safe to drop the vnode lock before to return by vn_get(). - Add a VNASSERT() in vget(9) in order to catch malformed locking requests. Discussed with: kan, kib Tested by: Lothar Braun <lothar at lobraun dot de>
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c2
-rw-r--r--sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c15
2 files changed, 12 insertions, 5 deletions
diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c b/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c
index 244ad30..ea815b2 100644
--- a/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c
+++ b/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c
@@ -199,6 +199,8 @@ _xfs_mount(struct mount *mp,
if (mp->mnt_flag & MNT_UPDATE)
return (0);
+ if ((mp->mnt_flag & MNT_RDONLY) == 0)
+ return (EPERM);
xmp = xfsmount_allocate(mp);
if (xmp == NULL)
diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c b/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c
index 8e2b1f9..3b3f3e5 100644
--- a/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c
+++ b/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c
@@ -104,13 +104,18 @@ vn_get(
vp = vmap->v_vp;
- error = vget(vp, 0, curthread);
- if (error) {
- vdrop(vp);
+ error = vget(vp, LK_EXCLUSIVE, curthread);
+ vdrop(vp);
+ if (error)
return (NULL);
- }
- vdrop(vp);
+ /*
+ * Drop the vnode returned by vget here.
+ * VOP_RECLAIM(9) should block on internal XFS locks so that
+ * the reclaiming scheme still remains consistent even if the
+ * vp is not locked.
+ */
+ VOP_UNLOCK(vp, 0);
if (vp->v_data != xfs_vp) {
vput(vp);
return (NULL);
OpenPOWER on IntegriCloud