svn commit: r188815 - head/sys/fs/udf
Andriy Gapon
avg at FreeBSD.org
Thu Feb 19 07:05:33 PST 2009
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;
More information about the svn-src-all
mailing list