summaryrefslogtreecommitdiffstats
path: root/sys/nfs
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-07-09 06:58:03 +0000
committerdg <dg@FreeBSD.org>1995-07-09 06:58:03 +0000
commit24d64ff84ab71285665b581743c53984211e76b5 (patch)
tree500681c97211690541fd1a154b0223e263ed5ab0 /sys/nfs
parent0e9d5904c5f4ac85436f5db08213874f2488f5c1 (diff)
downloadFreeBSD-src-24d64ff84ab71285665b581743c53984211e76b5.zip
FreeBSD-src-24d64ff84ab71285665b581743c53984211e76b5.tar.gz
Moved call to VOP_GETATTR() out of vnode_pager_alloc() and into the places
that call vnode_pager_alloc() so that a failure return can be dealt with. This fixes a panic seen on NFS clients when a file being opened is deleted on the server before the open completes.
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_common.c13
-rw-r--r--sys/nfs/nfs_subs.c13
2 files changed, 20 insertions, 6 deletions
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c
index 86bb5a9..c47d20d 100644
--- a/sys/nfs/nfs_common.c
+++ b/sys/nfs/nfs_common.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.17 1995/06/27 11:06:47 dfr Exp $
+ * $Id: nfs_subs.c,v 1.18 1995/06/28 12:01:05 davidg Exp $
*/
/*
@@ -1905,8 +1905,15 @@ nfsrv_vmio(struct vnode *vp) {
retry:
if ((vp->v_flag & VVMIO) == 0) {
- if (vnode_pager_alloc(vp, 0, 0, 0) == NULL)
- panic("nfsrv_vmio: failed to alloc pager");
+ struct vattr vat;
+ struct proc *p = curproc;
+
+ if (VOP_GETATTR(vp, &vat, p->p_ucred, p) != 0)
+ panic("nfsrv_vmio: VOP_GETATTR failed");
+
+ if (vnode_pager_alloc(vp, vat.va_size, 0, 0) == NULL)
+ panic("nfsrv_vmio: vnode_pager_alloc failed");
+
vp->v_flag |= VVMIO;
} else {
if ((object = vp->v_object) &&
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index 86bb5a9..c47d20d 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.17 1995/06/27 11:06:47 dfr Exp $
+ * $Id: nfs_subs.c,v 1.18 1995/06/28 12:01:05 davidg Exp $
*/
/*
@@ -1905,8 +1905,15 @@ nfsrv_vmio(struct vnode *vp) {
retry:
if ((vp->v_flag & VVMIO) == 0) {
- if (vnode_pager_alloc(vp, 0, 0, 0) == NULL)
- panic("nfsrv_vmio: failed to alloc pager");
+ struct vattr vat;
+ struct proc *p = curproc;
+
+ if (VOP_GETATTR(vp, &vat, p->p_ucred, p) != 0)
+ panic("nfsrv_vmio: VOP_GETATTR failed");
+
+ if (vnode_pager_alloc(vp, vat.va_size, 0, 0) == NULL)
+ panic("nfsrv_vmio: vnode_pager_alloc failed");
+
vp->v_flag |= VVMIO;
} else {
if ((object = vp->v_object) &&
OpenPOWER on IntegriCloud