summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authordaichi <daichi@FreeBSD.org>2008-04-25 07:58:19 +0000
committerdaichi <daichi@FreeBSD.org>2008-04-25 07:58:19 +0000
commit0900f3eabb0fac45ce9923737d558fac8c760cee (patch)
tree7faa07d32591b008acdb5611f64953a07dc56c3e /sys/fs
parent41b995a0c997b2c330a54d6227775191289ba299 (diff)
downloadFreeBSD-src-0900f3eabb0fac45ce9923737d558fac8c760cee.zip
FreeBSD-src-0900f3eabb0fac45ce9923737d558fac8c760cee.tar.gz
o Added system hang-up process when VOP_READDIR of unionfs_nodeget()
returns not end of the file status on debug mode (DIAGNOSTIC defined) kernel. Submitted by: Masanori OZAWA (ozawa@ongs.co.jp) MFC after: 1 week
Diffstat (limited to 'sys/fs')
-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 05e9399..c032ec8 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -989,8 +989,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;
OpenPOWER on IntegriCloud