-/* $OpenBSD: nfs_serv.c,v 1.94 2013/08/13 05:52:25 guenther Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.95 2014/04/21 12:49:34 beck Exp $ */
/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
toff = fxdr_unsigned(u_quad_t, *tl++);
}
-
+ off = toff;
+ cnt = fxdr_unsigned(int, *tl);
+ siz = ((cnt + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1));
+ xfer = NFS_SRVMAXDATA(nfsd);
+ if (siz > xfer)
+ siz = xfer;
+ if (cnt > xfer)
+ cnt = xfer;
+ fullsiz = siz;
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly);
if (error) {
nfsm_reply(NFSX_UNSIGNED);
error = 0;
goto nfsmout;
}
-
- error = getret = VOP_GETATTR(vp, &at, cred, procp);
+ if (info.nmi_v3)
+ error = getret = VOP_GETATTR(vp, &at, cred, procp);
if (!error)
error = nfsrv_access(vp, VEXEC, cred, rdonly, procp, 0);
if (error) {
error = 0;
goto nfsmout;
}
-
- off = toff;
- cnt = fxdr_unsigned(int, *tl);
- siz = ((cnt + at.va_blocksize - 1) & ~(at.va_blocksize - 1));
- xfer = NFS_SRVMAXDATA(nfsd);
- if (siz > xfer)
- siz = xfer;
- if (cnt > xfer)
- cnt = xfer;
- fullsiz = siz;
VOP_UNLOCK(vp, 0, procp);
rbuf = malloc(siz, M_TEMP, M_WAITOK);
again:
tl += 2;
verf = fxdr_hyper(tl);
tl += 2;
-
+ siz = fxdr_unsigned(int, *tl++);
+ cnt = fxdr_unsigned(int, *tl);
+ off = toff;
+ siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1));
+ xfer = NFS_SRVMAXDATA(nfsd);
+ if (siz > xfer)
+ siz = xfer;
+ if (cnt > xfer)
+ cnt = xfer;
+ fullsiz = siz;
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly);
if (error) {
nfsm_reply(NFSX_UNSIGNED);
error = 0;
goto nfsmout;
}
-
error = getret = VOP_GETATTR(vp, &at, cred, procp);
if (!error)
error = nfsrv_access(vp, VEXEC, cred, rdonly, procp, 0);
error = 0;
goto nfsmout;
}
-
- siz = fxdr_unsigned(int, *tl++);
- cnt = fxdr_unsigned(int, *tl);
- off = toff;
- siz = ((siz + at.va_blocksize - 1) & ~(at.va_blocksize - 1));
- xfer = NFS_SRVMAXDATA(nfsd);
- if (siz > xfer)
- siz = xfer;
- if (cnt > xfer)
- cnt = xfer;
- fullsiz = siz;
VOP_UNLOCK(vp, 0, procp);
+
rbuf = malloc(siz, M_TEMP, M_WAITOK);
again:
iv.iov_base = rbuf;