From owner-svn-src-all@FreeBSD.ORG Fri Feb 27 17:29:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEC8010656D8; Fri, 27 Feb 2009 17:29:31 +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 9DF908FC1A; Fri, 27 Feb 2009 17:29:31 +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 n1RHTVBo076278; Fri, 27 Feb 2009 17:29:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1RHTV4I076277; Fri, 27 Feb 2009 17:29:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200902271729.n1RHTV4I076277@svn.freebsd.org> From: Andriy Gapon Date: Fri, 27 Feb 2009 17:29:31 +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: r189111 - head/sys/fs/udf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 17:29:32 -0000 Author: avg Date: Fri Feb 27 17:29:31 2009 New Revision: 189111 URL: http://svn.freebsd.org/changeset/base/189111 Log: udf_readatoffset: return correct size and data pointer for data in fentry This should help correct reading of directories with data located in fentry. Submitted by: bde 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 Fri Feb 27 17:27:16 2009 (r189110) +++ head/sys/fs/udf/udf_vnops.c Fri Feb 27 17:29:31 2009 (r189111) @@ -1319,6 +1319,12 @@ udf_readatoffset(struct udf_node *node, fentry = node->fentry; *data = &fentry->data[le32toh(fentry->l_ea)]; *size = le32toh(fentry->l_ad); + if (offset >= *size) + *size = 0; + else { + *data += offset; + *size -= offset; + } return (0); } else if (error != 0) { return (error);