Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Feb 2011 12:22:44 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r218187 - stable/8/sys/compat/linux
Message-ID:  <201102021222.p12CMiq0008897@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Feb  2 12:22:44 2011
New Revision: 218187
URL: http://svn.freebsd.org/changeset/base/218187

Log:
  MFC r217578:
  In linuxolator getdents_common(), do not loop if no records were returned
  by VOP_READDIR().

Modified:
  stable/8/sys/compat/linux/linux_file.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_file.c
==============================================================================
--- stable/8/sys/compat/linux/linux_file.c	Wed Feb  2 11:13:23 2011	(r218186)
+++ stable/8/sys/compat/linux/linux_file.c	Wed Feb  2 12:22:44 2011	(r218187)
@@ -373,7 +373,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;
@@ -510,8 +509,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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102021222.p12CMiq0008897>