The branch main has been updated by jah:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=fb273fe70f8be66bb946c5a2ea1e53042bbada48

commit fb273fe70f8be66bb946c5a2ea1e53042bbada48
Author:     Jason A. Harmening <[email protected]>
AuthorDate: 2021-10-28 05:31:52 +0000
Commit:     Jason A. Harmening <[email protected]>
CommitDate: 2021-11-06 14:08:34 +0000

    unionfs: replace zero-length read check with KASSERT
    
    The lower FS VOP_READDIR() shouldn't return an empty read without
    setting EOF; don't try to handle this case only for non-DIAGNOSTIC
    builds.
    
    Noted by:       kib
    Reviewed by:    kib
    Differential Revision:  https://reviews.freebsd.org/D32629
---
 sys/fs/unionfs/union_subr.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index 0ca209c47502..8269b1e11fa4 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -1251,13 +1251,8 @@ unionfs_check_rmdir(struct vnode *vp, struct ucred 
*cred, struct thread *td)
                error = VOP_READDIR(lvp, &uio, cred, &eofflag, NULL, NULL);
                if (error != 0)
                        break;
-               if (eofflag == 0 && uio.uio_resid == sizeof(buf)) {
-#ifdef DIAGNOSTIC
-                       panic("%s: bad readdir response from lower FS",
-                           __func__);
-#endif
-                       break;
-               }
+               KASSERT(eofflag != 0 || uio.uio_resid < sizeof(buf),
+                   ("%s: empty read from lower FS", __func__));
 
                edp = (struct dirent*)&buf[sizeof(buf) - uio.uio_resid];
                for (dp = (struct dirent*)buf; !error && dp < edp;

Reply via email to