From 12ec7658a4bb665c93f5f8e6d331267a775b1325 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Thu, 24 Jun 2004 18:31:23 +0000 Subject: [PATCH] Annotate that we don't check the returned data length from ufs_readdir() because UFS uses fixed-size directory blocks. When using this code with other file systems, such as HFS+, the value of auio.uio_resid will need to be taken into account. --- sys/ufs/ufs/ufs_extattr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index e39ad17d98b..f31d927d5dd 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -410,6 +410,12 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp, return (error); } + /* + * XXXRW: While in UFS, we always get DIRBLKSIZ returns from + * the directory code on success, on other file systems this + * may not be the case. For portability, we should check the + * read length on return from ufs_readdir(). + */ edp = (struct dirent *)&dirbuf[DIRBLKSIZ]; for (dp = (struct dirent *)dirbuf; dp < edp; ) { #if (BYTE_ORDER == LITTLE_ENDIAN)