aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu
diff options
context:
space:
mode:
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 244ad3099e84..ea815b21e74e 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 8e2b1f97274a..3b3f3e5b4916 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);