Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Feb 2009 17:29:31 +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: r189111 - head/sys/fs/udf
Message-ID:  <200902271729.n1RHTV4I076277@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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