1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-11 14:10:34 +00:00

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.
This commit is contained in:
Bruce Evans 1995-10-28 08:50:08 +00:00
parent 7700fd358f
commit e887950a45
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11852
2 changed files with 14 additions and 6 deletions

View File

@ -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 @@ sysctl_vnode(where, sizep)
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);

View File

@ -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 @@ sysctl_vnode(where, sizep)
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);