svn commit: r190049 - in stable/7/sys: . fs/udf
Andriy Gapon
avg at FreeBSD.org
Thu Mar 19 07:07:28 PDT 2009
Author: avg
Date: Thu Mar 19 14:07:27 2009
New Revision: 190049
URL: http://svn.freebsd.org/changeset/base/190049
Log:
MFC 189069: udf_map: return proper error code instead of leaking an internal one
Approved by: jhb (mentor)
Modified:
stable/7/sys/ (props changed)
stable/7/sys/fs/udf/udf_vnops.c
Modified: stable/7/sys/fs/udf/udf_vnops.c
==============================================================================
--- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:04:59 2009 (r190048)
+++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:07:27 2009 (r190049)
@@ -1039,8 +1039,19 @@ udf_bmap(struct vop_bmap_args *a)
if (a->a_runb)
*a->a_runb = 0;
- error = udf_bmap_internal(node, a->a_bn * node->udfmp->bsize, &lsector,
- &max_size);
+ /*
+ * UDF_INVALID_BMAP means data embedded into fentry, this is an internal
+ * error that should not be propagated to calling code.
+ * Most obvious mapping for this error is EOPNOTSUPP as we can not truly
+ * translate block numbers in this case.
+ * Incidentally, this return code will make vnode pager to use VOP_READ
+ * to get data for mmap-ed pages and udf_read knows how to do the right
+ * thing for this kind of files.
+ */
+ error = udf_bmap_internal(node, a->a_bn << node->udfmp->bshift,
+ &lsector, &max_size);
+ if (error == UDF_INVALID_BMAP)
+ return (EOPNOTSUPP);
if (error)
return (error);
More information about the svn-src-stable
mailing list