1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

In linuxolator getdents_common(), it seems there is no reason to loop

if no records where returned by VOP_READDIR(). Readdir implementations
allowed to return 0 records when first record is larger then supplied
buffer. In this case trying to execute VOP_READDIR() again causes the
syscall looping forewer.

The goto was there from the day 1, which goes back to 1995 year.

Reported and tested by:	Beat G?tzi <beat chruetertee ch>
MFC after:   2 weeks
This commit is contained in:
Konstantin Belousov 2011-01-19 12:19:25 +00:00
parent fb332e2e88
commit e225428f27
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217578

View File

@ -369,7 +369,6 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args,
lbuf = malloc(LINUX_MAXRECLEN, M_TEMP, M_WAITOK | M_ZERO);
vn_lock(vp, LK_SHARED | LK_RETRY);
again:
aiov.iov_base = buf;
aiov.iov_len = buflen;
auio.uio_iov = &aiov;
@ -506,8 +505,10 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args,
break;
}
if (outp == (caddr_t)args->dirent)
goto again;
if (outp == (caddr_t)args->dirent) {
nbytes = resid;
goto eof;
}
fp->f_offset = off;
if (justone)