diff options
author | dwhite <dwhite@FreeBSD.org> | 2005-11-09 22:03:50 +0000 |
---|---|---|
committer | dwhite <dwhite@FreeBSD.org> | 2005-11-09 22:03:50 +0000 |
commit | 0bcdf7c0332746573fc0de7a81621778fcca937b (patch) | |
tree | df01b7b1216dc56834f356e58c27cfda7c5ae598 /sys/kern | |
parent | fc360a564f423f6153219166750b4335eee05f51 (diff) | |
download | FreeBSD-src-0bcdf7c0332746573fc0de7a81621778fcca937b.zip FreeBSD-src-0bcdf7c0332746573fc0de7a81621778fcca937b.tar.gz |
This is a workaround for a complicated issue involving VFS cookies and devfs.
The PR and patch have the details. The ultimate fix requires architectural
changes and clarifications to the VFS API, but this will prevent the system
from panicking when someone does "ls /dev" while running in a shell under the
linuxulator.
This issue affects HEAD and RELENG_6 only.
PR: 88249
Submitted by: "Devon H. O'Dell" <dodell@ixsystems.com>
MFC after: 3 days
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_subr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 6ad6507..6f5f375 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3875,6 +3875,10 @@ vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off) } if (ap->a_ncookies == NULL) return (0); + + KASSERT(ap->a_cookies, + ("NULL ap->a_cookies value with non-NULL ap->a_ncookies!")); + *ap->a_cookies = realloc(*ap->a_cookies, (*ap->a_ncookies + 1) * sizeof(u_long), M_TEMP, M_WAITOK | M_ZERO); (*ap->a_cookies)[*ap->a_ncookies] = off; |