git: cf77a28cffc3 - stable/13 - tmpfs_getattr(): Only take vm_object lock on 32bit machines
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Jan 2023 03:23:34 UTC
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cf77a28cffc32a6d529ce7421b1e66beced49c5c commit cf77a28cffc32a6d529ce7421b1e66beced49c5c Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2022-12-17 11:03:32 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-01-20 03:19:56 +0000 tmpfs_getattr(): Only take vm_object lock on 32bit machines Tested by: pho (cherry picked from commit 4d903a1a74d9526aba4d177e89c10f97df5662f2) --- sys/fs/tmpfs/tmpfs_vnops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 661004595f18..0074e3203bbb 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -498,7 +498,6 @@ tmpfs_getattr(struct vop_getattr_args *v) { struct vnode *vp = v->a_vp; struct vattr *vap = v->a_vap; - vm_object_t obj; struct tmpfs_node *node; node = VP_TO_TMPFS_NODE(vp); @@ -523,10 +522,15 @@ tmpfs_getattr(struct vop_getattr_args *v) vap->va_rdev = (vp->v_type == VBLK || vp->v_type == VCHR) ? node->tn_rdev : NODEV; if (vp->v_type == VREG) { - obj = node->tn_reg.tn_aobj; +#ifdef __ILP32__ + vm_object_t obj = node->tn_reg.tn_aobj; + VM_OBJECT_RLOCK(obj); +#endif vap->va_bytes = ptoa(node->tn_reg.tn_pages); +#ifdef __ILP32__ VM_OBJECT_RUNLOCK(obj); +#endif } else { vap->va_bytes = node->tn_size; }