From a68ae31c713d97007d53a07a156c06080b9917d7 Mon Sep 17 00:00:00 2001 From: Daichi GOTO Date: Fri, 25 Apr 2008 07:58:19 +0000 Subject: [PATCH] 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 --- sys/fs/unionfs/union_subr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 05e939935772..c032ec82fc8d 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;