summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>1998-01-31 01:27:18 +0000
committertegge <tegge@FreeBSD.org>1998-01-31 01:27:18 +0000
commit72e132a1295c212b09cdcc6e187869f623ab69fb (patch)
treec625caea6c4ace20a32e5922fec232a77fe609fa
parentfb57eef279e7dd5016dd7514b5c507929a8fe7ac (diff)
downloadFreeBSD-src-72e132a1295c212b09cdcc6e187869f623ab69fb.zip
FreeBSD-src-72e132a1295c212b09cdcc6e187869f623ab69fb.tar.gz
Release the buffer when an error occurs while reading directory entries.
-rw-r--r--sys/nfs/nfs_bio.c9
-rw-r--r--sys/nfsclient/nfs_bio.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 641d9ec..a9c5c43 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95
- * $Id: nfs_bio.c,v 1.46 1998/01/06 05:21:38 dyson Exp $
+ * $Id: nfs_bio.c,v 1.47 1998/01/25 06:24:09 dyson Exp $
*/
@@ -377,6 +377,9 @@ again:
bp->b_flags |= B_READ;
vfs_busy_pages(bp, 0);
error = nfs_doio(bp, cred, p);
+ if (error) {
+ brelse(bp);
+ }
while (error == NFSERR_BAD_COOKIE) {
nfs_invaldir(vp);
error = nfs_vinvalbuf(vp, 0, cred, p, 1);
@@ -404,9 +407,9 @@ again:
}
}
}
- if (error)
- return (error);
}
+ if (error)
+ return (error);
}
/*
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index 641d9ec..a9c5c43 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.46 1998/01/06 05:21:38 dyson Exp $
+ * $Id: nfs_bio.c,v 1.47 1998/01/25 06:24:09 dyson Exp $
*/
@@ -377,6 +377,9 @@ again:
bp->b_flags |= B_READ;
vfs_busy_pages(bp, 0);
error = nfs_doio(bp, cred, p);
+ if (error) {
+ brelse(bp);
+ }
while (error == NFSERR_BAD_COOKIE) {
nfs_invaldir(vp);
error = nfs_vinvalbuf(vp, 0, cred, p, 1);
@@ -404,9 +407,9 @@ again:
}
}
}
- if (error)
- return (error);
}
+ if (error)
+ return (error);
}
/*
OpenPOWER on IntegriCloud