Date: Thu, 19 Feb 2009 15:05:30 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r188815 - head/sys/fs/udf Message-ID: <200902191505.n1JF5Uqk000537@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Thu Feb 19 15:05:30 2009 New Revision: 188815 URL: http://svn.freebsd.org/changeset/base/188815 Log: fs/udf: fix incorrect error return (-1) when reading a large dir Not enough space in user-land buffer is not an error, userland will read further until eof is reached. So instead of propagating -1 to caller we convert it to zero/success. cd9660 code works exactly the same way. PR: kern/78987 Reviewed by: jhb (mentor) Approved by: jhb (mentor) Modified: head/sys/fs/udf/udf_vnops.c Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Thu Feb 19 14:39:52 2009 (r188814) +++ head/sys/fs/udf/udf_vnops.c Thu Feb 19 15:05:30 2009 (r188815) @@ -831,17 +831,16 @@ udf_readdir(struct vop_readdir_args *a) error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); } - if (error) { - printf("uiomove returned %d\n", error); + if (error) break; - } - } /* tell the calling layer whether we need to be called again */ *a->a_eofflag = uiodir.eofflag; uio->uio_offset = ds->offset + ds->off; + if(error < 0) + error = 0; if (!error) error = ds->error;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902191505.n1JF5Uqk000537>