From 4e1f5ebf665a78b4a10137da75322f26219e4613 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 23 Aug 2000 21:11:47 +0000 Subject: [PATCH] When reading dir entry by dir entry, we need to pad out the receive buffer to at least a block to make ufs_readdir happy. --- sys/compat/ibcs2/ibcs2_misc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/ibcs2/ibcs2_misc.c b/sys/compat/ibcs2/ibcs2_misc.c index 47e5150c4220..0519d1944d86 100644 --- a/sys/compat/ibcs2/ibcs2_misc.c +++ b/sys/compat/ibcs2/ibcs2_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_misc.c,v 1.50 2000/08/18 17:38:33 matt Exp $ */ +/* $NetBSD: ibcs2_misc.c,v 1.51 2000/08/23 21:11:47 matt Exp $ */ /* * Copyright (c) 1994, 1995, 1998 Scott Bartram @@ -518,7 +518,7 @@ ibcs2_sys_read(p, v, retval) FILE_UNUSE(fp, p); return sys_read(p, uap, retval); } - buflen = min(MAXBSIZE, SCARG(uap, nbytes)); + buflen = min(MAXBSIZE, max(DEV_BSIZE, SCARG(uap, nbytes))); buf = malloc(buflen, M_TEMP, M_WAITOK); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); off = fp->f_offset; @@ -549,7 +549,7 @@ again: bdp = (struct dirent *)inp; reclen = bdp->d_reclen; if (reclen & 3) - panic("ibcs2_read"); + panic("ibcs2_sys_read"); off = *cookie++; /* each entry points to the next */ if ((off >> 32) != 0) { error = EINVAL; @@ -596,7 +596,7 @@ out: if (cookiebuf) free(cookiebuf, M_TEMP); free(buf, M_TEMP); - out1: +out1: FILE_UNUSE(fp, p); return (error); }