summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_bio.c
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1997-04-03 07:52:00 +0000
committerdfr <dfr@FreeBSD.org>1997-04-03 07:52:00 +0000
commitf48135a6e16c092b53acee09338279ff38641fe8 (patch)
tree058146a0a901d10078fba86e0310b7a8c2f6b363 /sys/nfsclient/nfs_bio.c
parent3dc44eb7dded1b82b67bfbaffff6355fccbe4582 (diff)
downloadFreeBSD-src-f48135a6e16c092b53acee09338279ff38641fe8.zip
FreeBSD-src-f48135a6e16c092b53acee09338279ff38641fe8.tar.gz
The code which recovered from a modified directory situation did not check
for eof when re-caching the directory. This could cause it to loop forever if a directory was truncated.
Diffstat (limited to 'sys/nfsclient/nfs_bio.c')
-rw-r--r--sys/nfsclient/nfs_bio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index e44450f..b5912b5 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95
- * $Id: nfs_bio.c,v 1.32 1997/02/22 09:42:35 peter Exp $
+ * $Id: nfs_bio.c,v 1.33 1997/03/09 10:21:26 bde Exp $
*/
@@ -293,6 +293,10 @@ again:
break;
case VDIR:
nfsstats.biocache_readdirs++;
+ if (np->n_direofoffset
+ && uio->uio_offset >= np->n_direofoffset) {
+ return (0);
+ }
lbn = uio->uio_offset / NFS_DIRBLKSIZ;
on = uio->uio_offset & (NFS_DIRBLKSIZ - 1);
bp = nfs_getcacheblk(vp, lbn, NFS_DIRBLKSIZ, p);
@@ -315,6 +319,9 @@ again:
* offset cookies.
*/
for (i = 0; i <= lbn && !error; i++) {
+ if (np->n_direofoffset
+ && (i * NFS_DIRBLKSIZ) >= np->n_direofoffset)
+ return (0);
bp = nfs_getcacheblk(vp, i, NFS_DIRBLKSIZ, p);
if (!bp)
return (EINTR);
OpenPOWER on IntegriCloud