Linuxolator calls VOP_READDIR with ncookies pointer. Implement a

workaround for fdescfs to not panic when ncookies is not NULL, similar
to the one committed as r152254, but simpler, due to fdescfs_readdir()
not calling vfs_read_dirent().

PR:	kern/156177
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2011-04-09 21:40:48 +00:00
parent 139127ce5e
commit e06c3d4363

View File

@ -500,16 +500,12 @@ fdesc_readdir(ap)
struct dirent *dp = &d;
int error, i, off, fcnt;
/*
* We don't allow exporting fdesc mounts, and currently local
* requests do not need cookies.
*/
if (ap->a_ncookies)
panic("fdesc_readdir: not hungry");
if (VTOFDESC(ap->a_vp)->fd_type != Froot)
panic("fdesc_readdir: not dir");
if (ap->a_ncookies != NULL)
*ap->a_ncookies = 0;
off = (int)uio->uio_offset;
if (off != uio->uio_offset || off < 0 || (u_int)off % UIO_MX != 0 ||
uio->uio_resid < UIO_MX)