summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-10-28 08:50:08 +0000
committerbde <bde@FreeBSD.org>1995-10-28 08:50:08 +0000
commit8e1f5c1aadc0c84c471992476b1a36c3509804f9 (patch)
tree2921e6771b35a4f94b5e84d23549319b29b26533
parent60d1e7bc0618c40becfa81110920a8835bcdd923 (diff)
downloadFreeBSD-src-8e1f5c1aadc0c84c471992476b1a36c3509804f9.zip
FreeBSD-src-8e1f5c1aadc0c84c471992476b1a36c3509804f9.tar.gz
Call vfs_unbusy() before error returns from sysctl_vnode(). This fixes
PR 795. Set the size before one error return from sysctl_vnode() the same as before the other. The caller might want to know about the amount successfully read although the current caller doesn't.
-rw-r--r--sys/kern/vfs_export.c10
-rw-r--r--sys/kern/vfs_subr.c10
2 files changed, 14 insertions, 6 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 7cd54e5..d6c1cc0 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
- * $Id: vfs_subr.c,v 1.35 1995/08/11 11:31:07 davidg Exp $
+ * $Id: vfs_subr.c,v 1.36 1995/08/25 20:49:44 bde Exp $
*/
/*
@@ -1315,12 +1315,16 @@ again:
goto again;
}
if (bp + VPTRSZ + VNODESZ > ewhere) {
+ vfs_unbusy(mp);
*sizep = bp - where;
return (ENOMEM);
}
- if ((error = copyout((caddr_t) &vp, bp, VPTRSZ)) ||
- (error = copyout((caddr_t) vp, bp + VPTRSZ, VNODESZ)))
+ if ((error = copyout(&vp, bp, VPTRSZ)) ||
+ (error = copyout(vp, bp + VPTRSZ, VNODESZ))) {
+ vfs_unbusy(mp);
+ *sizep = bp - where;
return (error);
+ }
bp += VPTRSZ + VNODESZ;
}
vfs_unbusy(mp);
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 7cd54e5..d6c1cc0 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
- * $Id: vfs_subr.c,v 1.35 1995/08/11 11:31:07 davidg Exp $
+ * $Id: vfs_subr.c,v 1.36 1995/08/25 20:49:44 bde Exp $
*/
/*
@@ -1315,12 +1315,16 @@ again:
goto again;
}
if (bp + VPTRSZ + VNODESZ > ewhere) {
+ vfs_unbusy(mp);
*sizep = bp - where;
return (ENOMEM);
}
- if ((error = copyout((caddr_t) &vp, bp, VPTRSZ)) ||
- (error = copyout((caddr_t) vp, bp + VPTRSZ, VNODESZ)))
+ if ((error = copyout(&vp, bp, VPTRSZ)) ||
+ (error = copyout(vp, bp + VPTRSZ, VNODESZ))) {
+ vfs_unbusy(mp);
+ *sizep = bp - where;
return (error);
+ }
bp += VPTRSZ + VNODESZ;
}
vfs_unbusy(mp);
OpenPOWER on IntegriCloud