mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 22:02:58 -04:00
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
This commit is contained in:
parent
164438a7b9
commit
99c66d3acf
1 changed files with 3 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue