summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaichi GOTO <daichi@FreeBSD.org>2008-05-07 04:47:24 +0000
committerDaichi GOTO <daichi@FreeBSD.org>2008-05-07 04:47:24 +0000
commitd9c85879c80c60c42a159fbae47f040ef26fe156 (patch)
tree857e08800b702a6bf541c12d63a1453c833c5ad2
parent93cf34098b15e1cf5063ba43560da474c47d499d (diff)
Notes
-rw-r--r--sys/fs/unionfs/union_subr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index b04c090551649..82d8f00f7c01d 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -990,8 +990,14 @@ unionfs_check_rmdir(struct vnode *vp, struct ucred *cred, struct thread *td)
uio.uio_resid = iov.iov_len;
error = VOP_READDIR(lvp, &uio, cred, &eofflag, NULL, NULL);
- if (error)
+ if (error != 0)
break;
+ if (eofflag == 0 && uio.uio_resid == sizeof(buf)) {
+#ifdef DIAGNOSTIC
+ panic("bad readdir response from lower FS.");
+#endif
+ break;
+ }
edp = (struct dirent*)&buf[sizeof(buf) - uio.uio_resid];
for (dp = (struct dirent*)buf; !error && dp < edp;