:    Now on to the NFSv2 fhlen patch testing.  I haven't run v2 in several
:    months, hopefully it still works :-)

    My buildworld using the NFSv2 file handle length patch succeeded as
    well.

    I've included the patch again for reference.  (Note:  I didn't write
    this patch, refer back to the thread for that info).

                                                -Matt

Index: nfsm_subs.h
===================================================================
RCS file: /home/ncvs/src/sys/nfs/nfsm_subs.h,v
retrieving revision 1.24
diff -u -r1.24 nfsm_subs.h
--- nfsm_subs.h 1999/06/23 04:44:14     1.24
+++ nfsm_subs.h 1999/08/02 17:22:38
@@ -419,24 +419,25 @@
                } }
 
 #define nfsm_srvmtofh(f) \
-       { int fhlen = NFSX_V3FH; \
+       do { \
+               int fhlen; \
                if (nfsd->nd_flag & ND_NFSV3) { \
                        nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
                        fhlen = fxdr_unsigned(int, *tl); \
-                       if (fhlen == 0) { \
-                               bzero((caddr_t)(f), NFSX_V3FH); \
-                       } else if (fhlen != NFSX_V3FH) { \
+                       if (fhlen != 0 && fhlen != NFSX_V3FH) { \
                                error = EBADRPC; \
                                nfsm_reply(0); \
                        } \
+               } else { \
+                       fhlen = NFSX_V2FH; \
                } \
                if (fhlen != 0) { \
-                       nfsm_dissect(tl, u_int32_t *, NFSX_V3FH); \
-                       bcopy((caddr_t)tl, (caddr_t)(f), NFSX_V3FH); \
-                       if ((nfsd->nd_flag & ND_NFSV3) == 0) \
-                               nfsm_adv(NFSX_V2FH - NFSX_V3FH); \
+                       nfsm_dissect(tl, u_int32_t *, fhlen); \
+                       bcopy((caddr_t)tl, (caddr_t)(f), fhlen); \
+               } else { \
+                       bzero((caddr_t)(f), NFSX_V3FH); /* XXX why not do a 
EBADRPC? */ \
                } \
-       }
+       } while (0)
 
 #define        nfsm_clget \
                if (bp >= be) { \


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to