disk_conditioner_delay doesn't check whether vp is NULL
disk_conditioner_delay doesn't check whether vp is NULL
- Subject: disk_conditioner_delay doesn't check whether vp is NULL
- From: Quinten Johnson <email@hidden>
- Date: Tue, 06 Mar 2018 16:23:36 +0000
- Thread-topic: disk_conditioner_delay doesn't check whether vp is NULL
in bsd/vfs/vfs_disk_conditioner.c, disk_conditioner_delay() isn't guarding
against NULL bp->b_vp.
in bsd/vfs/vfs_bio.c:
void
buf_biodone(buf_t bp)
{
...
if (bp->b_vp && bp->b_vp->v_mount) {
mp = bp->b_vp->v_mount;
} else {
mp = NULL;
}
...
disk_conditioner_delay(bp, 1, bp->b_bcount, read_elapsed_usec);
in bsd/vfs/vfs_disk_conditioner.c:
void
disk_conditioner_delay(buf_t bp, int extents, int total_size, uint64_t
already_elapsed_usec) {
...
mp = buf_vnode(bp)->v_mount;
if (!mp) {
return;
}
...
}
So a NULL check is needed similar to the one in buf_biodone().
Quinten Johnson
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden