From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 15:05:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA1F1106566C; Thu, 19 Feb 2009 15:05:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 943F18FC0C; Thu, 19 Feb 2009 15:05:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JF5U6H000538; Thu, 19 Feb 2009 15:05:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JF5Uqk000537; Thu, 19 Feb 2009 15:05:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200902191505.n1JF5Uqk000537@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Feb 2009 15:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188815 - head/sys/fs/udf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 15:05:33 -0000 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;