Date: Thu, 26 Nov 2020 18:13:33 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368076 - head/sys/kern Message-ID: <202011261813.0AQIDXm8037527@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Thu Nov 26 18:13:33 2020 New Revision: 368076 URL: https://svnweb.freebsd.org/changeset/base/368076 Log: vn_read_from_obj(): fix handling of doomed vnodes. There is no reason why vp->v_object cannot be NULL. If it is, it's fine, handle it by delegating to VOP_READ(). Tested by: pho Reviewed by: markj, mjg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27327 Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Nov 26 18:08:42 2020 (r368075) +++ head/sys/kern/vfs_vnops.c Thu Nov 26 18:13:33 2020 (r368076) @@ -870,10 +870,10 @@ vn_read_from_obj(struct vnode *vp, struct uio *uio) ssize_t resid; int error, i, j; - obj = vp->v_object; MPASS(uio->uio_resid <= ptoa(io_hold_cnt + 2)); - MPASS(obj != NULL); - MPASS(obj->type == OBJT_VNODE); + obj = atomic_load_ptr(&vp->v_object); + if (obj == NULL) + return (EJUSTRETURN); /* * Depends on type stability of vm_objects.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011261813.0AQIDXm8037527>