svn commit: r217578 - head/sys/compat/linux
Konstantin Belousov
kib at FreeBSD.org
Wed Jan 19 12:19:26 UTC 2011
Author: kib
Date: Wed Jan 19 12:19:25 2011
New Revision: 217578
URL: http://svn.freebsd.org/changeset/base/217578
Log:
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
Modified:
head/sys/compat/linux/linux_file.c
Modified: head/sys/compat/linux/linux_file.c
==============================================================================
--- head/sys/compat/linux/linux_file.c Wed Jan 19 10:30:49 2011 (r217577)
+++ head/sys/compat/linux/linux_file.c Wed Jan 19 12:19:25 2011 (r217578)
@@ -369,7 +369,6 @@ getdents_common(struct thread *td, struc
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 @@ again:
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)
More information about the svn-src-head
mailing list